Questions tagged [constraint-programming]

For questions on modeling satisfaction or optimization problems in languages designed for expressing (often high-level) constraints on decision variables.

Filter by
Sorted by
Tagged with
2
votes
1answer
66 views

constraint programming and scheduling issues

I have a constraint problem that i need to resolve, but i did not how know to model the problem: I have 11 employees, i will name them from a to k {a,b,c,d,e,f,g,h,i,j,k}. I have a small company that ...
2
votes
1answer
125 views

How to know which constraint in CP-SAT did not meet the feasibility gap

Is there any systematic way to retrieve some information on the constraint that caused infeasibility in Or.Tools CP-SAT? ...
2
votes
1answer
86 views

How to model a set of integer variables getting assigned different values than another set of integer variables

Assume we have variables $x_1, x_2, x_3, x_4$ that each can belong to $\{1,2,...,10\}$. How can we model a constraint that variables $x_1, x_2$ get assigned different values than $x_3, x_4$? Because ...
2
votes
3answers
255 views

How to model two variables to NOT to belong to the same set partition using Constraint Programming

Assume we have two variables $x,y \in S$ where $S=\{1,2, \dots, 1000\}$. Also, we are given a partition of set $S$ as: $S_1 = \{1,2, \dots, 249\}$ $,S_2 = \{250, \dots, 499\}$ $,S_3 = \{500, \dots, ...
-2
votes
1answer
87 views

Any references to the ROADEF 2020 Challenge?

The problem description of the challenge is given here. Does anyone has some references to similar problem. I would like to participate but I don't know where to start.
7
votes
1answer
394 views

Adding a constraint in constraint programming

Is it true that the more we add constraint to a constraint programming solver the more efficient it will be? How does this compare to adding constraints in integer programming solvers.
3
votes
2answers
652 views

What are the solvers that give a feasible solution within a given time?

What are the solvers that take the maximal computation time as a parameter and gives the best found feasible solution within this time.
2
votes
1answer
78 views

Looking for a similar optimization problem

I want to know if there is any already defined problem that could give me a hint on how should I approach the following task. There are N tasks that should be accomplished, each task requires ...
1
vote
3answers
200 views

How can I linearize this IF-THEN constraint?

Let $P_{t,u}; t=1,2,\ldots,T, u=1,2,\ldots,U$ be known values $\alpha$ is also a known parameter $X_{t,u}$ an optimization variable I have the following constraint: IF $P_{t,u}\geq\alpha$, THEN $X_{...
3
votes
1answer
73 views

Integer decision variables as index

The following problem has only two integer variables; however, they appear in the index of the parameters. Appreciate it if anyone has any efficient idea to transform it into a canonical integer ...
8
votes
3answers
203 views

Constraint programming resources

I am looking for resources to learn constraint programming. I will divide the resources I am looking for in three types: Modeling Is there resources (books, articles, courses, etc.) that are ...
4
votes
1answer
126 views

Mixed integer programming vs Constraint programming

I see that certain studies are comparing MIP and constraint programming (CP) performances. And generally, they claim that CP outperforms MIP. But I believe that it is not completely true. Because ...
2
votes
0answers
67 views

Finding Optimal Route using different Paths

I have a list of paths e.g. path 1 takes you from point A to B. A person needs to complete 5 of such paths. $$Route1 = path1 + ...
2
votes
0answers
132 views

Operation hours optimization for circular schedule

Here is my problem. A store has X = 15 electical devices with the ability to work non-stop, fully charged, up to 8 hours. Their battery charge lasts 2 hours and the operating hours of the store differ ...
3
votes
2answers
122 views

Limit number of switches in employee scheduling problem

Here is a scheduling problem I need to solve. Given the demand for 2 positions in 1 week with 3 shifts per position, I need to allocate the employees accordingly with some extra operational ...
2
votes
0answers
41 views

Algorithm for Trainyard Marshall optimization problem

The problem I am trying to solve is the 2014 RAS problem. The link is the following The problem Trains come to the humpyard where each compartment of a train gets humped or disassembled and then each ...
5
votes
3answers
179 views

How can I optimize this integer programming constraint problem without running out of memory?

I am trying to run this constraint problem but the memory runs out, $$S_{i}$$ are 1975 Students that need to be assigned to one of 188 teacher assistants classes, each teacher assistant has to chose a ...
1
vote
0answers
75 views

Question on quadratically constrained quadratic program

If the constrained optimization problem is a quadratically constrained quadratic program of the form \begin{align}\min&\quad x^HQx-a(x+x^H)+b|z^Hx|^2\\\text{s.t.}&\quad\|x\|^2\le1\end{align} ...
1
vote
0answers
53 views

Fixed cost associated to SlackVar(waiting time cost) [CVRPTW]

I'm modeling a CVRPTW with some features: Each type of vehicle has a cost per km and a fixed cost per trip. To calculate these costs, I am using these methods for this: ...
7
votes
1answer
1k views

How to use the least number of colours to colour different routes of a bus route such that no two intersecting routes will have the same colour

I would like to know of a method in which if provided say 10 routes with details regarding which route intersects with which another route, we can use the least number of colours to colour the routes, ...
1
vote
1answer
53 views

Derived variables of when a decision variable appears?

I am dealing with a multi-travelling passenger problem. $x_{i,j}$ is a binary variable that allocate a passenger $i$ to a vehicle $j$, every vehicle can carry only $n_{pv}$ passenger where $i \in \{1,...
3
votes
2answers
113 views

Could DOcplex.CP recognize that it solves the graph coloring minimization problem?

I created a graph coloring DOcplex.CP model inspired by this example. However, I do not know the number of colors in advance. The goal is to minimize the number of colors (i.e., get as close as ...
4
votes
1answer
84 views

How to convert non-normal probabilistic constraints to deterministic ones for mathematical modelling?

I am working on a chance-constrained optimisation model that takes into account uncertainty. I am aware of how to convert constraints that are of a probabilistic nature into the equivalent ...
3
votes
1answer
111 views
8
votes
2answers
116 views

Which MiniZinc-compatible solvers are best suited for floating decision variables and non-linear constraints?

We are working on a production scheduling problem that has both discrete ("how much to produce from good x and where") and continuous elements ("keep the workload of a production site below 0.7"), ...
6
votes
2answers
93 views

Are there some benchmark problems for CSP Solvers?

I am building my own CSP solver with simple backtracking, AC3 filtering and variable/value ordering heuristics. It supports non binary constraints. I've done some good progress and I'd like to ...
6
votes
1answer
262 views

CP-SAT ortools - Is there any complete list of possible/available StringParameters for the CpSolver?

I wonder if there is any list of string parameters documented. So far, I only know max_time_in_seconds and num_search_workers. ...
4
votes
1answer
97 views

Constraint programming in OPL: intervals covering time slots

I am trying to model the following: There is a shop open from xx AM to yy PM. In each 30 min time slot, there have to be demand[timeSlot] = x employees present. E.g. the shop is open from 08am to ...
5
votes
2answers
303 views

How to measure model quality in OR-Tools?

After creating my model for a problem, what steps should I take to test if a change in the model is actually helpful or not? In Python, ...
4
votes
1answer
120 views

How exactly does OptionalIntervalVar work in OR-Tools?

I created OptionalIntervals for a number of tasks: ...
5
votes
1answer
304 views

assigning values to IntVar if and only if BoolVar, else zero [or-tools]

If I have an IntVar s[j] stored in a vector s, is it possible to iterate for (a period of ...
6
votes
0answers
102 views

OptionalIntervalVar enforced but not working OR-TOOLS

I'm using OptionalIntervalVar and then maximizing the starts. The optimal solution is not affecting the other variables that creates the ...
6
votes
0answers
111 views

Modelling issue with precedence constraint in OR-Tools

I'm trying to solve an RCPSPDc model It is infeasible, although Ilog Cplex solves it, so I think I have a modelling issue. I have more constraints but the precedence is the one that makes it ...
3
votes
1answer
94 views

ValidateModel or tools in c++ and proto problems

I'm trying to validate my model, this is the relevant part of my code: ...
5
votes
0answers
70 views

Modelling issue with rcpsp and boolean expressions

I'm trying to solve an RCPSPDc problem in OR-Tools with CP-SAT solver. In my RCPSPDc model (with discount rate) i want to set this objective: $$\max_{s}\sum_{j\in J}\text{profit}_{j}\cdot \frac{1}{(1+...
5
votes
1answer
343 views

Cumulative Constraint OR-Tools

I'm trying to solve an rcpsp model. I can't find documentation for the AddCumulative function of OR-Tools. How should this function be used? I want to write this ...
8
votes
1answer
151 views

Precedence Constraint in OR-Tools

I'm trying to write this constraint in C++ and add it to my model (addLessOrEqual): $$\text{start}_{i}+\text{duration}_{i}\le\text{start}_{j}$$ for an $(i,j)$ arc ...
3
votes
0answers
92 views

Power of variable or tools

I'm working with OR Tools in Python and I need to define the objective function an expression of the variables. In particular, the objective function is $$\frac{c_j}{1.7^{s_j}}$$ with $c_j$ ...
9
votes
1answer
316 views

Floating points in ORtools

I'm trying to solve an RCPSPDc model (maximizing the net present value instead of a makespan). The objective function is: $\sum\limits_{j \in \text{Tasks}} e^{-\theta\cdot s_{j}}\cdot p_{j}$, where $...
7
votes
0answers
60 views

Which Constraint solver is extensible to CSP algorithms?

I am novice to constraint programming and I need to implement the following algorithms. Backtacking Conflict-based backjumping AC partial lookahead MAC Forward checking Forward checking + dom ...
10
votes
1answer
148 views

RCPSP minizinc model

I'm working on a resource‐constrained project scheduling problem (RCPSP) in Minizinc but I have problems with the running times when the dataset is big (like 400 jobs, 2 resources, 1,000 precedences, ...
9
votes
3answers
431 views

Interval variables in MIP

In Constraint Programming it is possible to use interval variables to represent intervals of time during which something happens (see here), usable in scheduling problems, for example. Is there ...
7
votes
3answers
470 views

Constraint programming using solver: how to state the time limit of search?

Could someone give additional explanations about the TimeLimit of CPLEX for CPO? I am using CPLEX to solve a problem of assignment and scheduling in which each task needs to be assigned to a worker, ...
6
votes
1answer
408 views

Constraint Programming OR-Tools finding Matrix Combinations

As a similar post of mine Find all Combinations of a Matrix I am trying to find matrix combinations with entries $>0$ meaning for a matrix \begin{bmatrix} 0 & 1 & 3 \\ 5 & 2 & 1 \\ ...
5
votes
1answer
122 views

Precedence constraints using binary variables - DOCPLEX

I would like to establish a precedence constraint to ensure the precedence relation of tasks. I have a set of tasks available, but required tasks are not always the same. It means, the tasks executed ...
10
votes
1answer
386 views

TSP problem: traveller does not visit all nodes - Google OR-tools

Context: I am dealing with a kind of scheduling problem, in which I have a set of tasks and machines. All tasks must be assigned to machines (not necessary all of them). In addition to that, I must ...
8
votes
1answer
173 views

Minizinc: How to use a predicate in an assert statement?

Trying to use minizinc builtins to do some basic validation of data inputs but I get a type error ...
5
votes
0answers
36 views

How to handle constraints in docplex to states the relation between two variables?

I am using docplex.cp and I need to state the following constraint: $$\sum_{c}(X_p{_w}_{cj}+X_{p+1}{_{w'}}_{cj+1})\leqslant T_w{_{w'}}_{,jj+1} + 1$$ Knowing that the binary variables are: $X_p{_w}...
7
votes
2answers
175 views

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 ...
6
votes
0answers
195 views

How to make constraints satisfy disciplined convex programming guidelines?

How do I turn my convex constraints (described below) into constraints that are DCP so that I can solve them in CVXPy? Is there some ``cheat sheet'' of standard tricks? I'm trying to implement the ...