Skip to main content

Questions tagged [pyomo]

For questions related to the Python optimization modeling package Pyomo. Pyomo is a Python-based open-source software package that supports a diverse set of optimization capabilities for formulating, solving, and analyzing optimization models. Pyomo allows users to formulate optimization problems in Python in a manner that is similar to the notation commonly used in mathematical optimization.

Filter by
Sorted by
Tagged with
25 votes
3 answers
10k views

What is the purpose of libraries like Pyomo and Google OR tools?

I'm new to the OR world, and trying to learn the various tools available. I originally thought that Pyomo and Google OR tools were open source alternatives to commercial solvers like Gurobi or CPLEX. ...
Skander H.'s user avatar
  • 2,139
19 votes
4 answers
9k views

NLP solvers in pyomo other than ipopt?

I am solving a highly constrained (large number of constraints and large number of variables, but small degree of freedom) NLP problem, and for start, I was using Matlab's ...
Stanny_boy's user avatar
15 votes
2 answers
4k views

Is Apple's M1 suitable for Operations Research?

I am curious about the performance of Apple's M1 chip solving optimizations models, MIP, LP, and in solutions approach as benders or columns generations. I read that is a spectacular cpu to perform ...
orpanter's user avatar
  • 517
11 votes
4 answers
18k views

What is the best open source solver for large scale LP optimization in pyomo?

I have used Gurobi and cplex for solving large scale LP problems with Pyomo. However, I do need to use open source solver. Any advise? glpk and cbc seems to be very slow in solving the problem (with ...
Optimization team's user avatar
11 votes
1 answer
971 views

Termination Criteria of Solver in Pyomo

I am solving a nonlinear optimization problem using Pyomo with Ipopt as solver. The solver exits with the status: EXIT: Optimal Solution Found. This I can cross ...
chupa_kabra's user avatar
  • 1,485
10 votes
2 answers
827 views

Modeling and solvers

I have just started to dive into OR world on my work. Currently we are using GAMS with Gurobi but some of us have strong programming background and would like to have more programmatic approach to OR. ...
aurelije's user avatar
  • 203
10 votes
2 answers
3k views

How to get GAMS's solvers to work from Pyomo?

I want to run a model written in Pyomo language with CPLEX solver of GAMS. However I get the following error: ...
rgholizadehr's user avatar
10 votes
1 answer
580 views

How to get solver time from CPLEX when using the NEOS server through Pyomo?

I've been using CPLEX on the NEOS server, via Pyomo, to solve a binary program I'm working on. NEOS is amazing, but the documentation is somewhat lacking on the Pyomo side, so I haven't been able to ...
domdomdom's user avatar
  • 421
9 votes
3 answers
5k views

Can I use 'SCIP' solver for PYOMO?

I have an MINLP problem to solve where I was initially using 'ipopt' solver but the solution was not sticking to 'binary/boolean/integer' domain type for a variable. I am not sure which free solver ...
Nikita Agrawal's user avatar
9 votes
2 answers
3k views

Reading an LP/MPS file using Pyomo software

I would like to know is it possible to read an LP/MPS file into the Pyomo software and solve the problem? If so, how can I do that?
A.Omidi's user avatar
  • 8,960
9 votes
2 answers
607 views

Integer Decision Variables Always Forced to Zero in Minimization Problem (MINLP)

I am trying to write out a MINLP problem of optimal control for an invasive species and the code that I have for my PYOMO model is below. Some of the initialization values take from an Excel ...
GrayLiterature's user avatar
9 votes
1 answer
388 views

pyomo - pass time limit to NEOS

I am sending a pretty complex Pyomo MINLP to NEOS using Couenne. I'm getting an error message that the solve time is too long (sorry, I don't have it still in my Python console). Is there a way to set ...
Ralph's user avatar
  • 371
9 votes
1 answer
2k views

Pyomo: Looping Over A Variable Method

I am trying to extract my variable values into unique lists so that I can pass them to a panadas dataframe and eventually export the dataframe to Excel after I solve my model. The idea is to have the ...
GrayLiterature's user avatar
8 votes
2 answers
760 views

knapsack problem with non-linear constraint

I have a basic knapsack problem where I need to fit the most weight possible in a bin: ...
Cesar Canassa's user avatar
8 votes
1 answer
439 views

Why is Gurobi output in Pyomo returning floating-point values rather than optimal integer solution?

I am hoping someone will be able to point me in the direction of why I am experiencing floating-point outputs rather than simply model.X = [15,15] and model.Z = [15,5] as solutions to this model? Note ...
Jwem93's user avatar
  • 333
8 votes
1 answer
652 views

Understanding why this MINLP formulation is infeasible

Algebraic Formulation - Note: All parameter values are subject to change, I have just used the numbers you see here as place holders for the time being. Additionally, there are a few other equations ...
GrayLiterature's user avatar
8 votes
1 answer
888 views

