Questions tagged [python]
For questions about solving Operations Research problems using the Python programming language.
420 questions
3
votes
2
answers
554
views
Perfect tiling of an 8×8 chessboard with dominoes without any fault lines using Z3 Solver
I'd like to use Z3 Solver for the problem:
Perfect tiling of an 8×8 chessboard with dominoes without any fault lines.
2
votes
2
answers
207
views
How do I use the Z3 solver to solve the polyomino rectangle-filling problem?
I met this question at Zhihu, a Chinese Q&A site like Quora
How to use Z3 to solve the pentomino puzzle?
...
3
votes
1
answer
158
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
87
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
81
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
358
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
113
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
67
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
184
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
212
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
164
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
104
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
175
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
121
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
196
views
Use Gurobi to create networkx.Graph that has highest max flow
I have a networkx.Graph-object called G.
...