Вы находитесь на странице: 1из 38

10/1/2013

Operations Analysis II
IE 322

Integer Programming

Fall 2013

Definition
Integer Linear Programs are linear
programs with some or all the variables
restricted to integer or (discrete) values.
If all the variables restricted to integer or
(discrete) values, then the Problem is an
integer linear program ILP.
If some variables are integer or (discrete)
(but not all) then the problem is a Mixed
Integer Linear Program MILP.

1
10/1/2013

Integer Programming Models


Types of Models

Total Integer Model: All decision variables required to have


integer solution values.

0-1 Integer Model: All decision variables required to have


integer values of zero or one.

Mixed Integer Model: Some of the decision variables (but


not all) required to have integer values.

A Total Integer Model (1 of 2)

Machine shop obtaining new presses and lathes.


Marginal profitability: each press $100/day; each lathe
$150/day.
Resource constraints: $40,000, 200 sq. ft. floor space.
Machine purchase prices and space requirements:

Required Floor
Machine Purchase
Space
Price
(sq. ft.)
Press 15 $8,000

Lathe 30 4,000
4

2
10/1/2013

A Total Integer Model (2 of 2)

Integer Programming Model:

Maximize Z = $100x1 + $150x2


subject to:
8,000x1 + 4,000x2 $40,000
15x1 + 30x2 200 ft2
x1, x2 0 and integer
x1 = number of presses
x2 = number of lathes

A 0 - 1 Integer Model (1 of 2)
Recreation facilities selection to maximize daily usage by
residents.
Resource constraints: $120,000 budget; 12 acres of land.
Selection constraint: either swimming pool or tennis center
(not both).
Data:
Land
Recreation Expected Usage
Cost ($) Requirement
Facility (people/day)
(acres)
Swimming pool 300 35,000 4
Tennis Center 90 10,000 2
Athletic field 400 25,000 7
Gymnasium 150 90,000 3

3
10/1/2013

A 0 - 1 Integer Model (2 of 2)

Integer Programming Model:


Maximize Z = 300x1 + 90x2 + 400x3 + 150x4
subject to:
$35,000x1 + 10,000x2 + 25,000x3 + 90,000x4 $120,000
4x1 + 2x2 + 7x3 + 3x4 12 acres
x1 + x2 1 facility
x1, x2, x3, x4 = 0 or 1
x1 = construction of a swimming pool
x2 = construction of a tennis center
x3 = construction of an athletic field
x4 = construction of a gymnasium

A Mixed Integer Model (1 of 2)

$250,000 available for investments providing greatest


return after one year.
Data:
Condominium cost $50,000/unit, $9,000 profit if sold
after one year.
Land cost $12,000/ acre, $1,500 profit if sold after one
year.
Municipal bond cost $8,000/bond, $1,000 profit if sold
after one year.
Only 4 condominiums, 15 acres of land, and 20
municipal bonds available.

4
10/1/2013

A Mixed Integer Model (2 of 2)

Integer Programming Model:


Maximize Z = $9,000x1 + 1,500x2 + 1,000x3
subject to:
50,000x1 + 12,000x2 + 8,000x3 $250,000
x1 4 condominiums
x2 15 acres
x3 20 bonds
x2 0
x1, x3 0 and integer
x1 = condominiums purchased
x2 = acres of land purchased
x3 = bonds purchased

Integer Programming Graphical Solution

Rounding non-integer solution values up to the nearest


integer value can result in an infeasible solution

A feasible solution is ensured by rounding down non-


integer solution values but may result in a less than optimal
(sub-optimal) solution.

10

5
10/1/2013

Integer Programming Example


Graphical Solution of Maximization Model

Maximize Z = $100x1 + $150x2


subject to:
8,000x1 + 4,000x2 $40,000
15x1 + 30x2 200 ft2
x1, x2 0 and integer

Optimal Solution:
Z = $1,055.56
x1 = 2.22 presses
x2 = 5.55 lathes

Feasible Solution Space with Integer Solution Points


11

Example 9-1-1 (Project Selection)


Five projects are being evaluated over a 3-year planning
table gives the expected returns for each project and the
associated yearly expenditures
expenditures (million$)/yr
projects 1 2 3 Returns (million$)
1 5 1 8 20
2 4 7 10 40
3 3 9 2 20
4 7 4 1 15
5 8 6 10 30
Available funds (million$) 25 25 25

