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:

1124 questions
90
votes
1 answer

Determining answers to a true/false test by guessing optimally ($k2^{k-1}$ questions, $2^k$ attempts)

A student has to pass a exam, with $k2^{k-1}$ questions to be answered by yes or no, on a subject he knows nothing about. The student is allowed to pass mock exams who have the same questions as the real exam. After each mock exam the teacher tells…
19
votes
6 answers

Good software for linear/integer programming

I never did any linear/integer programming so I am wondering the following two things What are some efficient free linear programming solvers? What are some efficient commercial linear programming solvers? It would be nice to supply a dummy…
16
votes
3 answers

How close are the closests cells of the same color in a periodically colored grid?

In a square grid, if we have a coloring of the form $c(x, y) = (x + ny) \bmod m$, what is the minimum (positive!) taxicab distance (i.e. sum of absolute value fo coordinates) between different cells of the same color? (In this example I colored…
13
votes
2 answers

How to find LCM of two numbers when one starts with an offset

In the world of natural numbers, a RED and a GREEN guy start from 0 and walk down the numberline. If the RED guy moves in steps of size r and the GREEN guy moves in steps of size g, the spots on the numberline where both will step are k * lcm(r, g)…
11
votes
0 answers

Balanced linear partitioning of a set of points in $R^d$

Suppose we have a set of points in $R^d$ and for a given constant $\epsilon>0$ we want to find a hyperplane such that it divides the dataset into two balanced partitions, and that the number of points that are $\epsilon$-close the hyperplane is…
10
votes
3 answers

How to formulate Unique value constraint in Integer Programming?

Given the following integer programming formulation, how can I specify that the variables are unique and none of them has the same value as the other one. basically x1, x2, x3 , and x4 need to get only one unique value from 1, 2, 3 or 4. and same…
Is7aq
  • 203
9
votes
1 answer

Shortest palindromic Egyptian representation for reciprocal integers

Consider the problem of representing the reciprocal of an integer as an Egyptian fraction where all the denominators are palindromes. i.e. write $$ \frac{1}{n} = \sum_{i} \frac{1}{a_i} $$ where $a_i$ is a palindrome (repeating $a_i$ is allowed). …
9
votes
2 answers

Is the inverse of an invertible totally unimodular matrix also totally unimodular?

My question is learned from here. Let me restate it as follows: A unimodular matrix $M$ is a square integer matrix having determinant $+1$ or $−1$. A totally unimodular matrix (TU matrix) is a matrix for which every square non-singular submatrix is…
9
votes
2 answers

Linear constraints to placing $N$ queens on an $N \times N$ chessboard?

I'm trying to formulate the problem of placing $N$ queens on an $N \times N$ chessboard such that no two queens share any row, column, or diagonal. I managed to define my decision variable as $x[n][n]$, a binary variable indicating if the location…
8
votes
1 answer

Integer programming feasibility is NP-what

What is the complexity class of the general problem of integer programming feasibility? The sources I've looked at are, in my opinion, very confusing. Some say NP-hard, some say NP-complete. Some do not distinguish between the general problem and…
8
votes
2 answers

XORing consecutive integers has an interesting property. Does anyone know why?

I hesitated to post on StackOverflow but I think the problem has little to do with programming and more to do with mathematics. So, here it is: I wanted to compute the function $ f(n) = 0 \oplus 1 \oplus 2 \oplus \dotsb \oplus n$ in O(1) instead of…
Cranium
  • 183
8
votes
2 answers

Linear programming problem with no objective function

I have a binary integer programming problem for which I only need a solution that meets all the constraints. I do not have an objective function that I am trying to minimize or maximize. I've been using lp_solve to solve this problem and it works…
8
votes
2 answers

Linear Programming Formulation of Traveling Salesman (TSP) in Wikipedia

I am confused by Wikipedia's Linear Programming formulation of the Traveling Salesman Problem, in say the objective function. Question: If there are n cities indexed 1,...,n, what is city with index 0? This can be seen in the objective function…
8
votes
4 answers

Are there ways to solve equations with multiple variables?

I am not at a high level in math, so I have a simple question a simple Google search cannot answer, and the other Stack Exchange questions does not either. I thought about this question after reading a creative math book. Here is the question I was…
8
votes
1 answer

Prerequisite reading for Concrete Mathematics?

I'm a freshman computer science major who has just started reading Concrete Mathematics, mathematics for computer science. Is there any prerequisite reading or learning I should do before embarking on reading this book?
1
2 3
74 75