1 1 slide integer linear programming professor ahmadi
TRANSCRIPT
2 2 Slide
Slide
Chapter 11Chapter 11Integer Linear ProgrammingInteger Linear Programming
Types of Integer Linear Programming ModelsTypes of Integer Linear Programming Models Graphical Solution for an All-Integer LPGraphical Solution for an All-Integer LP Spreadsheet Solution for an All-Integer LPSpreadsheet Solution for an All-Integer LP Application Involving 0-l VariablesApplication Involving 0-l Variables Special 0-1 ConstraintsSpecial 0-1 Constraints
3 3 Slide
Slide
Types of Integer Programming ModelsTypes of Integer Programming Models
A linear program in which all the variables are A linear program in which all the variables are restricted to be integers is called an restricted to be integers is called an integer integer linear programlinear program (ILP). (ILP).
If only a subset of the variables are restricted If only a subset of the variables are restricted to be integers, the problem is called a to be integers, the problem is called a mixed mixed integer linear programinteger linear program (MILP). (MILP).
Binary variables are variables whose values Binary variables are variables whose values are restricted to be 0 or 1. If all variables are are restricted to be 0 or 1. If all variables are restricted to be 0 or 1, the problem is called a restricted to be 0 or 1, the problem is called a 0-1 or binary integer program0-1 or binary integer program. .
4 4 Slide
Slide
Example: All-Integer LPExample: All-Integer LP
Consider the following all-integer linear Consider the following all-integer linear program:program:
Max 3Max 3xx11 + 2 + 2xx22
s.t. 3s.t. 3xx11 + + xx22 << 9 9
xx11 + 3 + 3xx22 << 7 7
--xx11 + + xx22 << 1 1
xx11, , xx22 >> 0 and integer 0 and integer
5 5 Slide
Slide
Example: All-Integer LPExample: All-Integer LP
LP RelaxationLP Relaxation
LP Optimal (2.5, 1.5)LP Optimal (2.5, 1.5)
Max 3Max 3xx11 + 2 + 2xx22
--xx11 + + xx22 << 1 1
xx22
xx11
33xx11 + + xx22 << 9 9
11
33
22
55
44
1 2 3 4 5 6 71 2 3 4 5 6 7
xx11 + 3 + 3xx22 << 7 7
6 6 Slide
Slide
Example: All-Integer LPExample: All-Integer LP
LP RelaxationLP Relaxation
Solving the problem as a linear program Solving the problem as a linear program ignoring the integer constraints, the optimal ignoring the integer constraints, the optimal solution to the linear program gives fractional solution to the linear program gives fractional values for both values for both xx11 and and xx22. From the graph on . From the graph on the previous slide, we see that the optimal the previous slide, we see that the optimal solution to the linear program is:solution to the linear program is:
xx11 = 2.5, = 2.5, xx22 = 1.5, = 1.5, zz = 10.5 = 10.5
7 7 Slide
Slide
Example: All-Integer LPExample: All-Integer LP
Rounding UpRounding Up
If we round up the fractional solution (If we round up the fractional solution (xx11 = 2.5, = 2.5, xx22 = 1.5) to the LP relaxation problem, = 1.5) to the LP relaxation problem, we get we get xx11 = 3 and = 3 and xx22 = 2. From the graph on = 2. From the graph on the next page, we see that this point lies the next page, we see that this point lies outside the feasible region, making this outside the feasible region, making this solution infeasible.solution infeasible.
8 8 Slide
Slide
Example: All-Integer LPExample: All-Integer LP
Rounded Up SolutionRounded Up Solution
LP Optimal (2.5, 1.5)LP Optimal (2.5, 1.5)
Max 3Max 3xx11 + 2 + 2xx22
--xx11 + + xx22 << 1 1
xx22
xx11
33xx11 + + xx22 << 9 9
11
33
22
55
44
1 2 3 4 5 6 71 2 3 4 5 6 7
ILP Infeasible (3, 2)ILP Infeasible (3, 2)
xx11 + 3 + 3xx22 << 7 7
9 9 Slide
Slide
Example: All-Integer LPExample: All-Integer LP
Rounding DownRounding Down
By rounding the optimal solution down to By rounding the optimal solution down to xx11 = 2, = 2, xx22 = 1, we see that this solution indeed is an = 1, we see that this solution indeed is an integer solution within the feasible region, and integer solution within the feasible region, and substituting in the objective function, it gives substituting in the objective function, it gives zz = = 8.8.
We have found a feasible all-integer solution, We have found a feasible all-integer solution, but have we found the but have we found the optimaloptimal all-integer solution? all-integer solution?
------------------------------------------
The answer is NO! The optimal solution is The answer is NO! The optimal solution is xx11 = 3 and = 3 and xx22 = 0 giving = 0 giving zz = 9, as evidenced in the = 9, as evidenced in the next two slides. next two slides.
10 10 Slide
Slide
Example: All-Integer LPExample: All-Integer LP
Complete Enumeration of Feasible ILP SolutionsComplete Enumeration of Feasible ILP SolutionsThere are eight feasible integer solutions to There are eight feasible integer solutions to
this problem:this problem:
xx11 xx22 zz 1. 0 0 01. 0 0 0 2. 1 0 32. 1 0 3 3. 2 0 63. 2 0 6 4. 3 0 9 optimal 4. 3 0 9 optimal
solutionsolution 5. 0 1 25. 0 1 2 6. 1 1 56. 1 1 5 7. 2 1 87. 2 1 8
8. 1 2 78. 1 2 7
11 11 Slide
Slide
Example: All-Integer LPExample: All-Integer LP
ILP Optimal (3, 0)ILP Optimal (3, 0)
Max 3Max 3xx11 + 2 + 2xx22
--xx11 + + xx22 << 1 1
xx22
xx11
33xx11 + + xx22 << 9 9
11
33
22
55
44
xx11 + 3 + 3xx22 << 7 7
1 2 3 4 5 6 71 2 3 4 5 6 7
12 12 Slide
Slide
Special 0-1 ConstraintsSpecial 0-1 Constraints
When When xxii and and and and xxjj represent binary variables represent binary variables designating whether projects designating whether projects ii and and jj have been have been completed, the following special constraints may be completed, the following special constraints may be formulated:formulated:
• At most At most kk out of out of nn projects will be completed: projects will be completed: xxjj << kk
• Project Project jj is conditional on project i: is conditional on project i:
xxjj - - xxii << 0 0
• Project Project ii is a co-requisite for project is a co-requisite for project jj: :
xxjj - - xxii = 0 = 0
• Projects Projects ii and and jj are mutually exclusive: are mutually exclusive:
xxii + + xxjj << 1 1
13 13 Slide
Slide
Example: Chattanooga ElectronicsExample: Chattanooga Electronics
Chattanooga Electronics, Inc. is planning to expand its Chattanooga Electronics, Inc. is planning to expand its operations into other electronic equipment. The company has operations into other electronic equipment. The company has identified seven new product lines it can carry. Relevant identified seven new product lines it can carry. Relevant information about each line follows: information about each line follows:
Initial Floor Space Exp. Initial Floor Space Exp. Rate Rate
Product Line Investment (Sq.Ft.) of Product Line Investment (Sq.Ft.) of ReturnReturn
1. Digital TVs 1. Digital TVs $6,000 125 8.1%$6,000 125 8.1% 2. HD TVs 2. HD TVs 12,000 150 9.0 12,000 150 9.0 3. Large Screen TVs 3. Large Screen TVs 20,000 200 11.0 20,000 200 11.0 4. DVDs 4. DVDs 14,000 40 10.2 14,000 40 10.2 5. DVD/RWs 5. DVD/RWs 15,000 40 10.5 15,000 40 10.5 6. Video Games 6. Video Games 2,000 2,000 20 20
14.1 14.1 7. PC Computers 7. PC Computers 32,000 100 13.2 32,000 100 13.2
14 14 Slide
Slide
Chattanooga Electronics - ContinuedChattanooga Electronics - Continued
Define the Decision Variables Define the Decision Variables
xjxj = 1 if product line = 1 if product line jj is introduced; is introduced;
= 0 otherwise.= 0 otherwise.
Where the Product lines are defined as:Where the Product lines are defined as:
1.1. (X1) = Digital TVs(X1) = Digital TVs
2.2. (X2) = HD TVs(X2) = HD TVs
3.3. (X3) = Large Screen TVs(X3) = Large Screen TVs
4.4. (X4) = DVDs(X4) = DVDs
5.5. (X5) = DVD/RWs(X5) = DVD/RWs
6.6. (X6) = Video Games(X6) = Video Games
7.7. (X7) = Computers(X7) = Computers
15 15 Slide
Slide
Example: Chattanooga ElectronicsExample: Chattanooga Electronics
Chattanooga Electronics has decided that:Chattanooga Electronics has decided that:
1.1. they should not stock large screen TVs (X3) unless they should not stock large screen TVs (X3) unless they stock either digital (X1) or HD TVs (X2). they stock either digital (X1) or HD TVs (X2).
2.2. also, they will not stock both types of DVDs (X4 & also, they will not stock both types of DVDs (X4 & X5).X5).
3.3. they will stock video games (X6) only if they stock they will stock video games (X6) only if they stock HD TVs (X2).HD TVs (X2).
4.4. the company wishes to introduce at least three the company wishes to introduce at least three new product lines. new product lines.
5.5. If the company has $45,000 to invest and 420 sq. If the company has $45,000 to invest and 420 sq. ft. of floor space available, formulate an integer ft. of floor space available, formulate an integer linear program for Chattanooga Electronics to linear program for Chattanooga Electronics to maximize its overall expected rate of return.maximize its overall expected rate of return.
16 16 Slide
Slide
Example: Chattanooga ElectronicsExample: Chattanooga Electronics
Define the Objective FunctionDefine the Objective Function
Maximize total overall expected return:Maximize total overall expected return:
Max .081(6000)Max .081(6000)xx11 + .09(12000) + .09(12000)xx22 + .11(20000)+ .11(20000)xx33
+ .102(14000)+ .102(14000)xx4 4 + .105(15000)+ .105(15000)xx55 + .141(2000)+ .141(2000)xx66
+ .132(32000)+ .132(32000)xx77 oror
Max 486Max 486xx11 + 1080 + 1080xx22 + 2200 + 2200xx33 + 1428 + 1428xx44 + 1575+ 1575xx55
+ 282+ 282xx66 + 4224 + 4224xx77
17 17 Slide
Slide
Example: Chattanooga ElectronicsExample: Chattanooga Electronics
Define the ConstraintsDefine the Constraints
1) Money: 1) Money:
6060xx11 + 12 + 12xx22 + 20 + 20xx33 + 14 + 14xx44 + 15 + 15xx55 + 2 + 2xx66 + + 3232xx77 << 45 45
2) Space: 2) Space:
125125xx11 +150 +150xx22 +200 +200xx33 +40 +40xx44 +40 +40xx55 +20 +20xx66 +100+100xx77 << 420 420
18 18 Slide
Slide
Example: Chattanooga ElectronicsExample: Chattanooga Electronics
Define the Constraints (continued)Define the Constraints (continued)
3) Stock large screen TVs (X3) only if stock digital 3) Stock large screen TVs (X3) only if stock digital (X2) or HD (X2):(X2) or HD (X2):
4) Do not stock both types of DVDs (X4 & X5): 4) Do not stock both types of DVDs (X4 & X5):
5) Stock video games (X6) only if they stock HD 5) Stock video games (X6) only if they stock HD TV's (X2): TV's (X2):
6) At least 3 new lines:6) At least 3 new lines:
7) Variables are 0 or 1: 7) Variables are 0 or 1:
xxjj = 0 or 1 for = 0 or 1 for jj = 1, , , 7 = 1, , , 7
19 19 Slide
Slide
Example: Mo’s ProgrammingExample: Mo’s Programming
Mo's Programming has five idle Mo's Programming has five idle Programmers and four custom Programs to Programmers and four custom Programs to develop. The estimated time (in hours) it would develop. The estimated time (in hours) it would take each Programmer to write each Program is take each Programmer to write each Program is listed below. (An 'X' in the table indicates an listed below. (An 'X' in the table indicates an unacceptable Programmer-Program assignment.)unacceptable Programmer-Program assignment.)
ProgrammerProgrammer
ProgramProgram 11 22 33 44 55
Java 19 23 20 21 18Java 19 23 20 21 18
C++ 11 14 X 12 10C++ 11 14 X 12 10
Assembler 12 8 11 X 9Assembler 12 8 11 X 9
Pascal X 20 20 18 21Pascal X 20 20 18 21
20 20 Slide
Slide
Example: Mo’s ProgrammingExample: Mo’s Programming
Formulate an integer program for Formulate an integer program for determining the Programmer-Program determining the Programmer-Program assignments that minimize the total estimated assignments that minimize the total estimated time spent writing the four Programs. No time spent writing the four Programs. No Programmer is to be assigned more than one Programmer is to be assigned more than one Program and each Program is to be worked on Program and each Program is to be worked on by only one Programmer.by only one Programmer.
----------------------------------------
This problem can be formulated as a 0-1 This problem can be formulated as a 0-1 integer program. The LP solution to this problem integer program. The LP solution to this problem will automatically be integer (0-1).will automatically be integer (0-1).
21 21 Slide
Slide
Example: Mo’s ProgrammingExample: Mo’s Programming
Define the decision variablesDefine the decision variables
xxijij = 1 if Program i is assigned to Programmer = 1 if Program i is assigned to Programmer jj = 0 otherwise.= 0 otherwise.
Number of decision variables = Number of decision variables = [(number of Programs)(number of Programmers)] [(number of Programs)(number of Programmers)]
- (number of unacceptable assignments) - (number of unacceptable assignments) = [4(5)] - 3 = 17= [4(5)] - 3 = 17
Define the objective functionDefine the objective function Minimize total time spent writing Programs:Minimize total time spent writing Programs:
Min 19Min 19xx1111 + 23 + 23xx1212 + 20 + 20xx1313 + 21 + 21xx1414 + 18 + 18xx1515 + 11 + 11xx2121
+ 14+ 14xx2222 + 12 + 12xx2424 + 10 + 10xx2525 + 12 + 12xx3131 + 8 + 8xx3232 + 11 + 11xx3333
+ 9x+ 9x3535 + 20 + 20xx4242 + 20 + 20xx4343 + 18 + 18xx4444 + 21 + 21xx4545
22 22 Slide
Slide
Example: Mo’s ProgrammingExample: Mo’s Programming
Define the ConstraintsDefine the Constraints
Exactly one Programmer per Program:Exactly one Programmer per Program:
1) 1) xx1111 + + xx1212 + + xx1313 + + xx1414 + + xx1515 = 1 = 1
2) 2) xx2121 + + xx2222 + + xx2424 + + xx2525 = 1 = 1
3) 3) xx3131 + + xx3232 + + xx3333 + + xx3535 = 1 = 1
4) 4) xx4242 + + xx4343 + + xx4444 + + xx4545 = 1 = 1
23 23 Slide
Slide
Example: Mo’s ProgrammingExample: Mo’s Programming
Define the Constraints (continued)Define the Constraints (continued)
No more than one Program per Programmer:No more than one Program per Programmer:
5) 5) xx1111 + + xx2121 + + xx3131 << 1 1
6) 6) xx2121 + + xx2222 + + xx2323 + + xx2424 << 1 1
7) 7) xx3131 + + xx3333 + + xx3434 << 1 1
8) 8) xx4141 + + xx4242 + + xx4444 << 1 1
9) 9) xx5151 + + xx5252 + + xx5353 + + xx5454 << 1 1
Non-negativity: Non-negativity: xxijij >> 0 for 0 for ii = 1, . . ,4 and = 1, . . ,4 and jj = = 1, . . ,5 1, . . ,5