Integer Programming: Decision Variables Take Integer Values
Integer Programming: Decision Variables Take Integer Values
X2
Area of Feasibility 5 4 3 2 1
Point at Intersection are feasible points as they are integers Acceptable values For X1, X2 are (1,1), (2,1), (1,2), (2,2) ..
X1
X2
Minimization Problem 10 A 8
Objective Function 4 3 2
B
C 2 4 6 8 X2 >= 1 10 X1
Another Example
Maximize Z = 40000X1 + 30000X2 Subject to: 10X1 + 3X2 <= 30 600X1 + 1000X2 <= 3600 500X1 + 200X2 <= 1800 X1,X2 >= 0 and integers Integer : X1 = 2, X2 = 2, Z = 140000 LP : X1 = 2.561, X2 = 1.4634, Z = 146341.46 Simply cannot round LP solutions to get Integers
Either Or Alternatives
A manufacturer may need a machine to replace one that recently has failed. Two alternatives X1 and X2 are being considered, but only one will be needed. Constraint : X1 + X2 = 1 If neither machine will be acquired then constraint is X1 + X2 <= 0 X1 and X2 are 0 or 1 variables
K out of N Alternatives
A decision maker (DM) must choose a specified number of alternatives. Say choose 2 machines from a list of 5 alternatives. X1 + X2 + X3 + X4 + X5 = 2 (exactly 2) X1 + X2 + X3 + X4 + X5 >= 2 (atleast 2) X1 + X2 + X3 + X4 + X5 <= 2 (atmost 2) Choosing anywhere 2 to 4 X1 + X2 + X3 + X4 + X5 >= 2 (lower bound) X1 + X2 + X3 + X4 + X5 <= 4 (upper bound)
If Then Alternatives
DM has to take some action which necessitates another action that supports the initial decision Purchase of X2 machine may necessitate purchase of another X1 machine Purchase X2 (X2=1) will lead to purchase of X1 (X1=1). If X2 is not purchased, (X2=0) will lead to X1 not being purchased (X1=0) X1 >= X2 or X1 X2 >= 0 (Reverse is not true Purchase of X1 does not lead to purchase of X2) If purchase of either machine requires the purchase of the other then X1 X2 = 0
Either Or Constraints
Situations may arise in which a constraint will apply only if a particular alternative is chosen A certain machine may necessitate special power requirements. Hence it can be able to turn-on or turn-off a constraint. A machine X3 requires the constraint 5X1 + 3X2 >= 100. Formulate as 5X1 + 3X2 >= 100X3, X3 is 0-1 variable 5X1 + 3X2 100X3 >= 0 If X3 is not chosen, constraint 5X1 + 3X2 >= 50 is required. Formulate as : 5X1 + 3X2 >= 100X3 (if X3 is chosen) 5X1 + 3X2 >= 50(1-X3) (if X3 is not chosen)
Process 1
Process 2
Neighbourhood
1
1 2 3 4 5 6 7 Y
Node
Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y
1 0 Y Y
KnapSack Problem
The Knapsack problem is defined as how many units of different kinds of items or products to put in a knapsack with a given capacity in order to maximize profit. Maximize Z = C1X1 + C2X2 + . + CnXn Subject to : A1X1 + A2X2 + .. + AnXn <= B X1, X2,.. Xn >= 0 and integer
Knapsack Example
TriState must purchase three possible major food items : poultry, ice-cream, yoghurt in batches to realize quantity discounts for filling up vacant 5 tons capacity in its super freezer. One batch of ice-cream weighs 2 tons and profit per batch is $90. One batch of poultry weights 3 tons and profit per batch is $150, while one batch of yoghurt weighs 1 ton and profit per batch is $30. Let X1,X2,X3 = batch of ice-cream, poultry, yoghurt Maximize Z = 90X1 + 150X2 + 30X3 Subject to : 2X1 + 3X2 + X3 <= 5 tons X1, X2, X3 >= 0 and integer Optimal Solution : X1 = 1, X2 = 1, Max Profit = $240
B I (New) J (New)
5 9 6
12 2 5 2.5 5 23000
11 3.5 3 4 3 30000
K (New) 8 L (New)
Demand
6.5 27000
Total Demand = 112000, while Existing Capacity = 56000. New Capacity to be added should be 56000 or more
27000
3000 30000
3000
23000
26000 37000
27000
32000
23000
30000
112000
Total Demand = 112000, while Existing Capacity = 56000. New Capacity to be added should be 56000 and added with plant I and K The cost of building or Purchasing plant I and K is 220000 + 200000 = $420000 The total Minimum Cost is $ 886500. Shipping Cost = $466500
From/ To 1
2 3 4
1
0 8 6 5
2
8 0 3 7
3
6 3 0 9
4
5 7 9 0
Start
Leg 1
Leg 2
Leg 3
Leg 4
1
1 1 1 1 1
2
2 3 3 4 4
3
4 2 4 3 2
4
3 4 2 2 3
1
1 1 1 1 1
DV 5
DV 6
X432 X433
X322 X323
Constraints
For every leg of journey (1, 2, 3,and 4), no of journeys = 1 No of Visits from Node 2, 3 and 4 = 1 No of Visits to Node 2, 3 and 4 = 1 Leg 2 starts where Leg 1 ends for Node 2, 3 and 4 Leg 3 starts where leg 2 ends for Nodes 2, 3 and 4 Leg 4 starts where leg 3 ends for Nodes 2, 3 and 4
Problem Formulation
Minimize Z1 = 8X121 + 6X131 + 5X141 Minimize Z2 = 3X232 + 7X242 + 9X342 + 7X422 + 9X432 + 3X322 Minimize Z3 = 3X233 + 7X243 + 9X343 + 7X423 + 9X433 + 3X323 Minimize Z4 = 8X214 + 6X314 + 5X414 Minimize Z = Z1 + Z2 + Z3 + Z4 Subject to : X121 + X131 + X141 = 1 (Starting node is 1 or Leg 1 visits limited to 1) X214 + X314 + X414 = 1 (Ending Node is 1 or Leg 4 visits limited to 1) X232 + X242 + X342 + X422 + X322 + X432 = 1 (leg 2 visits limited to 1) X233 + X243 + X343 + X423 + X323 + X433 = 1 (leg 3 visits limited to 1) X214 + X232 + X242 + X233 + X243 = 1 (visits from node 2 are limited to 1) X314 + X322 + X323 + X342 + X343 = 1 (visits from node 3 are limited to 1) X414 + X422 + X432 + X423 + X433 = 1 (visits from node 4 are limited to 1) X121 + X322 + X422 + X323 + X423 = 1 (visits to node 2 are limited to 1) X131 + X232 + X233 + X432 + X433 = 1 (visits to node 3 are limited to 1) X141 + X242 + X243 + X342 + X343 = 1 (visits to node 4 are limited to 1) X121 = X232 + X242 (leg 1 ends where leg 2 starts) X131 = X322 + X342 (leg 1 ends where leg 2 starts) X141 = X422 + X432 (leg 1 ends where leg 2 starts) If leg 2 of trip ends at location 2,3 or 4, leg 3 of trip must start at node 2, 3 or 4 X322 + X422 = X233 + X243 (Node 2) X232 + X432 = X323 + X343 (Node 3) X242 + X342 = X423 + X433 (Node 4) X323 + X423 = X214 (last leg of trip must end at location 1) X233 + X433 = X314 ( --- do ---) X243 + X343 = X414 (---- do ---) Xijk = 0 or 1 for all I,j,k
Optimal Solution
Travel Time (in minutes) between locations
From/ To 1
2 3 4
1
0 8 6 5
2
8 0 3 7
3
6 3 0 9
4
5 7 9 0