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 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.

Source: https://en.wikipedia.org/wiki/Integer_programming

966 questions
87
votes
2 answers

Determining information in minimum trials (combinatorics problem)

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…
17
votes
5 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…
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…
9
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)…
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
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
  • 183
  • 1
  • 4
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…
7
votes
1 answer

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
  • 173
  • 5
7
votes
3 answers

Integer Programming problem

I have an integer programming problem with $L$ variables $x_1, x_2, x_{L}$ which all assume integer values and the following constraints must stand: $x_i \geq 0$ $x_1 = 10$ $x_2 + x_3 + ... + x_{L} = 36$ how can I find the max and min of the…
7
votes
2 answers

Best approximation of sum of unit vectors by a smaller subset

Let $v_1,\ldots,v_N$ be linear independent unit vectors in $\mathbb{R}^N$ and denote their scaled sum by $s_N = \frac{1}{N}\sum_{k=1}^N v_k.$ I would like to find a small subset of size $n$ among those vectors such that their scaled sum approximates…
7
votes
2 answers

Mean and Median in a Classic River Crossing Problem

Consider the following classic problem: Four people on the west side of a river wish to use their single boat to get to the east side of a river. Each boat ride can hold at most two people, and the time it takes to get across will be the time…
7
votes
1 answer

Integer linear programming constraint for maximum number of consecutive ones in a binary sequence

Consider an integer programming problem with binary decision variables $x_1,\ldots,x_n \in \{0,1\}$. Im trying to model the constraint that enforces the maximum number of consecutive ones in successive sequence. That is, if the maximum number of…
7
votes
2 answers

How to prove that this matrix is total unimodular

This matrix is total unimodular (tested by a computer program). 1 1 1 1 -1 -1 -1 -1 0 1 1 1 0 -1 -1 -1 0 0 1 1 0 0 -1 -1 0 0 0 1 0 0 0 -1 1 0 0 0 -1 0 0 0 1 1 0 0 -1 -1 0 0 1 1 1 0 -1 -1 -1 0 1 1 1 1 -1 -1 -1 -1 Is there way to prove…
JohnCry
  • 71
  • 2
6
votes
1 answer

Are packing (i.e., independence) numbers arbitrarily smaller than fractional packing (i.e., Rosenfeld) numbers?

Take a graph $G=(V,E)$. One of the equivalent ways of defining its independence number (also known as $1$-packing number) is $$\alpha = \max\left\{ \sum_{v\in V}f(v) : \forall v\in V, f(v) \in \{0,1\}\text{ and } \forall \text{ clique }C, \sum_{v\in…
1
2 3
64 65