Professional Documents
Culture Documents
14x2=28C, 14x1=14L
Lecture 7
Part I. Generalities concerning mathematical models of economic processes
After
2. Special types of mathematical programming models – some interpreted examples. First LP theoretical results
consider now:
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 2/20
1. Motivation. Consider the model of the manufacturing cell in the case study in lecture 6
(Williams, 1999)
After deducing raw material costs, each unit of each product yields a contribution to profit (1st table row)
and each unit requires a certain time on each process, if necessary (2nd row in the table)
Table 1
PROD1 PROD2 PROD3 PROD4 PROD5
Contribution to profit (£) 550 600 350 400 200
Grinding time (hours) 12 20 - 25 15
Drilling time (hours) 10 8 16 - -
Employee’s time (hours) 20 20 20 20 20
There are:
3 grinding machines,
2 drilling machines and
8 workers, each one working an 8 hours shift/day.
There are 2 shift/day and 6 working days/week.
Problem (informal): how much to make of each product per week, so as to maximize the total profit contribution?
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 3/20
2. LP model and its dual:
Define x ( x1 x2 x3 x4 x5 )T the vector of (unknown) number of units of PROD1, …,PROD5.
The dual variables are λ (1 2 3 ) T are unit prices of the resources (the resources in the primal problem
are evaluated in time units)
P: max(550 x1 600 x2 350 x3 400 x 4 200 x5 ) (1) D: min( 2881 192 2 384 3 )
(1D)
subject to 12 x1 20 x2 25x4 15x5 288 (2.1)
10 x1 8x2 16 x3 192 (2.2) subject to 121 10 2 20 3 550 (2D.1)
5 201 8 2 20 3 600 (2D.2)
20 xi 384 (2.3) 16 2 20 3 350 (2D.3)
i 1
251 20 3 400 (2D.4)
xi 0 , i 1 : 5
j 0 , j 1: 3 151 3 200 (2D.5)
Solving P and D with simplex (see Appendix) in MATLAB for example (exercise !) gives:
x* (12 7.2 0 0 0) T λ* (6.2 0 23.75) T
Optimal P value: c T x* 10920 £ Optimal D value : ( λ*)T b 10920 £
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 4/20
QUESTION: what happens if the primal problem asks to specify the decision variables, i.e. the PRODUCTS
QUANTITIES as integer numbers, for example if the products are PIECES to be manufactured ?
Using MATLAB:
INPUT DATA
c=[550 ;600; 350;400;200]
A=[12 20 0 25 15;10 8 16 0 0;20 20 20 20 20]
b=[288; 192;384]%time limits for drilling, grinding and workforce resources
lb=zeros(5,1)
a) LP solution b) Integer solution
[x,fval,exitflag,output,lambda]= Aeq=[]
linprog(-c,A,b,[],[],lb) beq=[]
Optimization terminated. ub=[]
yidx=true(5,1)
x= %integer solution
xint=miprog(-c,A,b,Aeq,beq,lb,ub,yidx)
12.0000 Iteration 25. Optimization ended.
7.2000 Found optimal solution!
0.0000 Time spent 0.86011 seconds
0.0000 Objective function value: -10800
0.0000
xint =
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 5/20
Hence:
LP: IP:
T *
x* (12 7.2 0 0 0) xint (12 7 0 0 0) T
Optimal P value: c T x* 10920 £ Optimal Pint value: c T x int
*
10800 c T x *
Note that, in LP, if P and D are feasible, then the two problems have the same optimal value: c T x* λ *T b .
In general:
Maximum objective of Pint maximum objective of P = minimum objective of D.
Then the IP duality gap signifies that the minimum objective of D is the smallest upper bound for the objective of Pint.
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 6/20
More formally:
x Z n (decision variables)
A R mn , c R n , b R m
The feasible set of Pint: X { x Z n | Ax b}
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 7/20
EXAMPLE: Budget allocation for municipal services
Problem: a municipal council has to decide how to allocate the budget between
The GOAL of the city council is to allocate funds to maximize the number of lives saved over the course of a year.
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 8/20
The matrix-vector IP model:
IP: max(0,2P 0,65F ) Remark. x1 P , x 2 F , x [ x1 x 2 ]T , c T [0,2 0,65]
Subject to: 200P 1000F 5350 200 100 5350
P 1,5F 0
A 1 1,5 , b 0 and we have
P 7,5F 0 ,
P 0 , F 0 , P, F Z 1 7,5 0
IP : max c T x (1)
Ax b, x 0 , x Z 2 (2)
Graphical solution:
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 9/20
F 1 2
F P F P (1)
(1) 1,5 3
5 1 2
F P F P (2)
7,5 15
200P 1000F 5350
1
4 B F P 5,35 (3)
5
obj 0,2P 0,65F
3 obj=4,601 A( P 0, F 0)
B( P 6,1731; F 4,1154) =(1) (3)
(2) C ( P 16,05; F 2,14) =(2)(3)
2 C obj (C ) 4,601
Cint Cint ( P 15; F 2)
obj (Cint ) 4,3 obj (C )
1
obj=4,3
A
5 10 15 20 25 (3) P
obj=0
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 10/20
The BRANCH AND BOUND tree of the problem: in each node, there is an LP problem
P16 P16
P=16 F=2,13 (see (2)) NOT FEASIBLE
obj=4,5975 STOP
F2 F3
F=2 P=15 (see (2)) F=3 P=5(5,35-F) =11,75 (see (3))
obj=4,3 (Cint) obj=4,3 (this is an upper bound to obj)
STOP NO REASON TO CONTINUE BRANCHING
FROM THIS NODE, because the obj would decrease
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 11/20
In general, IP problems are harder to be solved than LP problems
- More iterations and computational effort (see combinatorial explosion below)
- MATLAB hasn’t a built-in IP routine search with Google or IBM-ILOG routines
Remark. For an IP model, the corresponding LP model is known as LP relaxation. The central problem
with solving linear IP is to find the feasibility set of IP, as a convex hull with integer points as vertices. In some
situations, this is exactly the initial LP problem, as in the worked example in Lab.1
In some cases, the LP formulation has some special features. For example:
The straightforward formulation results in an IP model, where the feasible region is already the convex hull of
integer points. LP problems in this category have a DIGRAPH representation: transportation problems, assignment
problems, minimum cost network models.
To verify this, there are sufficient conditions for an LP solution to be also the solution of the associated IP problem
More formally, we have algebraic sufficient but not necessary conditions that guarantee that LP optimal solutions are
also optimal IP solutions:
Consider the LP problem with integer data ( A, b) :
P : max c T x (1)
Ax b, x 0 , x R n (2)
with x R n (decision variables), A Z mn , c R n , b Z m and the feasible set of P: X { x R n | Ax b}
*
Then it is guaranteed for P to have an integer optimal solution xint Z n for any c R n and any b Z m , if the
matrix A is totally unimodular (TU), that is every square sub-matrix of A has its determinant equal to 0 or 1.
(Williams, 1999, page 192), (Wolsey, 1998, pag.39), (Chong&Zak, 2013, pag.430)
In short, under above conditions, the LP relaxation solves the IP.
TU is difficult to check
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 12/20
A sufficient condition for TU is formulated in next:
Property : A matrix A [aij ]i 1:m, j 1:n Z mn is TU if:
Each element of A is 0, +1 or 1;
i.
ii.
No more than two non-zero elements appear in each column;
iii.
The rows can be partitioned into two subsets, S1 and S2, such that: a) if a column contains two non-zero
elements of the same sign, then one element is in each of the subsets; b) if a column contains two non-
zero elements of opposite sign, then both elements are in same subset.
Example: Consider the transportation problem in lecture 3, and lecture 4
1 M1 b1=2 Denote the decision variables of the primal problem: y1 x11, y 2 x12 ,
2 y3 x13 , y 4 x 21 , y5 x 22 , y 6 x 23 .
a1=4 P1 2 M2 b2=3 the primal and the dual transportation problem in the form:
4
P : min c T y , D : max λ T d , (1)
a2=7 P2 3
M3 b3=5 Ay b , y 0 T
A λ c, y 0
6
with: d [2 3 5 4 7]T integral and
1 0 0 1 0 0 The optimal solution is integer
0 1 0 0 1 0 M b =2
2 1 1
A 0 0 1 0 0 1 is TU.
a1=4 P1 4 2 M b =3
1 1 1 0 0 0 2 2
0 0 0 1 1 1 2 4
3
a2=7 P2 3
1 M3 b3=5
6
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 13/20
REMARKABLE IP PROPERTY:
Consider
an IP problem and its LP relaxation
Pint : max c T x (1) P : max c T x (1’)
Ax b, x 0 , x Z n (2) Ax b, x 0 , x R n (2’)
with:
unknown x Z n (decision variables) c R n
and
the integer data: A Z mn , b Z m (3)
and A Z mn is TU (4)
Assuming that the LP problem has a solution x * x* Z n and the DUALITY GAP = 0 (see pag.6)
Moreover, one can solve IP problems with properties (3) and (4) using LP routines (based on simplex)
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 14/20
APPENDIX: CLASSIFICATION OF IP problems (Wolsey, 1998)
Recall that a Linear Program (LP) is
LP: max c T x
Ax b, x 0 , x R n
with x R n (decision variables), A R mn , c R n , b R m and the feasible set of LP: X { x R n | Ax b}
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 15/20
0-1 or Binary Integer Program (BIP)
IP: max c T x
Ax b, x 0 , x {0, 1}n
with x {0, 1}n (decision variables), A R mn , c R n , b R m and the feasible set of BIP:
X {x {0,1}n | Ax b} .
Combinatorial Optimization (COP): Consider a finite set N {1,2, , n}, weights c j for each j {1,2, , n} and a
set F of feasible subsets of N . The problem of finding a minimum weight feasible subset is
COP: min { c j : S F }
S N jS
Often COP can be written as an IP or BIP.
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 16/20
EXAMPLES OF IP PROBLEMS
c11 M1
m n
b1 P: min cij xij
i 1 j 1
ci1 cm1 m
subject to xij b j , j 1: n
P1 i 1
a1 n
xij a i , i 1 : m
j 1
c1 j Decision variables: xij {0, 1} , i 1 : m , j 1 : n
cij Mj
Pi , i 1 : m , RESOURCES
Pi bj
ai cmj M j , j 1 : n , CUSTOMERS
cij - penalty associated with assigning resource Pi to
customer M j
cin
Pm c1n a i - supply of resource Pi , or the maximum number of
am cmn customers that can be assigned to Pi
Mn
bn b j - demand of customer M j , or the minimum number of
resources that must be assigned to customer M j
xij 1 if 1 unit of resource Pi is allocated to customer
M j ; 0 if not
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 17/20
The Assignment Problem: (see also Lab4, assignment with maximum rating):
m n
P: min cij xij
i 1 j 1
m
subject to xij 1, j 1: n
i 1
n
xij 1 , i 1 : m , xij {0, 1} , i 1 : m , j 1 : n
j 1
Scenario: In a certain plant there are different job openings J1 , …, J n and m persons I1 , …, I m available for
working in various jobs. Each person is assigned to carry out exactly one job. Some individuals are better suited
to particular jobs than others, so there is an estimated cost cij if person I i is assigned to job J j . The problem is
to find the minimum cost assignment. Decision variables: xij 1 if person I i is assigned to job J j ; 0 if not
0-1 Knapsack Problem Origins: a hiker trying to fill her knapsack to maximum total value
n
P: max c j x j
j 1
n
subject to a j x j b, x j {0, 1} , j 1 : n
j 1
Scenario: There is a budget b available for investment in projects during the coming year and n projects are
under consideration, where a j 0 is the outlay for project j, and c j is the expected return. The goal is to choose
a set of projects so that the budget is not exceeded and the expected return is maximized.
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 18/20
Decision variables: x j 1 if project j is selected; 0 if not. Another scenario: optimal stocking a warehouse to
maximum value, given that the goods stored come in indivisible units.
Other applications:
The assignment problem: There is one-to-one correspondence between assignments and permutations of {1,2, , n}
n! solutions to compare
The knapsack problem: the number of subsets is 2 n . If b nj1 a j there are at least 2 n1 feasible subsets.
References
(Williams, 1999) H.Paul Williams, Model building in mathematical programming, John Wiley, 1999.
(Wolsey, 1998) Laurence A. Wolsey, Integer Programming, John Wiley, 1998
(Chong&Zak, 2013) Edwin K.P. Chong, Stanislaw H. Zak, An introduction to optimization, 4th edition, John Wiley,
2013.
Hoffman K.L. and Ralphs T.K. (2012) Integer and Combinatorial Optimization. Industrial Systems Engineering,
COR@L Technical Report 12T-020, http://coral.ie.lehigh.edu/~ted/files/papers/ICO-EORMS11.pdf.
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 19/20
Engineering applications:
Mostefa M-S (2014). The branch-and-bound method, genetic algorithm, and dynamic programming to determine a safe
ship trajectory in fuzzy environment. Procedia Computer Science 35, p.348-357.
https://www.sciencedirect.com/science/article/pii/S1877050914010801
_________________________________________________________________________________________________________________________
Conf. V.E. Oltean / BPRA. Part I- Generalities. 3. IP. Mixed integer and combinatorial optimization – lecture 7 20/20