Integer Linear Programming

24
1 Integer Linear Integer Linear Programming Programming Professor Ahmadi

description

Integer Linear Programming. Professor Ahmadi. Integer Linear Programming. Types of Integer Linear Programming Models Graphical Solution for an All-Integer LP Spreadsheet Solution for an All-Integer LP Application Involving 0-l Variables Special 0-1 Constraints. - PowerPoint PPT Presentation

Transcript of Integer Linear Programming

Page 1: Integer Linear Programming

1 1 Slide

Slide

Integer Linear Integer Linear ProgrammingProgramming

Professor Ahmadi

Page 2: Integer Linear Programming

2 2 Slide

Slide

Integer 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

Page 3: Integer Linear Programming

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

Page 4: Integer Linear Programming

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

Page 5: Integer Linear Programming

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

Page 6: Integer Linear Programming

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

Page 7: Integer Linear Programming

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.

Page 8: Integer Linear Programming

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

Page 9: Integer Linear Programming

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.

Page 10: Integer Linear Programming

10 10 Slide

Slide

Example: All-Integer LPExample: All-Integer LPRounded down solutionRounded down solution

Rounded down solution (2, 1)Rounded down solution (2, 1)

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

Page 11: Integer Linear Programming

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

Page 12: Integer Linear Programming

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

Page 13: Integer Linear Programming

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

Page 14: Integer Linear Programming

14 14 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 appliances. The company has operations into other electronic appliances. 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 $60,000 125 8.1%$60,000 125 8.1% 2. Color TVs 2. Color 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

Page 15: Integer Linear Programming

15 15 Slide

Slide

Example: Chattanooga ElectronicsExample: Chattanooga Electronics

Chattanooga has decided that they should Chattanooga has decided that they should not stock large screen TVs unless they stock not stock large screen TVs unless they stock either digital or color TVs. Also, they will not either digital or color TVs. Also, they will not stock both types of DVDs, and they will stock stock both types of DVDs, and they will stock video games if they stock color TVs. Finally, the video games if they stock color TVs. Finally, the company wishes to introduce at least three new company wishes to introduce at least three new product lines. product lines.

If the company has $45,000 to invest and If the company has $45,000 to invest and 420 sq. ft. of floor space available, formulate an 420 sq. ft. of floor space available, formulate an integer linear program for Chattanooga to integer linear program for Chattanooga to maximize its overall expected rate of return.maximize its overall expected rate of return.

Page 16: Integer Linear Programming

16 16 Slide

Slide

Example: Chattanooga ElectronicsExample: Chattanooga Electronics

Define the Decision Variables Define the Decision Variables

xxjj = 1 if product line = 1 if product line jj is introduced; is introduced;

= 0 otherwise.= 0 otherwise. Define the Objective FunctionDefine the Objective Function

Maximize total overall expected return:Maximize total overall expected return:

Max .081(60000)Max .081(60000)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 4860Max 4860xx11 + 1080 + 1080xx22 + 2200 + 2200xx33 + 1428 + 1428xx44 + 1575 + 1575xx55

+ 282+ 282xx66 + 4224 + 4224xx77

Page 17: Integer Linear Programming

17 17 Slide

Slide

Example: Chattanooga ElectronicsExample: Chattanooga Electronics

Define the ConstraintsDefine the Constraints

1) Money: 1) Money:

2) Space: 2) Space:

3) Stock large screen TVs only if stock digital or 3) Stock large screen TVs only if stock digital or color:color:

Page 18: Integer Linear Programming

18 18 Slide

Slide

Example: Chattanooga ElectronicsExample: Chattanooga Electronics

Define the Constraints (continued)Define the Constraints (continued)4) Do not stock both types of DVDs: 4) Do not stock both types of DVDs:

5) Stock video games if they stock color TV's: 5) Stock video games if they stock color TV's:

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

Page 19: Integer Linear Programming

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

Page 20: Integer Linear Programming

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

Page 21: Integer Linear Programming

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

Page 22: Integer Linear Programming

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

Page 23: Integer Linear Programming

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

Page 24: Integer Linear Programming

24 24 Slide

Slide

The End of ChapterThe End of Chapter