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

INTEGER

PROGRAMMING
Saurabh Chandra

Limitations of LP
Variables are continuous.
Cannot handle Discrete/ Integer variables.

Many real world problems require integer values


No. of plants of open
No. of truckloads to ship

Fractional values are meaningless


Easiest approach : round off to nearest integer
Is it viable? Are there any dangers?
1. Solution may be sub-optimal
2. Solution may be infeasible.

Dangers are particularly serious with many integer variables. Why?


Are there situations where rounding may be a reasonable option?

Yes, when variable values are large. Why?


Contrast rounding x=25.5 against x=1.5.
What is the impact on constraint feasibility and objective function?
2% vs. 33%

Zero One Programming

A special class of integer programs


Each variable can take only two possible values: 0 or 1
Binary variables Binary Integer Program.
What does such a variable represent?
Yes/No decisions x=1 (yes), x=0 (no)
Whether to locate a plant in Sambalpur or not
Whether to invest in a particular stock or not

Is rounding a reasonable approach here?


It will lead to gross errors, producing a meaningless solution.

LP vs. IP
Maximize cjxj
aijxj bi

i = 1,2,... m

xj 0

j = 1,2,....n

(LP)

Maximize cjxj
aijxj bi

i = 1,2,... m

(IP)

xj 0 and integer j = 1,2,....n

IP is much harder to solve than LP! Why?


No efficient general purpose algorithm.
Sounds a bit paradoxical! Why?

What is the number of feasible solutions in an LP? In an IP?


Why are we able to solve the LP efficiently despite an infinite
number of feasible solutions?
Optimal solution must occur at a corner point in an LP.
What about IP?

Formulation of Integer Programs


Can be tricky due to binary variables:
they represent yes/no rather than quantity.
Logical implications.

Identify/define variables carefully.


Write constraints so that they are linear constraints
at least one of x1 and x2 must be zero.

x1.x2 = 0

x1 + x2 <= 1

Is it linear?

Requires practice to formulate integer programs correctly and efficiently.

Applications of Integer Programming


Plant Location Problem
where to locate the plants so as to minimize transportation and
production costs?

Vehicle Routing Problem


How to dispatch vehicles to make a given set of deliveries.

Airline Crew Scheduling


Which crew to be assigned to which flights so that all flights
are covered with least number of crews.

Capital Budgeting
Which projects to invest in so as to maximize total return.

Cell-phone network design


How to assign frequencies to cells in a cellular network.

Problem 1 Responsibility Assignment


Variables
xij = 1 if civil servant i is assigned to project j
cij effectiveness of assigning person i to project j
Objective Function: (Maximize Total Effectiveness)
Maximize i jcijxij
Each person must be assigned to exactly one project
jxij = 1 i
Each project must have at least one person assigned to it
ixij 1 j
At least two persons must be assigned to project 2
ixi2 2
Not more than two persons can be assigned to project 3
ixi3 2
Persons 4 and 5 should be assigned to same project
x4j = x5j j
xij = 0,1

Problem 2 Project selection


xi = 1 if project i is selected, 0 otherwise
ri = return from project i
Maximize rixi
Budget constraint for year 1
150x1+80x2+220x3+110x4 500
Budget constraint for year 2
50x1+100x2+300x3+60x4+100x5 650
Project 5 cannot be undertaken unless project 4 is undertaken
x5 x4
Projects 1 and 2 cannot both be undertaken
x1+x2 1
Either Project 3 or project 4 must be undertaken
x3+x4 1
At least two project must be undertaken
xi 2
No more than three project can be undertaken
xi
xi = 0,1

Problem 6 Multi-commodity packing problem


xij qty of commodity i stored in silo j
yij 1 if commodity i is stored in silo j
cij = cost of putting a unit of commodity i in silo j
Fj = Fixed cost of using silo j
Min cijxij
Entire quantity of each type of grain should be stored.
j xij di

Cannot store more than one commodities in one silo.


xkj.xlj = 0 commodity pairs (k,l) and silo j. Non-linear.
i yij 1

Relationship between xij and yij ?


Can xij > 0 if yij is zero? How to enforce?
xij Cjyij
xij i,j
yij = 0,1 i,j

Continuous Variables
Integer Variables

Mixed Integer Program (MIP)

Part b: Fj : Fixed Cost of using Silo j

Min cijxij + Fj.yj

Problem 8.
xij electricity generated by generator i in shift j
yij = 1 if generator i is used in shift j
zi = 1 if generator i is started
Objective: Minimize Total cost: Startup Cost + Fixed Cost + Var. Cost
Minimize
Sizi + ijFiyij + ijvixij
Demand should be met in each shift
ixij Dj
j
Generation should not exceed capacity
xij Ci
xij cannot be positive unless yij is 1
xij Ciyij

ij

Generator cannot be used unless it has been started.


Can yij be 1 if zi is zero?
yij zi
xij 0
yij = 0,1
zi = 0,1

ij

Relationship between LP and IP


