IPexercises
IPexercises
Capital requirements
Project Return
Year 1 Year 2 Year 3
Project 1 0.2 0.5 0.3 0.2
Project 2 0.3 1.0 0.8 0.2
Project 3 0.5 1.5 1.5 0.3
Project 4 0.1 0.1 0.4 0.1
Available capital 3.1 2.5 0.4
1
2
Branch-and-bound method in 2D
Exercise 4. Illustrate the branch-and-bound algorithm at the IP
max x1 + x2
s.t. 4x1 − 2x2 ≥ 1
4x1 + 2x2 ≤ 11
2x2 ≥ 1
x1 , x 2 ∈ N
max x1 + 2x2
s.t. 2x1 + x2 ≤ 8
− x1 + 2x2 ≤ 5
x1 , x 2 ∈ N
3
IP solver
Exercise 6. Implement the problems in Exercise 1 and Exercise 3 to your com-
puter by using ZIMPL and then solve them by using some LP solver (e.g. SCIP).
(1) each cell of grid must be filled by exactly one digit from 1 to 9;
(2) each digit in {1, . . . , 9} appears exactly once in each column, each row, and
each 3 × 3-block.
Usually, a Sudoku puzzle is provided with a partially complete grid, and the
objective is to completely fill the grid.
(i) Model the problem of solving a Sudoku puzzle as an integer linear program.
Hint: use the binary variables
{
1 if k is filled in the cell (i, j) of the grid,
xijk =
0 otherwise.
(ii) Implement your model into compute by using ZIMPL, and then use some
IP solver (e.g. SCIP) to solve the model for the puzzle given in Figure 1. Show
your obtained solution in form of a completely filled Sudoku grid.
8 9
1 3 9
5 2 4
2 6 8
9 7 6 5
3 6 5
1 3 5
8 7 1
4 5