New answers tagged

1

When you say model.x then you know that this x is a part of the model but if you see model.x-X==2 what can you say about the X ? is it a constant ? constant in the model ? var in the model ? This also applies to naming the variables if you use model.i it works alternatively, if you use model.generators it works as well! but in the second case it is more ...


10

One problem you might encounter is that the many solvers are either not available for M1 like CPLEX[1. M1 support for Gurobi might be mixed in general due to issue like "Only use single-threaded BLAS on Mac to avoid overshooting the thread limit" [3] and limited memory which might become a big problem for large systems. You could probably get an ...


6

The Mittlemann benchmarks are an excellent benchmark as ever in particular these two: Benchmark of Barrier LP solvers Large Network-LP Benchmark (commercial vs free) Note that Pyomo doesn't have bindings for most of these locally. If you are just looking for high-level modeling language and are not tied to Python you could use the JuMP modeling language ...


3

For large LPs you need an interior point solver. On top of what others have mentioned, you can use CLP's interior point method, or, interestingly, just plain old IPOPT can work perfectly fine since it will also apply an interior point algorithm.


2

Before creating the instance, you should provide the value for model.Nc (not model.NC). It should look like: opt = SolverFactory('glpk') model.Nc=4 #correct this variable Nc instance = model.create_instance() results = opt.solve(instance) # solves and updates instance print('NC= ',value(instance.Nc)) print('OF= ',value(instance.obj))


6

A variable that can assume values of zero or between some lower and upper bound is called a semi-continuous variable. Most high-end solvers have direct support for this type of variable. If not supported, you can model this with an additional binary variable: $$\begin{align} & \color{darkblue}L\cdot \color{darkred}\delta \le \color{darkred}x \le \color{...


Top 50 recent answers are included