Which project should be selected over the 3-year horizon?

6
10/1/2013

Problem Set 9.1A

Problem (1)

Modify and solve the project selection problem


to account for the following additional
restrictions :
a. Project 5 must be selected if either project
1 or project 3 is selected.
b. Projects 2 and 3 are mutually exclusive.

Problem (2)
Five items are to be loaded in a vessel. The weight wj , volume
vj and the value rj for item j are given in the following table.
The maximum allowable cargo weight and volume are 111
tons and 109 m3.
itemj Unitweightwj UnitVolumevj UnitValuerj
1 5 1 4
2 8 8 7
3 3 6 6
4 2 5 5
5 7 4 4

Formulate the ILP model of the most


valuable cargo problem.

7
10/1/2013

Problem 7
You have the following three-letter words : AET, FAR,
TVA, ADV, JOE, FIN, OSF and KEN. Suppose that we
assign a numeric values to the alphabet starting with A =
1 and ending with Z = 26. Each word is sorted by adding
numeric codes of its three letters. For example, AFT has
a score of 1+6+20 =27.You are to select five of the
given eight words that yield the maximum total score.
Simultaneously, the selected five words must satisfy the
following conditions :
Sum of letter 1 scores < Sum of letter 2 scores < Sum
of Letter 3 scores

Formulate the Problem as an ILP and find the optimum


solution.

Problem 8

Solve Problem 7 given that, in addition to the total sum


being the largest, the sum of column 1 and column 2
will be the largest as well.

8
10/1/2013

Problem 10

The Record-a-Song company has contracted with a


rising star to record eight songs. The duration of the
different songs are 8, 3, 5, 5, 9, 6, 7 and 12 minutes,
respectively. Record-a-Song uses a two-sided cassette
tape for the recording . Each side has a capacity of 30
minutes. The company would like to distribute the
songs between the two sides such that the length of
the songs on each side is about the same. Formulate
the problem as an ILP.

Problem 11

In Problem 10 suppose that the nature of the melodies


dictates that songs 3 and 4 cannot be recorded on the
same side. Formulate the problem as an ILP.
Would it be possible to use a 25-minutes tape (each
side) to record the eight songs?
If not use ILP to determine the minimum tape capacity
needed to make the recording.

9
10/1/2013

Example 9-1-1 (Installing security telephones)


To promote on-campus safety, the security department is in process of installing
emergency telephones at selected locations. The department wants to install the
minimum number of telephones, provided that each of the main street of the camp
is served by at least one telephone. The following figure maps the principal streets
to K) on the campus.
Its logical to place the telephones at street intersections so that each telephone
serve at least two streets.
Give the ILP that minimize the number of telephones to install.

1 2 3
Street A Street B

Street K
Street I
Street G

4 Street C 5
Street H

Street J
Street E Street D
6 8
7

Problem Set 9.1B


Problem 1

ABC is an ILT trucking company that delivers loads to five customers . The following
list provides the customers associated with each route :
Route Customersservedontheroute
1 1,2,3,4
2 4,3,5
3 1,2,5
4 2,3,5
5 1,4,2
6 1,3,5

The following matrix lists distances among the truck terminal and the
customers

10
10/1/2013

ABC 1 2 3 4 5
ABC 0 10 12 16 9 8
1 10 0 32 8 17 10
2 12 32 0 14 21 20
3 16 8 14 0 15 18
4 9 17 21 15 0 11
5 8 10 20 18 11 0

The objective is to determine the least distance needed to make the daily deliveries to
all five customers

Challenge of Combinatorial
Problems
Example: Travelling Salesman Problem TSP
Consider a traveling salesman who leaves a
depot and return after delivering his product
to a finite number of sales points.The distance
between these points is known. His problem is to
find the shortest route through all the sales
points.

11
10/1/2013

X1 + x2 - My<= 5
2x1 + 5 x2 M(1-y)<= 7

Y = 0 or 1

Travelling Salesman Problem


1
2
0 1 2 3 4
0 - 5 9 12 2
1 5 - 4 1 3
2 9 4 - 2 -
0 3
3 12 1 2 - 3
4 2 3 - 3 -
4

Node 0 represents the depot


Matrix of distances (km)

Nodes 1, 2, 3 and 4 represent


the sales points

12
10/1/2013

Travelling Salesman Problem


Each sequence that begins with the depot, ends with the depot
and includes all the sales points is a solution.

