Pyomo is a Python-based open-source software package that supports a diverse set of optimization capabilities for formulating, solving, and analyzing optimization models.
Questions tagged [pyomo]
1504 questions
14
votes
3 answers
Multi-objective optimization example Pyomo
Any example for multi-objective optimization in Pyomo?
I am trying to minimize 4 Objectives (Non Linear) and I would like to use pyomo and ipopt. Have also access to Gurobi.
I want to see even very simple example where we try to optimize for two…

Golf Kilo Bravo
- 143
- 1
- 1
- 5
13
votes
3 answers
Performance of pyomo to generate a model with a huge number of constraints
I am interested in the performance of Pyomo to generate an OR model with a huge number of constraints and variables (about 10e6). I am currently using GAMS to launch the optimizations but I would like to use the different python features and…

Dimitri Tomanos
- 153
- 2
- 8
12
votes
2 answers
pyomo + reticulate error 6 the handle is invalid
I'm trying to run a pyomo optimization and I get the error message [Error 6] The handle is invalid. Not sure how to interpret it, looking around it seems to have something to do with privileges but I don't really understand it.
Find below the…

lrnzcig
- 3,868
- 4
- 36
- 50
8
votes
2 answers
Pyomo ValueError: Invalid constraint expression
I am writing a pyomo integer programme with a constraint of the form:
def example_rule(model, j, t):
value = sum(model.x[j,i]*(util[i][t]) for i in model.F)
return 0 <= value <= 1
model.onelateral = Constraint(model.L, model.T,…

fishy321
- 83
- 1
- 4
8
votes
2 answers
How to set Pyomo solver timeout?
How to set the timeout for Pyomo solve() method ? More specifically, to tell pyomo, after x seconds, return the optimal solution currently found ?

zyzo
- 305
- 3
- 12
7
votes
3 answers
Pyomo: Access Solution From Python Code
I have a linear integer programme I want to solve. I installed solver glpk (thanks to this answer) and pyomo. I wrote code like this:
from pyomo.environ import *
from pyomo.opt import SolverFactory
a = 370
b = 420
c = 2
model =…

Ken
- 157
- 1
- 1
- 6
7
votes
4 answers
How do you install glpk-solver along with pyomo in Winpython
I want to use "pyomo" for my studies. I installed pyomo via easy_install
coopr install instructions, Pyomo needs a solver to work so I wanted to install the
(GNU Linear Programming Kit) glpk_webpage, pyomo seems to be installed just right because I…

www.pieronigro.de
- 840
- 2
- 12
- 30
6
votes
1 answer
How you enable CBC to return best solution when timelimit? (Pyomo)
I am trying to use CBC(v2.10.3) on Pyomo to solve for a integer linear problem.
When executing the solver, I am currently setting a timelimit of 600s.
opt = SolverFactory ("cbc")
opt.options['seconds'] =600
Within this timelimit, solver manages to…

tb_
- 61
- 1
- 3
6
votes
1 answer
Does Pyomo support generation of multiple solutions?
I've been using Gurobi to solve an MILP problem, and Pyomo for generating the model. Gurobi supports returning a Solution pool, and I want to be able to generate multiple solutions using this pool. Is this supported in Pyomo?
I've tried using…

Suhas Pai
- 63
- 4
6
votes
2 answers
Finding out reason of Pyomo model infeasibility
I got a pyomo concrete model with lots of variables and constraints.
Somehow, one of the variable inside my model violates one constraint, which makes my model infeasible:
WARNING: Loading a SolverResults object with a warning status into…

oakca
- 1,408
- 1
- 18
- 40
6
votes
0 answers
Pyomo cannot find GLPK solver on Docker machine
I have a Docker machine running Linux. I am using Pyomo with the GLPK solver. I installed GLPK from the shell command line for the Docker image, using apt-get install glpk-utils
I have all my code saved under the subfolder /code
I can see glpsol is…

Ryan Skene
- 864
- 1
- 12
- 29
6
votes
2 answers
Installing Pyomo on Windows with Anaconda (Python)
I would like to solve LP and ILP with Pyomo (Coopr) but unfortunately I am so newbie and I cannot run it properly.
I have already installed Pyomo (Coopr) by following its instructions
pip install Coopr
I can import the module without problems:
$…

FZNB
- 2,703
- 3
- 17
- 17
5
votes
1 answer
How to extract Indexed Variable information in pyomo Model and build Pandas Dataframe
I am attempting to solve a MIP using Pyomo with several Indexed Variables of different sizes. What I would like to do is export the results of the variables to a dataframe so that I can further analyze these results. My problem is that I cannot…

Corey Duncan
- 53
- 1
- 4
5
votes
1 answer
Defining specific set of values for 2 variables in PYOMO
I am trying to assign material property using multiple variables. For example; density and conductivity are two decision variables for material_1, material_2 and material_3.
I have to input the following information:
density of material_1 =…

Rua Goa
- 127
- 9
5
votes
0 answers
Pyomo - Objective function as average value of param
I am trying to use Pyomo for an LP problem and I would like the objective function to be the mean value of a particular parameter in my dataframe (which I'll call obj_param).
I had previously set this up like so:
model =…

seth127
- 2,594
- 5
- 30
- 43