Most Popular

1500 questions
7
votes
2 answers

Linear constraint formulation (OR-statement)

I have the decision variable $X_{iz}$ And I have two parameters $T_i\in\{0,1\}$ and $IT_z\in\{0,1,2\}$. I can only assign $i$ to $z$ if the following holds: for $T_i=0$, $IT_z$ needs to be $0$ or $2$ for $T_i=1$, $IT_z$ needs to be $1$ or $2$ So…
7
votes
0 answers

Relationship between two minimization problems

Let $\mathbf{A}$ be a ${n\times J}$ matrix with $A_{ij}\geq0$ (and $A_{ij}>0$ for most $ij$, there cannot be any rows or columns that consist only of $0$s), $Q=\left\{\mathbf{q}\mid \mathbf{q}\in\Bbb R^n_+\land\sum\limits_{i=1}^n q_i=1\right\}$ and…
Patricio
  • 591
  • 3
  • 9
7
votes
1 answer

How to convert 3D bin packing problem to 2D bin packing approximation?

I'm trying to approximately solve a 3D container loading problem. Is it possible to use 2D bin packing algorithms? If so, how do we make the transformation? What are the conditions needed to make the transformation?
Surya
  • 73
  • 4
7
votes
2 answers

Solving a VRP (google hashcode competition) using an off-the-shelf solver

Problem summary : A complete problem description is given here Given a description of city streets and a number of Street View cars (cars that captures pictures as they move around) available for a period of time, your task is to schedule the…
Joffrey L.
  • 963
  • 6
  • 14
7
votes
1 answer

Help with formulating an implication

I have a binary variable $y$ and a set of binary variables $x_i$, where $i\in I$. My problem requires that $$\sum\limits_{i\in I}x_i = b.$$ What I want to formulate is the following implication: if $\sum\limits_{i\in \tilde{I}} x_i \leq b-1$ then…
Djames
  • 1,143
  • 6
  • 13
7
votes
2 answers

Why does a Max constraint work, but this non-negativity constraint does not?

Suppose I have the following constraint: \begin{align}x_{t} &= x_{t-1} + y_{t-1} - z_{t-1}\\x_{t} &\ge 0\end{align} From my limited experience in coding my own problem, I have found that my model becomes infeasible if I impose the non-negativity…
GrayLiterature
  • 2,309
  • 7
  • 27
7
votes
1 answer

When using docplex.cp is it possible to get all feasible solutions?

I would like to solve an ILP and get all feasible solutions (even the worst one). How could I do that using docplex.cp? I've seen a similar question in: Using CPLEX "solution pool" to count feasible points However, if I am not wrong, the answers…
campioni
  • 1,133
  • 5
  • 13
7
votes
4 answers

Matrix in ampl: constraint that the values ​are all different

I'm solving the magic square problem for my operational research exam. The constraints of my model are that the sum of the elements on the lines must be equal to a constant (var constant), that the sum of the elements on the columns must be equal…
Matteo
  • 223
  • 1
  • 6
7
votes
2 answers

CPLEX CP Optimizer Java API function missing

I can not seem to find the needed functions to model the following problem through the Java API (CP Optimizer): a machine that has downtime and sequence-dependent setup times, with the extra constraint, that the physical preparation (setup) of a job…
Maarten
  • 295
  • 1
  • 9
7
votes
1 answer

Maximize charging, minimize cost

The task pertains to choosing an algorithm based on the data, requirements and constraints. I have a number of electrical devices ($d_1,d_2,\dots,d_n$) with batteries. Throughout the day I will receive these devices with arbitrary battery storage…
user2974951
  • 301
  • 2
  • 5
7
votes
1 answer

Logical Constraints Modelling using Big-M formulation

I am trying to model some logical constraints in ILOG. Logical constraints could be given such as: Constraint 1 or Constraint 2, Constraint 3 or Constraint 4, Constraint 5 or Constraint 6. The six constraints in question are listed below.…
memop
  • 71
  • 2
7
votes
1 answer

DOCPLEX: tips to manipulate data input (binary parameter)

I am coding a MIP problem in docplex and I would like to ask for some tips. I would like to input a binary parameter that states a compatibility relation: I have a set of characteristics $H$ to be satisfied in a product. The product is made by a set…
campioni
  • 1,133
  • 5
  • 13
7
votes
0 answers

Having trouble with objective function in Python: "GurobiError: Variable not in model". What else could I try?

I am trying to figure out how I can write this objective function into python using Gurobi. I have to minimize the sum of the product of three dictionary's values. The reason I am confused is that while the first two dictionaries I am multiplying…
Jacob Myer
  • 447
  • 3
  • 8
7
votes
1 answer

Count this to the family of Job Shop Problem?

I will explain the problem in a simplified version. Three Tasks: $T_1, T_2, T_3$ Four Machines: $M_1, M_2, M_3, M_4$ The machines $M_2$ and $M_3$ make the same processing, so they are parallel. Tasks $T_1$ and $T_3$ must go through the machines in…
Tobias M.
  • 343
  • 1
  • 5
7
votes
1 answer

Shipments consolidation - how to model mutually exclusive items with OR-Tools CP Solver in Python (multi-knapsack, updated)

I am implementing a solution for packages consolidation (basing on Nurse Problem solution) with OR-Tools CP Solver. There is a factory that manufactures some small Packages that need to be transported by post to the customers. It would be optimal to…
Tomasz Kot
  • 73
  • 3