How many solutions exist? 4! = 432=24


All the solutions are feasible? NO
2 3 4 2 12 Feasible solution
0 4 1 2 3 0
Distance = 23

0 4 2 3 1 0 Unfeasible solution
Impossible to go
from 4 to 2

Travelling Salesman Problem


Heuristic
A heuristic Solution is a feasible solution based on an intelligent intuition . But without
proof of the optimality
Example
Let s move always to the nearest sales point This is just an intuition

2 3 1 2 9
0 4 1 3 2 0 Distance = 17

We have a nice solution .But we dont have a


proof that its the optimal (best).

13
10/1/2013

How to find the optimal


Solution?
I will enumerate all the
solutions and choose the
best one.

1 2 3 4

2 3 4 1 3 4 1 2 4 1 2 3

3 4 2 4 2 3 3 4 1 4 1 3 2 4 1 4 1 2 2 3 1 3 1 2

4 3 4 2 3 2 4 3 4 1 3 1 4 2 4 1 2 1 3 2 3 1 2 1

15 22 19 31 17 22 23 31 23 17 19 15

14
10/1/2013

The manual computation of each sequence takes at least 1 minute

We have 24 sequences. So we need 24 minutes.

Suppose that the salesman has only one supplementary sales point

The number of solutions will be 5! = 5432


= 5 4!
= 124 minutes 2 hours
We have added only one sales point. But the computation time is
multiplied by 5.

The number of sequences explodes according to the number of sales points

If the number of sales points is 10 then the computation time = 10! minutes
= 3749760 minutes
= 62492 hours
= 2604 days 7 years

How can I be faster to find the


optimal Solution?

I will use a computer

15
10/1/2013

A strong computer can take just 0.000001 second to check the feasibility of a
sequence or to compute its distance.

We have 10 nodes. So we have 10! sequences. The computation time of the computer is
= 10! 0.000001 = 3749760 0.000001 = 3.7 seconds.

If the number of sales points is 20 then the computation time of the computer
= 20!x0.000001 seconds
= 2432902008176640000 x0.000001 seconds
= 2432902008177 seconds
= 675806113 hours
= 28158588 days
78218 years

16
10/1/2013

I will use an The computer isnt


intelligent enough to solve even
enumeration medium seize instances

1 5 0-1-2-3-4-0 is a feasible solution with


distance 16

9
2
The optimal solution will be equal or
11 less then 16
3

16
4 The value of any feasible solution is
an Upper Bound of the value of the
optimal solution in case of
minimization problems

17
10/1/2013

Upper Bound = 16
UB = 16
0

1 5

9 This Branch of the tree search will lead always to


2 an unfeasible solution because there is no direct
path between sales point 2 and sales point 4
11
3 4 For that reason we dont explore it and we
fathom it

16
4

Upper Bound = 16
UB = 16
0

1 5

9 6
2 3

11 8 9
3 4 2 4

16
4 4 2

18
10/1/2013

Upper Bound = 16
UB = 16
0

1 5

8
2 9 36 4

11 8 9 11
3 4 2 4 2 3

16 22
4 4 2 2

This is a second feasible solution

Upper Bound = 16
UB = 16
0

1 5

8
2 9 36 4

11 8 9 11
3 4 2 4 2 3

16 22
4 4 2 2

This is a second feasible solution

19
10/1/2013

Upper Bound = 16
UB = 16
0

9
1 5 2

8
2 9 36 4 1 13

11 8 11
9 14
3 4 2 4 2 3 3

22 19
16
4 4 2 2 4

Upper Bound = 16
UB = 16
0
If we take the route 0-2-1-4 we will
travel at least 16 km
9
1 5 2

If we continue in this route we will


8 travel more than 16 km
2 9 36 4 1 13

11 8 11 14 16 So this route will never lead to a solution


9
3 4 2 4 2 3 3 4 better than the best existing solution which
is 0-1-2-3-4-0 with 16 km as a distance
22 19
16
4 4 2 2 4
Its better to fathom this branch

16 is the Lower Bound (LB ) of the read node


In minimization problem we are allowed to fathom any node if its LB is
greater or equal to UB

20
10/1/2013

Upper Bound = 16
UB = 16
0

9
1 5 2

11
8
2 9 36 4 1 13 3 4

11 8 11 14 16 12 14
9
3 4 2 4 2 3 3 4 1 4

