Questions tagged [python]

For questions about solving Operations Research problems using the Python programming language.

Filter by
Sorted by
Tagged with
10
votes
1answer
845 views

Simulation in Python

What is the most common package for discrete-event simulation in the OR community? I have found SimPy package.
10
votes
2answers
622 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: ...
7
votes
1answer
289 views

Can docplex (module for Constraint Programming optimizer CPLEX for Python) read .lp or .mps file?

I want to solve a problem with docplex.cp (module for Constraint Programming optimizer CPLEX for Python), and the problem is available in ...
10
votes
2answers
151 views

Are there examples of spatially explicit MIP problems?

Disclosure: I am an MSc student in economics, but not an expert by any means in OR. I am trying to model a spatial MIP problem of an invasive species similar to this academic paper, however, my ...
11
votes
1answer
382 views

Change coefficient in PuLP

Once a model is implemented in PuLP, how do you change a coefficient (e.g., $a_{ij}$, $b_i$ or $c_j$) of a program of the from $\min\{c^{\top}x: Ax=b, x\geq0\}$? Specifically: How to update ...
10
votes
1answer
285 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 ...
8
votes
3answers
2k views

Python API and CPLEX

Note: See the EDIT below for one possible solution. I apologize if this is not appropriate but I don't really have anywhere else to turn. I was hoping that someone would be able to post how they ...
12
votes
3answers
772 views

How to model a mixed-integer linear programming formulation in Python using Gurobi?

I can remember that I spent some time in understanding how to formulate my first model. So I aimed at presenting a complete model here, wishing to save some time for students or researchers needing it....
8
votes
1answer
499 views

Read an LP/MPS file in the PuLP

I was trying to read a MPS file by using the PuLP package in the Python, but I can't find any related documents on it. Does ...
9
votes
1answer
4k views

How do I access the value of a variable in PuLP?

In Python's PuLP package, how can I get the value of a decision variable? For example, if I declare a variable— ...
8
votes
2answers
1k views

Gurobi's “Out of memory” error without exhausting the RAM?

I wrote a branch-and-price algorithm in Python 2.7 which solves several small LP and MIP models by Gurobi 8.1 in each node. The algorithm runs fine at first, it produces both lower bound and upper ...
5
votes
1answer
240 views

Python PuLP - Unable to Model Non-Square Matrix

I am having issues with setting up constraints using both input arrays from excel and variable arrays within PuLP. It appears the model only works with square matrices and my final code has a matrix ...
9
votes
1answer
172 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 ...

1 2
3