# Questions tagged [constraint-programming]

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

161 questions
Filter by
Sorted by
Tagged with
1 vote
127 views

### Job Scheduling with Energy Consumption using Linear Programming

I'm looking for some advice for an optimization problem regarding scheduling jobs in a datacenter. So I have a list of jobs and each job has a required time for finishing and a number of cores it has ...
53 views

577 views

### Doubles Round Robin Sorting Algorithm

Background: I have a group of 6 guys that get together and play pickleball every week. We play 2v2 and 2 players sit each game. We play 2 sets of 6 games each week (12 total games) - in each set, ...
1 vote
184 views

### Does the cvxpy replace the max function by MIP formulation under the hood?

Does the cvxpy replace the max function, which is convex, by MIP formulation under the hood when shows up in the constraints (for example, $\max(x,y)\le z$) or in the objective function? In gurobipy, ...
442 views

### If/then constraint formulation

Let's assume we have event $i=1,2,\cdots,k$, denoted as $\text{event}_i$. We know for a fact that $\text{event}_i$ is smaller then $\text{event}_{i+1}$ i.e., $\text{event}_i \leq \text{event}_{i+1}$. ...
Could you please check where I might be wrong? Task is: If $z=1$, then either $x=1$ or $y=1$ My approach: If $z=1$, then $x+y=1$ $\implies x+y\le1$ $\implies x+y\ge1$ If $z=0$, then $x+y\ge0 - M\cdot(... 5 votes 2 answers 342 views ### Binary variable constraint The task is to ensure that if$x_i = 1$for at least$k$of the possible indices$i$in$\{1,...,n\}$then$y = 1$, where$k$and$n$are parameters,$x$is a binary variable vector with$n$elements, ... 1 vote 1 answer 137 views ### Simple Constraint Programming Problem: docplex works but equivalent ortools model is infeasible I have a simple constraint programming model which can be solved using the docplex library, however I am struggling to implement the same model using ... 2 votes 1 answer 95 views ### Modeling advice: scheduling problem with judged events and "blocks" of judging assignments I am considering a scheduling problem in which the events are officiated, likely as a MILP problem. I'm getting hung up on how best to model a particular requirement of how the judged events are ... 3 votes 2 answers 239 views ### Simple Integer Optimization Problem: docplex CP model works but equivalent PuLP+CBC model is infeasible? I have an integer optimization problem with one constraint per decision variable and no objective function. It can be coded and solved using docplex, however I am ... 2 votes 1 answer 99 views ### Modify the network model to accommodate multiple vehicles Given a directed network (or graph)$G = (V,E)$with each edge$e_{ij}$having a non-negative cost as the travel time from$i$to$j$. Each node has an associated demand$d_i$. If the demand is ... 1 vote 1 answer 173 views ### Assignment problem with constrained number of unique tasks I have an interesting assignment problem in which I have a cost matrix for workers and tasks, and need to assign each worker to exactly one task to minimize the cost. However, this is all subject to ... 5 votes 3 answers 461 views ### Maximize the minimal distance between true variables in a list I'm using the OR-Tools CP-SAT solver on a list of$n$boolean variables$x_i$. I'm trying to maximize the minimal distance between two true variables in this list, as illustrated by the following ... 2 votes 0 answers 64 views ### Multi-objective optimization with known variable dependencies (via a graph) -- what is this called? Suppose that I am trying to solve a standard multi-objective optimization problem:$$\min_{ \begin{array}{c} \textbf{x} \in S \end{array} } \left [ f_1(\textbf{x}),f_2(\... 3 votes 1 answer 271 views ### Unexpected runtime error I have a model that contains the sets (both ordered and Days also circular): Days and Personnel, and I'm trying to make a restriction run exaclty once per Day for every member of Personnel. I'm using ... 11 votes 4 answers 2k views ### Is there an open-source equivalent to LocalSolver? I have a constraint programming problem that is easy to formulate and solve (with high solution quality) in LocalSolver. However, I would really prefer to use something open source for ... 1 vote 1 answer 90 views ### Traversing a list data dynamically in Pyomo Abstract Model In my PYOMO abstract model, I am reading my data file and storing some specific attributes in a list say demand=[]. I am reading the data file as follows: ... 4 votes 1 answer 247 views ### Creating constraints dynamically in pyomo abstract model I have a networkX graph with few nodes and these nodes have attributes such as "demand". ... 2 votes 1 answer 197 views ### RAM overflow when scheduling 1000+ intervals Due to the answers to this and this questions, I was able to find the optimal solution for scheduling problem. However, if there are many tasks that must be scheduled, e.g. 1000+, then the solver ... 2 votes 1 answer 357 views ### CP-SAT solver doesn't use all space available for scheduling This problem is a continuation of this problem. The issue here is the solver doesn't use the whole space available for the scheduling and thus some jobs are not being scheduled. For example: we need ... 2 votes 0 answers 65 views ### Assignment/scheduling how to formulate considering job time and job cost I have the following problem that I do not know how to formulate. There are a fixed number of workers$w_i \in W$for$i \in [1…N]$. Also, there are a fixed number of jobs that must be assigned to ... 3 votes 2 answers 64 views ### Constrained shift assignment problem using ilogcp solver can´t find an optimal solution I´ve been trying to solve a contrained assignation problem given a set of constraints based in a real-world problem. I modeled the problem in AMPL as follows: ... 3 votes 1 answer 265 views ### Force gaps between tasks, tasks are scheduled within their job's time windows in Jobshop problem The problem I'm trying to solve is a modification of the original Jobshop problem. The additional constraints are: There is only one machine for all jobs and their tasks. Each job has a priority (... 7 votes 2 answers 868 views ### Is there a better way of defining a constraint on positive integer variables such that no two variables are the same and are uniquely assigned a value So suppose I have integer variables$x_1,x_2,\dots,x_N$and I enforce that the integer variables are bounded i.e$1 \leq x_i \leq N$I was interested in posing a constraint so that in the collection$...
I do have a MILP problem. The decision variables are Integer ones. Let's call them $x_i$ and i $\in \{0,1,2,3,...,N \}$ I do want to find all distinct solutiuons for this problem. The problem is ...