22 19 17 22
15
4 4 2 2 4 4 1

Upper Bound = 16
UB = 16
0

9 12
1 5 2 3

11
9 6 8 13 14 15
2 3 4 1 13 3 4 1 2 4

11 8 11 14 16 12 14 17 16 18 18
9
3 4 2 4 2 3 3 4 1 4 2 4 1 4 1 2

22 19 17 22
16
4 4 2 2 4 4 1

21
10/1/2013

Upper Bound = 16
UB = 16
0

9 12
1 5 2 3 4 2

11
9 6 8 13 14 15 5 5
2 3 4 1 13 3 4 1 2 4 1 2 3

11 8 11 14 16 12 14 17 16 18 18 6
9 9 6 7
3 4 2 4 2 3 3 4 1 4 2 4 1 4 1 2 2 3 1 2

22 19 17 22 23
16 17 19 16
4 4 2 2 4 4 1 3 2 2 1

The Shortest route is 16 km

What we have done in the previews intelligent


enumeration is a:

22
10/1/2013

Objective of Integer Linear


Programming

Objective of Integer Linear Programming is modeling


combinatorial problems as integer programs and solve
theme with specific methods as :
Branch and Bound.
Branch and Price.
Branch and Cut.
Cutting plan methods.
Decomposition methods.

When you study ILP, you need to


concentrate on three areas :

Applications

Theory

Computation

23
10/1/2013

Applications
Cutting and Packing Problems.
Network Design and Transportations Problems.
Scheduling and Time Tabling Problems.
Location, Assignment and Supply chain
Problems.
Various applications in real life problems.

Network Design Problems


Shortest path Problem

Consider the graph G (V, E) where V is the set of nodes and E is the set of arcs.
Each arc e E has a distance ce . Formulate the shortest path problem from
node s to node t as a linear program.

2
1

s (9,3)
t
3

5
4

(e, ce ) = ( number of the arc, cost of the arc)

24
10/1/2013

1 if arc e is considerd in the path


x e

0 otherwise

Objective function

Min c x
e E
e e

Constraints

x1 x 4 1
x1 x 2 x 7 0
x2 x3 0
x 7 x 8 x 9 x10 0
x 4 x5 x8 0
x 5 x10 x 6 0
x3 x6 x9 1
x e 0 ,1 e E

let (i ) set of arcs leaving node i


let (i ) set of arcs insident to node i

the formulation is

Min ce xe
eE

S .T
x e
1
e ( s )

x x e e
0 i V /s, t
e ( i ) e ( i )

x e
1
e ( t )

xe 0,1 e E

25
10/1/2013

Min cost flow

Consider the graph G (V, E) where V is the set of nodes and E is the set of arcs.
Each arc e E has a capacity ce and a unit cost of flow e . We need to send a
quantity of flow d=6 from node s to t with minimum total cost. Formulate the
problem as a linear program

2
1

s (9,3,4)
t
3

5
4

(e, ce, e ) = ( number of the arc, capacity of the arc, unit cost of flow
on the arc )

x e
the total amount of flow that passes on arc e

Objective function

Min x
e E
e e

Constraints
x1 x 4 6
x1 x 2 x 7 0
x2 x3 0
x 7 x 8 x 9 x10 0
x 4 x5 x8 0
x 5 x10 x 6 0
x3 x6 x9 6
xe ce e E
xe 0 e E

26
10/1/2013

let (i ) set of arcs leaving node i


let (i ) set of arcs going to node i

the formulatio n is

Min x
eE
e e

S .T
x e
d
e ( s )

x e
x e
0 i V / s , t
e ( i ) e ( i )

x e
d
e ( t )

xe ce e E
xe 0 e E

Min cost flow with fixed charge

Consider the graph G (V, E) where V is the set of nodes and E is the set of arcs.
Each arc e E has a capacity ce ,a unit cost of flow e and a fixed cost fe of
installing the arc e. We need to send a quantity of flow d=6 from node s to t
with minimum total cost. Formulate the problem as a linear program

2
1

s (9,3,4,10)
t
3

5
4

(e, ce, e , fe ) = ( number of the arc, capacity of the arc, unit cost of flow on the arc,
fixed cost of installing the arc )

27
10/1/2013

x e
the total amount of flow that passes on arc e

1 if arc e is used
y
e
0 otherwise
Objective function
Min x
e E
e e
f y
e E
e e