Formulating a MINLP for CPLEX in PYOMO

I am trying to do my first MINLP problem using PYOMO and CPLEX - although I am not committed to using CPLEX, but it was recommended to me. To my understanding you need to formulate your problem in ...
GrayLiterature's user avatar
8 votes
1 answer
1k views

Understanding the AMPL Solver LIbrary within Pyomo

For anyone familiar with the Pyomo book, it occasionally makes reference to the AMPL Solver Library, and to my understanding, if you can manage to hook up to the solver library then you are able to ...
GrayLiterature's user avatar
8 votes
1 answer
2k views

How to set a maximum time to improve a solution with Pyomo and CBC

In relation to using CBC via Pyomo: I was wondering if anyone knew if it was possible to set a maximum allowed time to improve a solution, rather than a maximum total time. This way, if you've been ...
domdomdom's user avatar
  • 421
8 votes
1 answer
107 views

Is there any way to use Lazy constraints in Pyomo?

I would like to know if there is any way to implement a Lazy constraint in the Pyomo package. (As far as I know, the only way to implement such a constraint is by ...
A.Omidi's user avatar
  • 8,960
7 votes
1 answer
1k views

Problem is infeasible with Gurobi, feasible with cbc (but can't access objective value)

I am solving a MILP with cbc and gurobi (via pyomo). Gurobi states that the model is infeasible. As to cbc the solver status states that a feasible and optimal solution is found, but then it fails to ...
Meth's user avatar
  • 424
7 votes
2 answers
2k views

Pyomo: Building Up A Constraint Over An Index

I am trying to create a constraint for model.z that builds up as a summation during a new time index. I tried to use the += but this does not work with Constraints ...
GrayLiterature's user avatar
7 votes
1 answer
591 views

Using CBC CLI Arguments in Pyomo

I am currently using the cbc solver with Pyomo opt = SolverFactory('cbc') opt.solve(model) How can more options for Cbc be used,...
Athena Wisdom's user avatar
7 votes
1 answer
690 views

Problems Installing APOPT in Pyomo

I am trying to install the solver "APOPT" in Pyomo by following the guidelines laid out below: *Instructions for usage: Place apopt.py in an appropriate folder in the system path (e.g. Linux, /usr/...
GrayLiterature's user avatar
7 votes
1 answer
1k views

Pyomo: Is this triple summation objective function formatted correctly?

I am writing a Pyomo model and trying to code the following mathematical constraint: $$ \sum_{i=1}^I\sum_{j=1}^J\sum_{t=1}^T 5I_{ijt} + 10L_{ijt}I_{ijt} $$ where $L_{ijt}$ is binary. However, I am ...
GrayLiterature's user avatar
6 votes
2 answers
6k views

What Exactly Is A Warm Start? [duplicate]

I am fairly new to optimization modelling but I am encountering a situation in which I supply initial values to my problem and then after I run my optimization those initial values change. This seems ...
GrayLiterature's user avatar
6 votes
1 answer
905 views

Python "Coffee Shop Scheduling Problem" - Scheduling Lunches/Breaks

I'm working on an employee scheduling program in python. Having never done this before, I've been researching different libraries that can be used to accomplish the task. Unfortunately, none of the ...
t25's user avatar
  • 63
6 votes
1 answer
598 views

Can GLPK be used to solve an optimal team selection problem?

My Problem I am quite new to optimisation, so any advice is appreciated. I am currently trying to solve a problem as follows: Given a pool of people, we want to create n teams such to find the optimal ...
Jwem93's user avatar
  • 333
6 votes
0 answers
233 views

Provide basic solution to CLP

I'm using Pyomo to formulate an LP with approx 500,000 constraints and 200,000 decision variables. The LP is solved using CLP. Some instances fail to return even a feasible solution after many ...
dijkstraa's user avatar
5 votes
3 answers
826 views

how to "calm down" optimizer

I want to optimize a charging schedule for Battery Electric Vehicles (BEV) along a grid line, taking into account customer wishes (when to be done with charging with what State of Charge (SOC)) and ...
Andre's user avatar
  • 303
5 votes
1 answer
937 views

CPLEX gives different solutions of MILP every run

I am solving a mixed-integer (binary) linear problem using CPLEX as a solver (branch-and-bound method). But I encountered the following issue. Each run I get a different solution at a different node ...
errenmike1806's user avatar
5 votes
3 answers
3k views

How to install Ipopt on Google Colab for Pyomo?

I need to use Pyomo with Ipopt solver on Google-Colab. In order to install it I did as follows: Now I need to use it , I get the following error ? ApplicationError: No executable found for solver '...
Optimization team's user avatar
5 votes
1 answer
900 views

pyomo/ipopt: nonlinear network optimization not converging

The question (very short version) Why can I not decrease the lower boundary for the decision variable model.v_dot (see implementation) below 30 ? As soon as I do so,...
Khalilbs's user avatar
5 votes
2 answers
459 views

Failing to meet a constraint in a NLP problem

I have a NLP problem at hand, which I am trying to solve via Pyomo + ipopt. I try to run several different instances of the optimizer with different conditions, out ...
chupa_kabra's user avatar
  • 1,485
5 votes
2 answers
441 views

Installing COIN-OR solvers in Ubuntu (Azure)

For a side project, I'm looking to install COIN-OR project solvers on a Microsoft Azure Ubuntu VM. (I will be running Pyomo optimization models on this VM as well; using NEOS isn't cutting it.) ...
Ralph's user avatar
  • 371
5 votes
1 answer
946 views

Does pyomo support column generation?

I want to use column generation technique to solve cutting stock problem. Is there any other python modeling library that supports column generation?
Sina Haji Kazemi's user avatar
5 votes
1 answer
137 views

How to transfer an optimization problem written with GUROBI (in python) in a grammar that can be readily solved with another solver?

Trying to use an opensource optimization tool in python (having used only gurobi for years) I see that the whole code (representing the optimization problem in pythonic language) must be written ...
Makis Karasavvidis's user avatar
5 votes
0 answers
227 views

How to use interpolation for problem parameters in Pyomo

I'm working on my first Pyomo DAE project to teach myself how to use it for trajectory optimization. I have generated an atmosphere lookup table with density and speed of sound as a function of ...
machalot's user avatar
4 votes
1 answer
691 views

Constraintlist with two Options Pyomo

I recently started with Pyomo and I have the following Problem: I want to construct a ConstraintList with an if statement. I already learned, that it's not possible. But the problem still exists... My ...
LordBasher123's user avatar
4 votes
2 answers
383 views

Setting up Branching Priority for GUROBI in Pyomo

I am currently experimenting with GUROBI and would appreciate some kind advice on the following: In Pyomo: Setting variable branching priorities, there was a response to doing so for CPLEX, hence I ...
Mike's user avatar
  • 717
4 votes
1 answer
190 views

Edit .NL files to reformulate problem instances

I would like to run a solvers comparison on several instances of MINLPLib. I can get the .NL files for each instance. Now, I would like to reformulate several instances and I need to edit the .NL ...
Luca's user avatar
  • 59
4 votes
1 answer
324 views

Creating constraints dynamically in pyomo abstract model

I have a networkX graph with few nodes and these nodes have attributes such as "demand". ...
Waqas Swati's user avatar
4 votes
2 answers
715 views

Compute Irreducible Infeasible Set (IIS) in Pyomo

I am using Pyomo together with Gurobi (and other solvers such as cbc). I am trying to compute an Irreducible Infeasible Set (ISS). In Pyomo documentation, ...
Meth's user avatar
  • 424
4 votes
1 answer
712 views

Referencing of sets in Pyomo objectives

I have a question about referecing set in Pyomo objectives. Basically I have 2 options and I do not understand why one of it works whereas the other yields an error. Here you see them: ...
PeterBe's user avatar
  • 1,652
4 votes
1 answer
3k views

Pyomo add constraint error: Rule failed when generation expression for constraint

I am trying to solve a model with Pyomo and struggling with indexing. Below is a simple problem instance, where you can also see the error. The message is straightforward and self-explanatory but ...
tcokyasar's user avatar
  • 1,249
4 votes
1 answer
227 views

BARON Error: variables/rows fixed as scaled bounds too close

I am trying to build my model up and keep running into this output from BARON: Clp0019I {x} variables/rows fixed as scaled bounds too close. I checked the BARON ...
GrayLiterature's user avatar
4 votes
1 answer
97 views

In pyomo, any reason for using "model.<nameofvariable>" throughout the code instead of doing "<nameofvariable> = model.<nameofvariable>" and using it?

The question is a bit self explanatory I believe, but just to give a simple example (this is not the entire model of course): ...
epilefst's user avatar
  • 159
4 votes
0 answers
1k views

Google-OR tools vs Pyomo and other commercial Solvers for solving a simple maximum flow problem

I have implemented a Pyomo model for solving maximum flow problem as a subroutine of an algorithm. However, the approach does not scale very well because Pyomo does not provide a very good way to re-...
Pia MiA's user avatar
  • 390
4 votes
0 answers
155 views

How to invoke a solution pool and access all the solutions in cplex using PYOMO ? this is the structure of my pyomo code

...
Prachi Patki's user avatar
3 votes
5 answers
764 views

Convert MCP model from GAMS to Pyomo

I have a Mixed Complementarity Problem (MCP) that represents a market under perfect competition. The model is written in GAMS and works as expected. But when translating it to Python, using Pyomo, the ...
Solver Max's user avatar