Assuming that we are solving a Minimization problem, let
Z*LP = Value of LP optimal solution
Z*IP = Value of IP optimal solution
What is the relationship between these?
Z*LP Z*IP
Why?
What about Maximization problem?
A solution feasible to IP is also feasible to LP.
Is the converse always true? NO.
IP solution set is a subset of LP solution set
LP solution provides a Lower Bound for IP problem (Min Prob.)
Upper Bound
(Max Prob.)

Enumeration Approach
Since there are a finite number of IP solutions,
List all possible solution
Determine cost of each one
Pick the least costly as the optimum solution.

Is it a practical approach?
Consider 10 binary variables:
No. of possible solutions: 210 = 1024

With 20 variables 220 = 1,048,576


With the addition of each new variables, the number of solutions
gets doubled. (Combinatorial explosion)
Brute Force approach not practical for larger problems.
We need a better idea.

Branch and Bound Algorithm


Solve problem as an LP.
If the solution is integral, it is optimum. Why?
If not integral, pick a variable at fractional value, e.g. x1 = 3.7
Divide the solution set into two subsets (Branching process)
Subset 1: All solutions with x1 3
Subset 2: All solutions with x1 4
Some part of original feasible region is not included in either set.
BUT, this part does not contain any integer solution.
For each subset, solve the LP, yielding a lower bound for each set
(Bounding Process)
These subsets will be further sub-divided into still smaller subsets.

Incumbent Solution

As the sets are sub-divided, for some of them LP solution will be integral (Why?)
Keep track of the best integer solution that you come across.
The current best known integer solution is the incumbent solution.
As and when a better integer solution is found, the incumbent is updated.
ZINC is the value of incumbent solution.

ZINC provides
a upper bound on the optimum IP solution (Minimization Problem)
a lower bound on the optimum IP solution (Maximization Problem)

ZINC Z*IP (Min Prob.)

ZINC Z*IP (Max Prob.)

Branch and Bound Tree


Solution set is progressively sub-divided into smaller sets.
How to systematically keep track of all the sub-sets.
A tree structure is useful.

Root node represents original set.


Child nodes are created to represent division into subsets.
Keep LP solution at every node
Dangling node: A node that needs to be further explored.
Fathomed Node: Need not be explored further.
x1 3
Node Selection Rule:
72.5
Which of dangling nodes to explore next.

Branch Selection Rule:


Which variable should be selected for further branching.

75.3

x1 4
68.5

Opt LP Sol. x1 = 4.6, x2 = 5.8

Subproblem 1 Sol. x1 = 4, x2 = 5.2


Subproblem 2 Sol. x1 = 5, x2 = 5.5

EXAMPLES AND SOLVER SET UP

General Integer Variables

Harrison Electric Company


Ornate lamps
Old-fashioned ceiling fans
Wiring
Assembly
Profit

Lamps
2
6
$600

Fans
3
5
$700

Hours
12
30

Harrison Electric

Decision Variables
L = number of lamps
F = number of ceiling
Integer values

Harrison Electric
Objective function
Maximize profit = $600L + $700F
subject to
2L + 3F 12 (wiring hours)
6L + 5F 30 (assembly hours)
L, F 0

Graphical Solution
6
F
5

+ = Integer Valued Point


6L + 5F 30

Rounded-off IP Solution
(L = 4, F = 2, Infeasible)

+
2

1
Nearest Feasible
Rounded-off IP Solution
(L = 4, F = 1, Profit = $3,100)
0

Optimal IP Solution
(L = 3.75, F = 1.50, Profit = $3,300)
2L + 3F 12
|

Integer Solutions
LAMPS (L)

CEILING FANS (F)

0
1
2
3
4
5
0
1
2
3
4
0
1
2
3
0
1
0

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

PROFIT ($600L + $700F)


$
0
$ 600
$1,200
$1,800
$2,400
$3,000
$ 700
$1,300
$1,900
$2,500
$3,100 Nearest feasible rounded-off solution
$1,400
$2,000
$2,600
$3,200 Optimal IP solution
$2,100
$2,700
$2,800

Solving the Problem

Solving the Problem

Solver Options

Solver Options

Binary Variables

Only two possible values (0, 1)


Selection problems
Set covering problems

Simkin and Steinberg

Oil stock portfolios


COMPANY NAME
(LOCATION)
Trans-Texas Oil (Texas)
British Petro (Foreign)
Dutch Shell (Foreign)
Houston Drilling (Texas)
Lone Star Petro (Texas)
San Dieago Oil (California)
California Petro (California)

EXPECTED
ANNUAL RETURN
(IN THOUSANDS)

COST FOR
BLOCK OF SHARES
(IN THOUSANDS)

$ 50
$ 80
$ 90
$120
$110
$ 40
$ 75

$ 480
$ 540
$ 680
$1,000
$ 700
$ 510
$ 900

Simkin and Steinberg