Constraints
x1 x 4 6
x1 x 2 x 7 0
x 2 x3 0
x 7 x 8 x 9 x10 0
x 4 x5 x8 0
x 5 x10 x 6 0
x3 x6 x9 6
xe ce ye e E
xe 0 e E
y e 0 ,1 e E

let (i ) set of arcs leaving node i


let (i ) set of arcs going to node i

the formulatio n is

Min e x e f y
e e
e E e E

S .T
x e
d
e ( s )

x e
x e
0 i V / s , t
e ( i ) e ( i )

x e
d
e ( t )

xe ce y e e E
xe 0 e E
y e 0,1 e E

28
10/1/2013

Job-Sequencing Model
Example 9.1-4
Jobco uses a single machine to process three jobs. (Both the processing time and the due
date (in days) for each job are given in the following tables. The due dates are measured
from zero, the assumed start time of the first job.

proceesing Duedate Late


job(j) time(pj) (dj) penality(lj)

1 5 25 19

2 20 22 12

3 15 35 34

The objective of the problem is to determine the minimum late penalty sequence
for processing the three jobs

Example 9.1.D

Jobco Shop has 7 jobs to be processed on a single machine. (Both the processing
time and the due date (in days) for each job are given in the following tables).

proceesing Duedate
job(j) time(pj) (dj)
1 10 40
2 3 20
3 13 30
4 15 30
5 9 45
6 5 15
7 8 10

If job 4 precedes job 3 then job 2 must precede job 6. The


objective is to minimize the total late.

29
10/1/2013

Integer Programming
Algorithms

B&B and Cutting Plane Methods


The two commonly used methods are:

1. Branch and bound method

2. Cutting Plane Method

Neither method is consistently effective;


but B&B is far more successful.

30
10/1/2013

Branch-and-Bound (B&B)
Developed in 1960 by A Land and G Doig

Relax the integer restrictions in the


problem and solve it as a regular LP. Lets
call this LP1.

Test if integer requirements are met. Else


branch to get sub-problems LP2 and LP3.

Best integer =24

Branch: >24.2 (max)

31
10/1/2013

Branching
If LP1 (in general LPi) fails to yield integer solution,
branch on any variable that fails to meet this
requirement.
Note: In mixed integer problems, a continuous variable is
never selected for branching.

Bounding / Fathoming
Select LP1 (in general LPi) and solve. Three
conditions arise.

Infeasible solution, declare fathomed (no further


investigation of LPi).

Integer solution. If it is better than the current best


solution update the current best. Declare fathomed.

Non-integer solution. If it is worse than the current


best, declare fathomed. Else branch again.

32
10/1/2013

Best Bound
In maximisation, the solution to a sub-problem
is superior if its integer and raises the current
lower bound.

In minimisation, the solution to a sub-problem is


superior if its integer and lowers the current
upper bound.

When all sub-problems have been fathomed,


stop. The current bound is the best bound.

Branch and Bound Example


Maximise z=5 x1+ 4x2
Subject to:
x1 + x2 5
10x1 + 6x245
x1, x2 0 and integer

33
10/1/2013

Remove the
Relax ILP integrality Get LP1
constraint

Maximise z=5 x1+ 4x2


Subject to:
x1 + x2 5
LP1
10x1 + 6x245
x 1, x 2 0

34
10/1/2013

Branch on x1

LP3 LP2

Maximise z=5 x1+ Maximise z=5 x1+


4x2 4x2
Subject to: Subject to:
x 1 + x2 5 x 1 + x2 5
10x1 + 6x245 10x1 + 6x245
x1 3 x1 4
x 1, x 2 0 x 1, x 2 0

35
10/1/2013

Branch on x2

LP4 LP5

Maximise z=5 x1+ 4x2 Maximise z=5 x1+ 4x2


Subject to: Subject to:
x1 + x2 5 x1 + x2 5
10x1 + 6x245 10x1 + 6x245
x1 4 x1 4
x2 0 x2 1
x 1, x 2 0 x 1, x 2 0

36
10/1/2013

Home Work
Solve Problems (9.1C.1, 9.1C.2).
Solve Problems (9.1D.4, 9.1D.9).
Solve Problems (9.2A.2).

37
10/1/2013

1 2 3
Street A Street B

Street K
Street I
Street G

4 Street C 5

Street H

Street J
Street E Street D
6 8
7

38

Вам также может понравиться