Questions tagged [python]
For questions about solving Operations Research problems using the Python programming language.
418 questions
3
votes
1
answer
143
views
trying to code GMI cuts with Gurobi as LP solver
I'm trying to do some custom cuts. I'm using Gurobi as the LP solver. I have code below for GMICs. (I'm planning some other cut experiments and Gurobi doesn't give me full control over their built-in ...
1
vote
0
answers
83
views
Product distribution between a set of machines
I'm working on a problem, that deals with product distribution between a set of machines in a factory. Here's what I'm given (as input variables):
The amount of products produced daily, e.g. 9600
The ...
0
votes
1
answer
73
views
GAMSPy conditional assignment not working as expected
In the online course "Effortless Modeling in Python with GAMSPy" by Bluebird Optimization, Lesson 17 introduces the anatomy of conditional statements, including the point that the operator <...
2
votes
1
answer
343
views
Solver-agnostic Modeling Language in Java
Some good solver-agnostic modeling packages in Python are Pyomo and PuLP, with Pyomo being a little more versatile than PuLP. What are the equivalent non-commercial and well-supported solver-agnostic ...
2
votes
1
answer
100
views
Docplex CP Model Solution Found but Can't Retrieve Decision Variable Values
I'm using Docplex's Constraint Programming model with two 4-dimensional binary decision variables:
...
0
votes
0
answers
65
views
Docplex: updating convex function via iterative solutions
Anyone with experience using docplex can give me some insight or tips regarding my situation?
I'm trying to build a convex function using matrix-vector notation. But the elements of the matrix and ...
2
votes
1
answer
173
views
Optimized Python package for Tabu Search?
I’ve been searching for a Python package that implements Tabu Search but haven’t found any that seem popular or actively maintained. Most libraries I’ve come across seem like individual efforts, with ...
1
vote
1
answer
200
views
CPLEX Relaxer: How do I interpret the relaxed solution, trying to understand infeasibility
How to get the Relaxed solution of an MILP using Python + docplex stack has been answered in Docplex : How can I get the objective value of the relaxation of an MILP?.
I have a model which have 470K ...
1
vote
0
answers
162
views
Why does Gurobi sometimes violate constraints during the solving process in order to achieve a better solution?
Gurobi result violates the constraint $S=\max\{v_1,v_2\}$ by always choosing $v_1$ to minimize the objective $R$. I suspect this happens because $R$ is minimized when $S$ always equals $v_1$(Conflict ...
1
vote
1
answer
103
views
Does DoCPLEX recycle prior solutions from previous iterations if using the same model object?
For context, I'm currently working on a bi-level network interdiction problem involving the sub-problem being the lazy-constraint TSP problem, with the master problem being the maximization of the ...
0
votes
2
answers
172
views
How can I conditionally activate a constraint based on an event in my optimization model?
I'm designing an optimization model where an event occurs at some time $t_p$ for each $i$. I have a binary variable $z[i, t_p]$ such that when $z[i, t_p] = 1$,
the event has occurred for index $i$ at ...
0
votes
1
answer
115
views
Trying to get simple tests for indicator function builders to work
I've been trying to build a model using Pyomo GDP constructs, however for some reason, it seems that logical operators cannot be mixed with relational expressions yet.
I am trying to implement these ...
0
votes
1
answer
193
views
Use Gurobi to create networkx.Graph that has highest max flow
I have a networkx.Graph-object called G.
...
7
votes
3
answers
11k
views
Why do solvers for "slower" programming languages exist?
Yesterday I came across a post on here, where one answer claims that C++ can be up to 10,000 times faster than Python under specific circumstances. In the light of this runtime superiority, why are ...
1
vote
1
answer
253
views
Optimisation problems with expensive to evaluate objective functions
I’ve got an optimisation problem which is unconstrained least squares optimisation. The residual function (ie the function that gives me the vector of residuals in least squares) is very expensive to ...