Skip to main content

Questions tagged [constraint-programming]

Constraint programming is a particular form of optimization modeling that tends to be well-suited for combinatorial models like scheduling and planning.

Filter by
Sorted by
Tagged with
0 votes
1 answer
97 views

Create a closed tour visiting the numbers. The tour must start and end at the same cell. During the tour, you can only visit the neighboring cell (up,down,left,right). The tour cannot contain a number ...
Oytunxxx's user avatar
0 votes
0 answers
65 views

I'm figuring out how to fill a task schedule with some very specific constraints. I live with 9 flatmates (myself included). To keep our home clean and everyone happy, we have a very specific cleaning ...
TeunCB's user avatar
  • 9
0 votes
0 answers
40 views

Let's first consider a simple, unconstrained example with two nodes {0,1}. Each node has two actions: {stay, transfer}, and all transition probabilities equal 1. Specifically, $P(0|0, stay) = 1,~P(1|0,...
Lalpha's user avatar
  • 3
1 vote
0 answers
40 views

For a continuous linear map $f$, I have the following problem $$ \max_{\mu} \int f(\mathbf{x}) \;\text{d}\mu(\mathbf{x})\\ \text{s.t.} \; c(\mathbf{z}) = \int f(\mathbf{x}) \text{d}\mu(\mathbf{x}|\...
Uzair Akbar's user avatar
0 votes
1 answer
65 views

I am a network engineer who is currently doing some network optimization problem. In my application, there is a requirement for the network delay to be bounded in some interval once some boolean flag ...
Tuong Nguyen Minh's user avatar
0 votes
1 answer
89 views

I'm trying to model a linear job scheduling optimisation problem. There is a single machine and N jobs $J_1, J_2, ..., J_N$. Each job consists of one step with processing time $p_1, p_2, ..., p_N$. ...
Ralph Melish's user avatar
0 votes
0 answers
139 views

I've been trying to develop the most efficient algorithm to solve a Sudoku puzzle. The one that I've developed isn't able to solve certain kinds of puzzles without having to use backtracking. One such ...
Magic Hacker's user avatar
1 vote
0 answers
94 views

I play video games, and it sounded like a fun exercise to try to find the optimal order in which to complete quests: There exist multiple quest trees There are some quests with inter-dependencies ...
Gavin Ray's user avatar
  • 111
2 votes
0 answers
95 views

I am considering a weighted least square problem with data $X \in \mathbb{R}^{n \times p}$, (diagonal) weight matrix $W \in \mathbb{R}^{n \times n}$ and responses $y \in \mathbb{R}^n$, i.e. finding $$\...
Fabi's user avatar
  • 21
0 votes
2 answers
87 views

I have below objective function $S = \lvert 18 - a - b \rvert + \lvert 15 - a - 2b \rvert + \lvert 11.1 - a - 3b \rvert + \lvert 7 - a - 4b \rvert + \lvert 3.4 - a - 5b \rvert + \lvert -1.5 - a - 6b \...
Bogaso's user avatar
  • 196
2 votes
0 answers
38 views

Let a, b, c be three real number constants satisfying $a^2 + b^2 + c^2 \leq 1$. Define the function $f(x, y, z) = \frac{x^2 + y^2}{2(1+z)}$ under the constraints $(x-a)^2 + (y-b)^2 + (z-c)^2 \leq \mu^...
L.Roy's user avatar
  • 21
0 votes
1 answer
69 views

I have an optimisation problem that I thought should be in the form, \begin{align} \mathrm{maximise}_{x\in\mathbb{R}^p} & f(x) + \lambda\|x\|_1 \\ \mathrm{subject~to~~~~~~~} ...
Tommy L's user avatar
  • 339
2 votes
1 answer
72 views

In a simplified version of the ILP problem I am trying to formulate, I have the following: A set of elements $A_{i,j} \in \mathcal{A}$. Each element $A_{i,j} \in \mathcal{A}$ has an associated ...
E-O's user avatar
  • 101
1 vote
0 answers
89 views

I am quite new to the field of optimization and currently having a problem of formulating a constraint with binary variable. For each value of $b$, if there exists one value of k such that $z_1[b, k]$ ...
uv_utna's user avatar
  • 11
3 votes
1 answer
82 views

Let $\mathbf{B}$ be a definite positive square matrix of size $n \times n$, and $\mathbf{b}$ an $n$-sized vector. It can be shown that the solution of $\arg\min_x \left(\mathbf{x}^T \mathbf{B} \mathbf{...
cyril's user avatar
  • 33
0 votes
1 answer
136 views

Place the numbers 1 to 9 into the nine positions in such a way that, the 6 equations are valid. Each position must have a distinct value. Multiplication and division have priority over addition and ...
Oytunxxx's user avatar
0 votes
0 answers
92 views

I am working on a problem where I have a set of 2D vertices and a test point. I want to check whether the test point lies inside the polygon formed by the set of given vertices. I am trying to model ...
Ken Adams's user avatar
1 vote
2 answers
160 views

For this discussion, I will be considering polynomials over multiple complex variables, and a system of polynomial constraints, where the constraints on the variables can be written as a set of ...
PPenguin's user avatar
  • 902
3 votes
1 answer
210 views

I need to write a program that sorts people into groups. To give a little context: The aim of the program is to create an equitable distribution of tasks and people for a school trip. Every day the ...
Meister der Magie's user avatar
1 vote
1 answer
63 views

I have a problem setting similar to bin packing but not exactly. I have to put the few boxes of certain dimensions in a square area besides each other. Like a grid. The boxes should be placed around ...
Ken Adams's user avatar
3 votes
5 answers
400 views

A squared rectangle is a rectangle dissected into squares. squared rectangles are called perfect if the squares in the tiling are all of different sizes and are positive integers. The smallest perfect ...
Stuart Anderson's user avatar
1 vote
0 answers
171 views

I am stuck at a mixture of a combinatorial and maximization problem and don't know how to proceed. Hopefully someone has an idea that can bring me further. Imagine that we have a sequence of $n$ coins....
Ubuntu_fan's user avatar
0 votes
2 answers
59 views

Given an arbitrary vector $\mathbf{y}\in \mathbb{R}^{n}$, I would like to find $\mathbf{x^*} \in \mathbb{R}^n$ which is $$ \text{argmin}_\mathbf{x} \|\mathbf{x}-\mathbf{y} \|_F^2$$ s.t. $$ \mathbf{x}\...
AetbeUT's user avatar
  • 555
5 votes
2 answers
1k views

This is a mathematical and algorithmic question, so I hope it is not flagged for failing to be a pure mathematical question. The puzzle "Two not touch" (or Star Battle) consists of a $10 \...
David G. Stork's user avatar
3 votes
3 answers
269 views

Given the following three equations, assuming all unknowns are integers: $$ x y =\left(x + y - z \right) a \\ x z =\left(x + z - y \right) b \\ y z =\left(y + z - x \right) c $$ And the ...
Mark's user avatar
  • 816
0 votes
2 answers
64 views

There are $n$ seats in a row. $p$ people (where $p<n$) can seat anywhere as long as long as they sit at least one seat apart due to personal relationships. This statement is part of a larger ...
cgo's user avatar
  • 1,970
1 vote
0 answers
124 views

Trying to solve system $(A+\lambda{W})x=b$ (derived from the method of Lagrange multipliers) where $\lambda \in \mathbb{R}$ - the Lagrange multiplier. $A$ - symmetric non-singular matrix. $W$ - ...
Lishen's user avatar
  • 11
0 votes
0 answers
232 views

I have the following optimization problem that I want to solve (note that the $X$ variable consists of a binary matrix subject to a single constraint). First, some definitions: My $X$ variable: $$ X = ...
ИванКарамазов's user avatar
4 votes
1 answer
324 views

I'm trying to print out nets of a cube on a sheet of paper, and I'm hoping to fit as many as I can on single sheets. The squares that make up the net are $\frac{1}{2}$ an inch wide, and I'm printing ...
JavamonkYT's user avatar
1 vote
1 answer
120 views

(Originally posted here https://stackoverflow.com/q/72687231/10291218) Suppose I have an integer array A of size n with two ...
J. Schmidt's user avatar
1 vote
0 answers
42 views

I've got a CSP which is based on constraining bit vector variables. It is explained below through an example, followed by the full definition. So, what I'm concerned about is if you have some idea if ...
Stefania Dokker's user avatar
1 vote
1 answer
78 views

While working on the algorithm, I need to solve the following problem $$ \min_{x \in \mathbb{R}^n} \| x \|_1 + \frac{\alpha}{2}\| x - y \|^2 \\ \mathrm{s.t.} \ \| x - s \|^2 \le r$$ where $y,s \in \...
nokatan's user avatar
  • 11
1 vote
1 answer
196 views

I am having trouble understanding the following question. Question. Take the following non-linear programming problem. \begin{equation*} \min f(x_1,x_2,x_3) = x_1^2-3x_1x_2+x_2^2+x_3^2 \\[.15cm] \text{...
xyz's user avatar
  • 1,289
0 votes
0 answers
103 views

I’m looking for good heuristics for finding at least one (of a probably large set, although possibly none) high dimensional ($|v|>5000$) binary vector that satisfies a set of non-linear/non-...
Ilya's user avatar
  • 176
1 vote
0 answers
57 views

I'm trying to prove $-\ln(1-\|x\|^2_2)$ is self-concordant function. I think 1-dim case is easy to prove, but I cannot prove multi-dim cases. It's really hard to use definition because heavy Hessian. ...
anyone's user avatar
  • 31
1 vote
1 answer
126 views

Suppose we have a set of tasks $T = \{t_1, t_2, \dots, t_n\}$ with durations $\{d(t)| t \in T\}$, that need to be executed on some machine such that their execution times do not overlap. We can ...
AlexNe's user avatar
  • 33
0 votes
1 answer
79 views

I want to find a minimum threshold value for a constraint, such that if this constraint is satisfied, the next one must be satisfied. For example, given two inequations $f_1(X)\geq a$ and $f_2(X) \geq ...
John Z's user avatar
  • 11
1 vote
1 answer
1k views

I am new to mixed-integer programming and I am confused about how to approach this if-then condition. How do I the following constraint in mixed-integer programming: if Dm +t < Dn + then Zmn=1, 0 ...
Romio Rodriguez's user avatar
0 votes
1 answer
79 views

I have the following constrained linear system: $$ Ax = y \\ Cx \ge b $$ where $$ y\in \mathbb{R}^3 \\ x \in \mathbb{R}^n \\ b \in \mathbb{R}^m \\ $$ Also, $n$ and $m$ are typically greater than 3, e....
kalj's user avatar
  • 101
0 votes
1 answer
670 views

The Skyscraper puzzle has the goal of positioning Skyscrapers of $n$ different heights on an $n \times n$-Field so that the following requirements are met: Every field contains a skyscraper. All ...
Vladis Becker's user avatar
0 votes
1 answer
249 views

I have few reference I'm currently reading through but I still don't quite get the difference between optimising a function over a manifold and simply use constrained optimisation. Do the algorithms ...
user8469759's user avatar
  • 5,731
0 votes
1 answer
98 views

I'm trying to solve a problem for $x$ which is a vector of length $n$ with only binary elements, i.e. each $x_{i}$ is either $0$ or $1$. There are two constraints on $x$, one quadratic and one linear: ...
tphillips's user avatar
  • 327
1 vote
1 answer
108 views

Let $x_j$ denote the ratio of assets to allocate to investment option $j$, where $j=1,...,n$ Let $c_j$ denote the annual expected rate of return on investment option $j$ How do we write the following ...
codemachine98's user avatar
2 votes
0 answers
413 views

p.s. I already know few things, but it is interesting to listen to different perspectives. what I know: the augmented Lagrange method combines the penalty method and the method of Lagrange multipliers....
user avatar
0 votes
1 answer
69 views

I am not sure if I am asking on the right place. But given a set of independent variables $X_i$ and the dependent variable $Y_i = f(X_i, b) +c$, how can I estimate the regression equation given a set ...
Aditya Dev's user avatar
  • 5,014
0 votes
0 answers
783 views

Consider the following linear programming (hereafter, problem [1]) $$ \max_{y\in \mathbb{R}^J}c'y\\ \text{s.t. } b_t' y \leq a_t \text{ }\forall t\in \{1,...,T\} $$ where $c$ is a $J\times 1$ vector ...
Star's user avatar
  • 414
0 votes
1 answer
84 views

Problem: You need to pack several items into your shopping bag without squashing anything. The items are to be placed one on top of the other. Each item has a weight and a strength, defined as the ...
Joel_Miller's user avatar
0 votes
1 answer
38 views

I am looking for a analytical function that applies to the constraints: \begin{equation}f(x) = \begin{cases}1 \text{ if } x=1 \\ \alpha \text{ otherwise }\end{cases}, \text{where } 0 \leq \alpha \leq ...
Lenny Eing's user avatar
0 votes
1 answer
263 views

I would like to add a new constraint to a standard Knapsack problem by introducing groups. My variables are $x_c \in \mathbb{Z}^+, c\in \mathbb{C}$. Where $\mathbb{C}$ is the set of all items. Each ...
Esildor's user avatar
  • 17
0 votes
1 answer
45 views

We have four variables: a, which represents numbers from 0-999 b, which represents a1000 (<...
Edenia's user avatar
  • 123