547 questions
Advice
0
votes
0
replies
23
views
Precedence implementation - compressed sparse row (CSR)
I'm doing a model for scheduling personnel through VRP formulation and I would like to know how can I integrate precedence binary matrix, using the CSR to accelerate the data processing.
My precedence ...
0
votes
1
answer
132
views
Why doesn't scipy.optimize.milp respect the time_limit parameter?
I'm running an optimization problem using scipy MILP function. I get to the point where the solving report pops up, either through time limit or solution (see below). When the solving report pops up, ...
0
votes
0
answers
48
views
MIP Relaxation through pyomo
I have a step in my algorithm where I have to perform a standard Mixe Integer Program relaxation, it goes as follows:
Solve the MIP
Relax the binaries of MIP to NonNegativeReals
Fix the variables to ...
0
votes
1
answer
126
views
Setting up a mixed-integer program in python
I am trying to figure out if it is possible to configure a specific problem as a mixed-integer program. I think I am able to structure it as a continuous non-linear optimization problem, but would ...
3
votes
1
answer
83
views
Can I use an objective function that uses multiple functions in binary programming in gekko?
I am trying to minimize the L2 norm of the peak flows in a drainage system. I want to use gekko since it can handle integer-binary programming.
In my program, my objective is to minimize the peak ...
0
votes
1
answer
42
views
Python PuLP sorting 2D results
I have a Mixed Integer Programming problem very similar set up as introduced in this link.
https://colab.research.google.com/github/ffraile/operations-research-notebooks/blob/main/docs/source/MIP/...
3
votes
0
answers
57
views
How to use the cold-start options with GEKKO correctly?
I was testing some options with Gekko for an optimization with MINLP , but I still couldn't figure out how the option COLDSTART = 2 work. Using the variable values from a prior solution as initial ...
-1
votes
3
answers
427
views
Python ortools CP-SAT solution for group optimization - code too clunky?
I have a group of people that I need to split up into subgroups. The subgroups do not all have to be the same size, but can be no smaller than 5 and no larger than 10. I have created a matrix (in ...
1
vote
1
answer
142
views
Optimize load balancing using a constraint solver
I'm trying to solve a load balancing problem with a constraint solver. I have a list of partitions, each one is associated with a load, and I want to assign these partitions to a fixed number of ...
1
vote
2
answers
88
views
Is there any benefit of choosing to formulate constraints in a way or another in GEKKO?
I have an MINLP problem and let's say the continuous variable Q can only be 0 when the binary variable z is 0. Two ways to formulate this would be:
m.Equation(Q*(1-z) == 0) (1)
or
m.Equation(Q < z*...
0
votes
0
answers
36
views
How to define special sets to workaround network flow?
I am working on a special network flow problem, trying to implement in GAMS, something like a (N∗N) grid, and I am having difficulties to define some of its sets. The problem is stated as follows:
...
0
votes
0
answers
161
views
How to linearize the product of two continuous variables?
I'm trying to solve a MILP problem in Matlab Optimization Toolbox. I'm encountering with problems with the product of two decision variable of my problem which are bounded.
0<= x <= 60
0 <= ...
5
votes
2
answers
268
views
Generate all paths that consists of specified number of visits of nodes / edges
In a graph/chain there are 3 different states: ST, GRC_i and GRC_j.
The following edges between the states exists:
EDGES = [
# source, target, name
('ST', 'GRC_i', 'TDL_i'),
('ST', '...
0
votes
1
answer
199
views
VRP in CP-SAT (or tools) using all available vehicles, when a smaller number could have sufficed
I am solving a simple capacitated VRP with CP-SAT solver with 6 vehicles and 17 nodes. The issue that is happening is that the solution ends up using all 6 vehicles, when clearly a smaller number of ...
0
votes
0
answers
54
views
Struggling to Configure Solvers for MINLP Optimization with Pyomo (using NEOS or Local Installation)
I'm working on a Mixed-Integer Nonlinear Programming (MINLP) optimization problem using Pyomo in Python, but I'm having trouble installing and configuring solvers.
I've tried both installing solvers ...
3
votes
1
answer
65
views
Gekko using APOPT isn't optimizing a single linear equation represented as a PWL
I've run into an issue where I can't get APOPT to optimize an unconstrained single piecewise linear, and it's really throwing me for a loop. I feel like there's something I'm not understanding about ...
0
votes
1
answer
351
views
Issue with CFFI while installing Python-MIP package
I'm trying to install mip (Python-MIP package for mathematical optimization). But, I'm facing a issue with cffi package. Bellow, the result of command pip install mip :
pip install mip
Collecting mip
...
2
votes
1
answer
78
views
GEKKO mixed integer optimization callback function with APOPT solver
I am trying to solve a simple mixed-integer optimization problem using GEKKO to evaluate whether it is suitable for my actual optimization task. Since my future problems will depend on adhering to ...
1
vote
2
answers
437
views
Use more than 1 core when solving with mathopt (or tools) - HiGHS solver
I am interested in leveraging more number of physical cores when solving a MIP problem with mathopt.
Parallelization was easy with CP-SAT by setting the number of search workers
solver.parameters....
-1
votes
1
answer
117
views
Efficiently Adding a Large Number of Constraints in Gurobi for MILP Problem
I am working on a large-scale Mixed Integer Linear Programming (MILP) problem using Gurobi. The decision variable vector x is binary and has a dimension of approximately n = 40,000,000. The objective ...
2
votes
1
answer
65
views
Gekko : Error in Resource Optimisation problem
I am working on a optimisation problem and I am using Gekko to solve it. Consider the scenario where there are 2 machines and 5 users and each machines has 2 resources to distribute to users. The user ...
0
votes
0
answers
48
views
Mosek Optimization log - BEST_INT_OBJ definition
When reading a Mosek MIP optimization log, e.g.
Presolved problem: 1176 variables, 1344 constraints, 4968 non-zeros
Presolved problem: 328 general integer, 392 binary, 456 continuous
Clique table size:...
3
votes
0
answers
102
views
Finding the optimum value of all Decision Variables in a MixedVariable problem with Pymoo
I've successfully built my model and it runs and plots a Pareto front. However, I don't know how to store X* (the optimum value of ALL the decision variables that resulted in the optimum F).
My model ...
2
votes
1
answer
328
views
How to pickel (save model object) a Google or-tool's mathopt model object
I am building a model using mathopt library of or tools, and I want to save the model object as a pickle file (or any other suitable alternative). The use case for doing this is - underlying data ...
-1
votes
1
answer
93
views
Enforcing Order in a Linear Programming Question
I have an optimization model to fulfill the water requirements of a city's distribution network. The model includes water sources from rainfall collection, river extraction, reservoir storage, and ...
1
vote
1
answer
234
views
implement no overlapping constraint between 2 tasks in MIP
I have 2 sets of tasks each with start and end times, I want to enforce a constraint that ensures that 2 tasks do not overlap with each other. I know that in constraint programming we have specialised ...
0
votes
2
answers
224
views
minimum of decision variables not including zero. OR-Tools CP-SAT solver
I have a problem where I need to take the minimum of decision variables, but want to exclude variables which take a value of zero. For e.g. if variable values are : 0,0,2,5,7 then I want the minimum ...
0
votes
1
answer
74
views
My CPLEX Decision Variables shows "No Value"
Good day, I’m currently using the CPLEX Studio IDE v.22.1.0 for my university project and it’s my first time. I am working on “Reducing Overcrowding in an Emergency Department” by optimizing five (5) ...
0
votes
0
answers
96
views
network optimisation supply planning is not generating weekly plan
I am working on Production planning optimization where I have three stages of planning
Production plan
Packaging plan
Dispatch plan
for each stage I have its capacity and lead time it takes for each ...
1
vote
1
answer
69
views
How to ensure that a value is a member of a set of decision variables in ortools
I want to implement constraints which ensures that a value is part of a set of decision variables. So for e.g. let dv[i] be a set of decision variables indexed by i. Say, the domain is restricted ...
1
vote
2
answers
390
views
how to implement alldifferent constraint except 0 in ortools
I am using ortools, CP-SAT solver, and I am struggling to write a constraint that will allow for a solution which can have multiple zero's but the remaining decision variable values have to be unique. ...
1
vote
1
answer
420
views
Support for HiGHS solver in MathOpt [Google OR-Tools], python API
When will the support for HiGHS solver be implemented in MathOpt (ortools) ? I am using MathOpt using python API. I am using ortools==9.9.3963.
So for the below sample code, I get the following error :...
3
votes
2
answers
1k
views
OR-Tools CP-SAT python example terminates after creating solver
I am new to Google OR-Tools and trying to start by running a basic example from OR-Tools example library found here
https://github.com/google/or-tools/blob/stable/ortools/sat/samples/cp_sat_example.py....
1
vote
1
answer
294
views
How to add indicator and SOS constraints in mathopt [Google OR-Tools]
I am struggling to add indicator and SOS constraints using mathopt library in or-tools. In the web-page it is mentioned that mathopt supports these specialised constraints, but I am not able to use ...
0
votes
1
answer
55
views
why it always results zero regardless of an example for optimal value
I have coded the multy commodity flow problem using MIP and CPLEX solver but for any example I provide it leads to 0 as optimal value. I believe the problem lies within either in objective function or ...
0
votes
1
answer
37
views
How to represent a priority constraint in CPLEX Studio using OPL?
I am working on an optimization problem about the WFP where i basically have a set of countries where each contry belongs to a specific region. And each country is also represented by an Emergency ...
2
votes
1
answer
229
views
Taking too long from 0.08% Gap to 0% while solving a MIP in Python with Gurobi package
I am solving a MIP problem in Python. The solving process with branch and bound proceeds very fast at the beginning, but when the optimality gap reaches 0.08% the opposite happens. I mean, from 0.08% ...
2
votes
1
answer
165
views
How can I use a function in the objective function in a MILP optimization problem?
Thanks for the great package! It's been quite nice and handy.
recently, I'm trying to solve a MILP problem, with the two state variavles are integers within lower and upper boundaries, and the ...
0
votes
0
answers
120
views
Pyomo Mixed Integer Programming : how to turn a binary variable equal to 1 if values of a variable exceed a certain threshold for the first time?
I want a binary variable, $inv_year$, to indicate the investment year, i.e., the year where the investment variable, $I$, turns greater than zero for the first time. Both variables ($inv_year$ and $I$)...
2
votes
0
answers
113
views
Constraint Transformation in SCIP
I am using pyscipopt 4.3.0 (python 3.11.5; SCIP 9.0.0) to solve the following binary linear problem:
import pyscipopt as scip
_Name = "tiny_test"
m = scip.Model(_Name)
y1 = m.addVar(name=&...
0
votes
1
answer
65
views
gurobi constraint to prevent repeated solution
i want to create multiple optimal solutions from my gurobi optimization MIP model but not using the PoolMode. instead, i have a model that creates the optimal NBA DFS lineup. one of my constraints ...
1
vote
1
answer
78
views
How to interpret shadow price array shape in Gekko
I'm trying to calculate the shadow prices for the various constraints and place them in a dictionary following the form c[i]:sp[i] where c is the name of a specific constraint and sp is the numeric ...
2
votes
1
answer
78
views
Simultaneous Spacing and Duration Constraints with time gaps in Gekko
I'm trying to simultaneously enforce sequential duration and spacing constraints to vector solution output in Gekko. Normally, this would be fairly straightforward using window logic, but my time ...
0
votes
0
answers
92
views
About MATLAB intlinprog
I have a problem with MATLAB intlinprog. I have a problem about assigning worker types to jobs. Each job must assigned to one type of worker. The same type of worker can be assigned to different jobs. ...
3
votes
1
answer
81
views
Time-based spacing constraints in Gekko
I'm trying to constrain the vector output of "simu_total_volume" below by requiring that solution output elements (x7=1) be spaced apart by s records (weeks) while also controlling for the ...
2
votes
1
answer
120
views
Dealing with Non-Optimal Solutions from Gekko
I'm running into some situations where it seems like Gekko is getting stuck in local maximums and was wondering what approaches could be used to get around this or dig deeper into the cause (including ...
2
votes
1
answer
51
views
How to use layered conditional constraints in Gekko
I'm trying to implement conditional logic in Gekko using "if3" but am unsure how to successfully layer 2 conditions at different levels of granularity.
"x1" is vector of binary ...
2
votes
1
answer
54
views
How to enforce specific elements in a vector to be in an optimization solution in Gekko
I'm trying to generate an optimal combination of p records in a vector of length n while simultaneously ensuring (constraining) that specific elements in the vector are included in the solution set p (...
2
votes
1
answer
71
views
How to handle optimizing across vectors in Gekko
I'm trying to use Gekko to optimize across time (a vector) to generate schedules based on several constraints, namely price and the number of times an event can occur (say we limit it to 5 per x7 ...
0
votes
0
answers
135
views
Solving Bilevel Optimization with Nonlinear Subproblem
I am trying to implement a bilevel optimization program using Python-based package for Adversarial Optimization (PAO), which is based on Pyomo. Here I have a mixed-integer master problem and two ...