Decision Variables
T = 1 if Trans-Texas Oil is included in the portfolio
= 0 if Trans-Texas Oil is not included in the portfolio
Similarly
B (British Petro),
D (Dutch Shell),
H (Houston Oil),
L (Lone Star Petro),
S (San Diego Oil), and
C (California Petro)

Simkin and Steinberg


Objective function
Maximize ROI = $50T + $80B + $90D +
$120H + $110L + $40S + $75C
subject to
$480T + $540B + $680D
+ $1,000H +700L
+ $510S + $900C
$3,000 (investment limit)
T+H+L
2
(Texas cos)
B+D
1
(foreign cos)
S+C
=1
(California cos)
B
T
(Trans-Texas
and British Petro)
All variables
= 0 or 1

Binary Requirements

Binary Requirements

Sussex County

Build health care clinics

Locate at such a location that it is 30 minutes from each


location.

TO
FROM

15

20

35

35

45

40

15

35

20

35

40

40

20

50

15

50

45

30

35

20

15

35

20

20

35

35

50

35

15

40

45

40

45

20

15

35

40

40

30

20

40

35

Sussex County

Build health care clinics


COMMUNITY

COMMUNITIES WITHIN 30 MINUTES

A, B, C

A, B, D

A, C, D, G

B, C, D, F, G

E, F

D, E, F

C, D, G

Sussex County

Decision Variables
A = 1 if a clinic is located in community A
= 0 if a clinic is not located in community A
Similarly
B (community B),
C (community C),
D (community D),
E (community E),
F (community F), and
G (community G)

Sussex County
Objective function
Minimize total
number of clinics = A + B + C + D + E + F + G
subject to
A+B+C
A+B+D
A+C+D+G
B+C+D+F+G
E+F
D+E+F
C+D+G
All variables

1
1
1
1
1
1
1
= 0 or 1

(community A is covered)
(community B is covered)
(community C is covered)
(community D is covered)
(community E is covered)
(community F is covered)
(community G is covered)

Solving the Problem

Screenshot 6-4

Mixed-Integer Models

Fixed charge problem


Binary variables for fixed costs
Linear or integer variables for variable costs

Hardgrave Machine

Factory location decision


WAREHOUSE
Detroit
Houston
New York
Los Angeles

MONTHLY
DEMAND PRODUCTION
(UNITS)
PLANT
10,000
12,000
15,000
9,000
46,000

Cincinnati
Kansas City
Pittsburgh

MONTHLY
SUPPLY

COST TO
PRODUCE
ONE UNIT

15,000
6,000
14,000
35,000

$48
$50
$52

Supply needed from new plant = 46,000 35,000 = 11,000 units/month


ESTIMATED PRODUCTION COST PER UNIT AT PROPOSED PLANTS

Seattle
Birmingham

$53
$49

Hardgrave Machine

Factory location decision


TO
FROM

DETROIT

HOUSTON

NEW YORK

LOS ANGELES

Cincinnati

$25

$55

$40

$60

Kansas City

$35

$30

$50

$40

Pittsburgh

$36

$45

$26

$66

Seattle

$60

$38

$65

$27

Birmingham

$35

$30

$41

$50

Hardgrave Machine

Binary Decision Variables

YS = 1 if Seattle is selected for the new plant


= 0 otherwise
YB = 1 if Birmingham is selected for the new plant
= 0 otherwise

Regular Decision Variables

Xij = Number of units shipped from


plant i to warehouse j
where
i = C (Cincinnati), K (Kansas City), P (Pittsburgh),
S (Seattle), or B (Birmingham)
j = D (Detroit), H (Houston), N (New York), or L (Los Angeles)

Hardgrave Machine
Objective function
Minimize
total costs = $73XCD + $103XCH + $88XCN + $108XCL
+ $85XKD + $80XKH + $100XKN + $90XKL
+ $88XPD + $97XPH + $78XPN + $118XPL
+ $113XSD + $91XSH + $118XSN + $80XSL
+ $84XBD + $79XBH + $90XBN + $99XBL
+ $400,000YS + $325,000YB

Hardgrave Machine
subject to
(0) (XCD + XCH + XCN + XCL) = 15,000

(Cincinnati supply)

(0) (XKD + XKH + XKN + XKL)

= 6,000

(Kansas City supply)

(0) (XPD + XPH + XPN + XPL)

= 14,000

(Pittsburgh supply)

(0) (XSD + XSH + XSN + XSL)

= 11,000YS

(Seattle supply)

(0) (XBD + XBH + XBN + XBL)

= 11,000YB

(Birmingham supply)

XCD + XKD + XPD + XSD + XBD

10,000

(Detroit supply)

XCH + XKH + XPH + XSH + XBH

12,000

(Houston supply)

XCN + XKN + XPN + XSN + XBN

15,000

(New York supply)

XCL + XKL + XPL + XSL + XBL

9,000

YS + YB

(Los Angeles supply)


(only one site)

Solving the Problem

Solving the Problem

Goal Programming Models

Multiple objectives
Satisfy rather than optimize
Minimize underachievement of goals
Two approaches
Weighted models
Ranked models

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