Questions tagged [integer-programming]

Questions on optimization constrained to integer variables.

An integer programming problem is a mathematical optimization or feasibility program in which some or all of the variables are restricted to be integers.

Integer problems may be defined as the problem of maximizing or minimizing a linear function subject to both linear and integer constraints. The constraints may be equalities or inequalities.

Integer programs are problems that can be expressed in canonical form as

$$\max\quad c^\top x$$ $$\text{s.t.}\quad Ax\le b$$ $$x\ge0$$ $$x\in\Bbb Z^n$$

where $x$ represents the vector of variables (to be determined), $c$ and $b$ are vectors of (known) coefficients, $A$ is a (known) matrix of coefficients, $(⋅)^⊤$ is the matrix transpose, and $\Bbb Z^n$ is the set of whole numbers of dimension $n$.

The expression to be maximized or minimized is called the objective function ($c^⊤x$ in this case).

The inequalities $Ax \le b$ and $x \ge 0$ are the constraints which specify a convex polytope over which the objective function is to be optimized. The inequality $x \ge 0$ is called non-negativity constraints and are often found in linear programming problems. The $x\in\Bbb Z^n$ constraint limits the to be determined vector variables $x$ to be whole integers. The other inequality $Ax \le b$ is called the main constraints.

Integer programming is NP-hard. A special case, $0-1$ integer linear programming, in which unknowns are binary, and only the restrictions must be satisfied, is one of Karp's $21$ NP-complete problems.

Reference:

1094 questions
0
votes
1 answer

Number of solutions of linear equation in $n$ unknowns with box constraints

Given the following linear equation in $x_1, x_2, \dots, x_n \in \mathbb positive\ integers\ including\ 0 $ $$C_1 x_1 + C_2 x_2 + C_3 x_3 + \dots + C_n x_n = 0$$ where $C_1, C_2, \dots, C_n \in \mathbb Z$ $$L \leq x_1,x_2,\dots,x_n \leq R$$ L and…
0
votes
1 answer

Flagging a variable value

I am trying to create a set of constraints that forces a binary variable $y$ to be set to a certain value when a variable $x$ is greater than or equal to zero. I have, $-1 \leq x \leq 1, \qquad x \in {\rm I\!R}$ $y = \begin{cases} 1 & \text{if } x…
Cashew
  • 15
0
votes
0 answers

Best solution for closest minimum

I've 2 matrices both with Nx2 elements. Any value is a float with 8-10 decimals and they represent respectively 'x' and 'y' of a point. For any element couple (x, y) (x is in the first column, while y is in the second one) in the first array, I'd…
0
votes
3 answers

What is the minimum distance between vertices on an integer grid with the form $(m(m+2), 0)p + (m, 1)q$?

Suppose, for given $m > 0$, we have a set of points of the form $v = (m(m+2), 0)p + (m, 1)q$, with $p, q, m$ integers. What is the minimum distance between two (distinct ones) of them? Here is the square distance between any point and the…
0
votes
0 answers

conditional constraints -Integer programming

I am trying to solve the following question: Consider the constraints $a_i \le f_i(x) \le b_i$ $i=1,2,3$ and $a_i$ and $b_i$ are given constants for all $i$. Show the following conditional constraints can be expressed as a manageable forms by using…
0
votes
0 answers

Integer programming: Step function

I am not sure how to solve the following question: Show how the following step function can be represented as a 0-1 expression $f(x)=b_i$ where $a_{i-1} \le x \le a_i$ , $i=1,2,...n$ where $b_i>b_{i-1}$ for all i=1,2,...,n
0
votes
1 answer

Determine if adding y to x caused x to go over or arrive at a certain interval i

How can I know that, by adding y to x, x has crossed or arrived at an integer value dividable by i? I might be using the wrong terminology, so let me explain with an example: Say: we have an interval i = 3 we have a integer variable y = 3 we have a…
Housy
  • 123
0
votes
1 answer

How do I convert this to a linear integer program?

I have the following optimization problem. \begin{align} \text{Maximize } & \sum_{k=1}^P x_{i,k} \mu_{k} \\ \text{Subject to } & \sum_{k=1}^P\sum_{l=1}^P x_{i,k}x_{i,l} \sigma_{k, l} \geq \epsilon_i \\ & \sum_{k=1}^P\sum_{l=1}^P…
0
votes
1 answer

In integer linear programming, how to simplify a constraint with $\min$?

I have a linear integer program that has constraints like these: $$\sum_{i=1}^kw_{ij}x_{ij}\leq C+\min\limits_{i}\left(x_{ij}a_{ij}\right), \forall\,j\in\{1,\dots,k\},$$ where $k$, $C$, $w_{ij}$ and $a_{ij}$ are all parts of the input. Note that…
Zir
  • 527
  • 7
  • 12
0
votes
0 answers

number of solutions for a system of integer equations

I want to find the number of integer solutions for the following system of linear equations without computing the actual solutions ($c_1,\ldots,c_n \in \mathbb{Z}$ and $r\in \mathbb{N}$ )…
Sepehr
  • 13
  • 1
  • 5
0
votes
1 answer

Formula for Nautilus shell spiral

I am programming a game and i can't find out the formula to spawn villages for newly created users. This is how i want it to be. I want it to have a formula, where i give ID and it returns x, y coordinates. Its like the Nautilus shell spiral in x/y…
mansim
  • 103
0
votes
1 answer

Fractional vs. integer solution of a maximal matching

If we know that it takes at least $t$ steps to compute a fractional maximal matching, does it then also take at least $t$ steps to compute a integer maximal matching?
user136457
  • 2,560
  • 1
  • 22
  • 41
0
votes
1 answer

Mixed integer linear programming - making a variable have influence on another variable only when it is equal to zero

Having an integer variable $D \in \{-k,-k+1,...,-1,0,1,...,k-1,k\}$, how do I make it affect another variable only when $D = 0$? Specifically, I have a binary variable $U$ in my model. I want it to be set to $1$ when $D = 0$, but leave it free in…
0
votes
2 answers

Writing conditional logic using mathematics forumla

I'm working on an application which has a specific function which receives 2 ints: x and y. If y > x then I would like the function to return y otherwise return x - y. Just a few examples: f(10, 12) => 12 f(9, 9) => 0 f(11, 3) => 8 I can easily…
Gideon
  • 103
0
votes
1 answer

Minimising variance of the workload

A professor will assign research papers to his students as a partial fulfilment of the requirements of a graduate course. There are six students enrolled in the course and each student will be assigned exactly two research papers. The professor has…