LP Assignment LP

Embed Size (px)

Citation preview

  • 7/29/2019 LP Assignment LP

    1/38

    Integer Programming

    Decision Variables take Integer

    Values

  • 7/29/2019 LP Assignment LP

    2/38

    X1

    X2

    Area of Feasibility

    1

    2

    3

    4

    5

    1 2 3 4 5 6

    Point at Intersectionare feasible points

    as they

    are integers

    Acceptable valuesFor X1, X2 are

    (1,1), (2,1), (1,2), (2,2) ..

  • 7/29/2019 LP Assignment LP

    3/38

    A cost minimization example

    Minimize Cost = 0.01X1 + 0.07X2

    Subject to :

    6X1 + 2X2 >= 18 (Constraint 1) 8X1 + 10X2 >= 40 (Constraint 2)

    X2 >= 1 (Constraint 3)

    X1, X2 >= 0 (Non Negativity)

  • 7/29/2019 LP Assignment LP

    4/38

    Minimization Problem

    X2

    X1

    X2 >= 1

    Objective Function

    Optimum X1 = 2.27, X2 = 2.19

    Z = 0.10x2.27 + 0.07x2.19 = 0.38Z (Integer) = 0.10*2 + 0.07*3 = 0.41

    A

    B

    C

    4

    2

    8

    10

    2 4 6 8 10

    3

    Optimum (Integer) X1 = 2, X2 = 3

  • 7/29/2019 LP Assignment LP

    5/38

    Another Example

    Maximize Z = 40000X1 + 30000X2

    Subject to:

    10X1 + 3X2

  • 7/29/2019 LP Assignment LP

    6/38

    Types of Integer ProgrammingProblems

    Pure Integer Problems (Number of each type of plane toproduce, number of each type of house to construct, andso on..)

    Mixed Integer Problems (have some variables requiring

    integer values, and some may have continous (decimal)values, like a landscape design which requires thepercentage area to plant grass (continous variable) andnumber of trees to plant (integer variable)

    0-1 Integer Problems where variables require values as0 or 1 (binary), or Yes/No type. Examples are a bankconsidering possible locations for a branch, schedulingof jobs to machines or workers to jobs.

  • 7/29/2019 LP Assignment LP

    7/38

    Formulating Integer programmingProblems with 0-1 constraints

    Either - or Alternatives

    k out of n alternatives

    If Then Alternatives Either Or Constraints

    Variables that have minimum level

    requirements

  • 7/29/2019 LP Assignment LP

    8/38

    Either Or Alternatives

    A manufacturer may need a machine toreplace one that recently has failed. Twoalternatives X1 and X2 are being

    considered, but only one will be needed.

    Constraint : X1 + X2 = 1

    If neither machine will be acquired thenconstraint is X1 + X2

  • 7/29/2019 LP Assignment LP

    9/38

    K out of N Alternatives

    A decision maker (DM) must choose a specifiednumber of alternatives. Say choose 2 machinesfrom 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 (lower bound)

    X1 + X2 + X3 + X4 + X5

  • 7/29/2019 LP Assignment LP

    10/38

    If Then Alternatives

    DM has to take some action which necessitatesanother 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 leadto X1 not being purchased (X1=0)

    X1 >= X2 or X1 X2 >= 0 (Reverse is not truePurchase of X1 does not lead to purchase of X2)

    If purchase of either machine requires thepurchase of the other then X1 X2 = 0

  • 7/29/2019 LP Assignment LP

    11/38

    Either Or Constraints

    Situations may arise in which a constraint will applyonly if a particular alternative is chosen A certain machine may necessitate special power

    requirements. Hence it can be able to turn-on orturn-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)

  • 7/29/2019 LP Assignment LP

    12/38

    Either Or ConstraintsChoice of X3

    If X3 is ON (X3 = 1)

    5X1 + 3X2 >= 100

    Formulate as 5X1 +3X2 >= 100X3, X3 is0-1 variable 5X1 +

    3X2 100X3 >= 0 X3 is 0-1 variable

    If X3 is OFF (X3 = 0)

    5X1 + 3X2 >= 50

    Formulate 5X1 + 3X2>= 50(1-X3) (if X3 isnot chosen)

    X3 is 0-1 variable

  • 7/29/2019 LP Assignment LP

    13/38

    Variables that have Minimum LevelRequirements

    At times, a variable either will have a zerovalue or an amounts that exceeds aspecified value.

    Example is the minimum order size for apurchased part might be required by avendor. Say min qty for X1 is 200 units.

    X1 >= 200Y1 (Y1 is 0-1 variable) X1 200Y1 >= 0, X1 = integer, Y1 = 0 or 1 If X1 = 0, the constraint would force Y1 to be zero

  • 7/29/2019 LP Assignment LP

    14/38

    Specialized Integer ProgrammingProblems

    Fixed Charge problem

    Set Covering problem

    Knapsack problem Facility Location problem

    Traveling Salesperson problem

  • 7/29/2019 LP Assignment LP

    15/38

    Fixed Charge Problem

    A company makes 3 products A,B,C. Unit profit for A,B,C are $6,$10,$5respectively. The products can be manufactured using one of the twoprocesses. Demand for A is predicted to be between 50 and 100 units perweek. For product B, demand is between 150 to 200 units per week.Similarly for product C, it is predicted to be between 100 to 150 units per

    week. Process 1 has a capacity of 2000 hours per week, with product A, B, C

    taking 4 hours, 6 hours and 3 hours per unit. The setup cost for process 1 is$100 and setup time is 24 hours.

    Process 2 has a capacity of 2400 hours per week, with product A, B, Ctaking 5 hours, 7 hours and 4 hours per unit. The setup cost for process 2 is

    $80 and setup time is 18 hours.

    Determine the production schedule that will maximize the profit and alsodetermine which of the two processes will be utilized.

  • 7/29/2019 LP Assignment LP

    16/38

    Fixed Charge Problem

    Let X1, X2, X3 be units of Product A,B, C

    Let Y1, Y2 be the 0-1 variables for Process 1 and 2

    Maximize Z = 6X1 + 10X2 + 5X3 100Y1 80Y2

    Subject to

    4X1 + 6X2 + 3X3 + 24Y1

  • 7/29/2019 LP Assignment LP

    17/38

    Process 1

    Process 2

    Any one Process to beselected

    Incur Set up CostAnd

    Set up Time

  • 7/29/2019 LP Assignment LP

    18/38

    Set Covering Problem

    A telecommunication company is considering expanding its cable and internetservices operations into a new area. The area is divided into 10 neighborhoods.The company is considering 7 location nodes to reach all 10 neighborhoods

    The cost for opening the seven nodes are $125, $85, $70, $60, $90, $100 and$110.

    Seven nodes can reach the following neighborhoods :

    Node 1 : Neighborhoods 1,3,4,6,9, 10 Node 2 : Neighborhoods 2,4,6,8

    Node 3 : Neighborhoods 1,2,5

    Node 4 : Neighborhoods 3,6,7,10

    Node 5 : Neighborhoods 2,3,7,9

    Node 6 : Neighborhoods 4,5,8,10

    Node 7 : Neighborhoods 1,5,7,8,9 Determine which nodes should be opened to provide coverage to all

    neighborhoods at a minimum cost

  • 7/29/2019 LP Assignment LP

    19/38

    1 2 3 4 5 6 7 8 9 10

    1 Y Y Y Y Y Y

    2 Y Y Y Y3 Y Y Y

    4 Y Y Y

    5 Y Y Y Y6 Y Y Y Y Y

    7 Y Y Y Y Y

    Neighbourhood

    Node

  • 7/29/2019 LP Assignment LP

    20/38

    Set Coverage Problem

    Let Cjbe cost of operating or setting up node j (j = 1,2,3,7) Let Xj= 1 if node j provides service (j = 1,2,3,7) Let Xj= 0 if node j does not provide service (j = 1,2,3,7) Minimize Z = 125X1 + 85X2 + 70X3 + 60X4 + 90X5 + 100X6 + 110X7 Subject to : X1 + X3 + X7 >= 1 (coverage of neighborhood 1)

    X2 + X3 + X5 >= 1 (coverage of neighborhood 2) X1 + X4 + X5 >= 1 (coverage of neighborhood 3) X1 + X2 + X6 >= 1 (coverage of neighborhood 4) X3 + X6 + X7 >= 1 (coverage of neighborhood 5) X1 + X2 + X6 >= 1 (coverage of neighborhood 6) X4 + X5 + X7 >= 1 (coverage of neighborhood 7) X2 + X6 + X7 >= 1 (coverage of neighborhood 8)

    X1 + X5 + X7 >= 1 (coverage of neighborhood 9) X1 + X4 + X6 >= 1 (coverage of neighborhood 10) X1, X2, X3, X4, X5, X6, X7 = 0 or 1 Optimal Answer X2 = 1, X4 = 1, X7 = 1 Cost = $255

  • 7/29/2019 LP Assignment LP

    21/38

    KnapSack Problem

    The Knapsack problem is defined as howmany units of different kinds of items orproducts to put in a knapsack with a given

    capacity in order to maximize profit.

    Maximize Z = C1X1 + C2X2+ . + CnXn Subject to :

    A1X1 + A2X2+ .. + AnXn = 0 and integer

  • 7/29/2019 LP Assignment LP

    22/38

    Knapsack Example

    TriState must purchase three possible major food items : poultry,ice-cream, yoghurt in batches to realize quantity discounts for fillingup 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 = 0 and integer

    Optimal Solution : X1 = 1, X2 = 1, Max Profit = $240

  • 7/29/2019 LP Assignment LP

    23/38

    Facility Location Problem

    Here we consider many new locations andalso take capacity considerations

    0-1 mixed integer programming is utilized.

    Used for location of plants, hospitals,healthcare facilities, fast food restaurants,schools, police and fire stations.

  • 7/29/2019 LP Assignment LP

    24/38

    Facility Location Problem

    M&R Manufacturing Company is considering a major expansion. It has 2plants A & B with capacity of 26000 units and 30000 units per annumrespectively. The company sells through its retail outlets located at P, Q, Rand S with annual demands of 27000, 32000, 23000 and 30000 units perannum.

    The company is in the process of considering four new manufacturing plantlocations at I, J, K and L. The capacities and cost of purchasing or buildingthe facility is as : I 30000 units / $220000, J 33000 units / $260000, K26000 units / $ 200000, L 37000 units / $ 280000.

    The shipping costs from the existing plants and the 4 new plant locations tothe existing retail outlets is given.

    Determine the optimal shipping schedule that minimizes the total cost whichincludes the shipping cost and cost of building/purchasing, such that thetotal demand at all retail outlets is satisfied.

  • 7/29/2019 LP Assignment LP

    25/38

    Plant RO P RO Q RO R RO S Supply

    A 7 5 4.5 5.5 26000

    B 5 7 12 11 30000

    I (New) 9 6.5 2 3.5 30000

    J (New) 6 3.5 5 3 33000

    K (New) 8 6 2.5 4 26000

    L (New) 6.5 4.5 5 3 37000

    Demand 27000 32000 23000 30000

    Shipping Cost per Unit

    Total Demand = 112000, while Existing Capacity = 56000.New Capacity to be added should be 56000 or more

  • 7/29/2019 LP Assignment LP

    26/38

    Facility Location Problem

    m = number of sources of supply (m = 1,2) k = number of sources of new supply (k = 1,2,3,4) j = number of destinations (j = 1,2,3,4) Cij = Shipping cost of one unit from source i to destination j Xij = Units shipped from source I to destination j

    Pk = Purchase cost of plant k Min Z = CijXij + PkYk for all i, j and k Subject to : Xij

  • 7/29/2019 LP Assignment LP

    27/38

  • 7/29/2019 LP Assignment LP

    28/38

    Plant RO P RO Q RO R RO S Supply

    A 26000 26000

    B 27000 3000 30000

    I (New) 30000 30000

    J (New) 33000

    K (New) 3000 23000 26000

    L (New) 37000

    Demand 27000 32000 23000 30000 112000

    Shipping Schedule

    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

  • 7/29/2019 LP Assignment LP

    29/38

    Traveling Salesperson Problem

    It attempts to minimize total cost, distanceor time of departing location I andreturning to same location I in a tour,

    visiting all locations once.

    It is like the transportation problem, butrelatively complicated.

  • 7/29/2019 LP Assignment LP

    30/38

    Traveling Salesperson Example

    The City Garbage collection team wants todetermine the best route for their garbagetrucks. There are 4 sections in the city under

    consideration. The time of travel (in minutes)between the various sections of the city is given.

    If location 1 is the garage from which garbagetrucks leave and to which they return, formulate

    this problem as a traveling salesperson problem

  • 7/29/2019 LP Assignment LP

    31/38

    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

    Travel Time (in minutes) between locations

  • 7/29/2019 LP Assignment LP

    32/38

    Traveling Salesperson Example

    Let Xijk = 0 or 1 for travel from start location i toend location j in journey leg k.

    There are 4 locations : 1, 2, 3, 4 In leg 1, start from node 1 and go to node 2,

    node 3, node 4 In leg 4, come to node 1 from node 2, node 3,

    node 4. In leg 2, go from node 2 to node 3, node 4 or go

    from node 3 to node 4 or node 2 In leg 3, go from node 2 to node 3, node 4 or go

    from node 3 to node 4 or node 2

  • 7/29/2019 LP Assignment LP

    33/38

    Start Leg 1 Leg 2 Leg 3 Leg 4

    1 2 3 4 1

    1 2 4 3 1

    1 3 2 4 1

    1 3 4 2 1

    1 4 3 2 1

    1 4 2 3 1

    Various Routes when started from Node 1

  • 7/29/2019 LP Assignment LP

    34/38

    Leg DV1

    DV2

    DV3

    DV4

    DV5

    DV6

    1 X121 X131 X141

    2 X232 X242 X342 X422 X432 X322

    3 X233 X243 X343 X423 X433 X323

    4 X214 X314 X414

    Decision Variables (DV) for each leg in a 4 node problem

    Xijk = travel from start location i to end location j in journey leg k.

  • 7/29/2019 LP Assignment LP

    35/38

    Constraints

    For every leg of journey (1, 2, 3,and 4), no ofjourneys = 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

    P bl F l ti

  • 7/29/2019 LP Assignment LP

    36/38

    Problem Formulation

    Minimize Z1 = 8X121 + 6X131 + 5X141Minimize Z2 = 3X232 + 7X242 + 9X342 + 7X422 + 9X432 + 3X322Minimize Z3 = 3X233 + 7X243 + 9X343 + 7X423 + 9X433 + 3X323Minimize Z4 = 8X214 + 6X314 + 5X414

    Minimize Z = Z1 + Z2 + Z3 + Z4Subject 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 4X322 + 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

  • 7/29/2019 LP Assignment LP

    37/38

    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

    Travel Time (in minutes) between locations

    Total Time = 6 + 3 + 7 + 5 = 21Route is location 1 to 3 to 2 to 4 to 1

    Optimal Solution

  • 7/29/2019 LP Assignment LP

    38/38

    Difficulties in Solving IntegerProgramming Problems

    In Integer Programming, a finite number ofinteger points are considered which are morethan the feasible points in linear programming.

    As the number of variables (n) increase, the no

    of solutions are 2n in 0-1 programming. In pure integer programming, the number of

    solutions taking integer values are still more ascompared to 0-1 variables in 0-1 programming.

    The computational procedures for integerprogramming are not as simple as that in linearprogramming.