Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI 573 Linear and Mixed Integer Programming Sven Koenig.

Similar presentations


Presentation on theme: "CSCI 573 Linear and Mixed Integer Programming Sven Koenig."— Presentation transcript:

1 CSCI 573 Linear and Mixed Integer Programming Sven Koenig

2 Linear Programming (LP) A cement manufacturer produces two types of cement: A and B. They cannot make more than 1600 kilograms a day due to a shortage of transport vehicles. A sales contract forces them to produce at least 500 kilograms of cement B per day. It takes 0.48 (0.24) minutes to make a kilogram of cement A (B) and the plant operates 8 hours a day. The profit is $4 ($3) per kilogram of cement A (B). How many kilograms of cement A and B should they make to maximize their profit?

3 Linear Programming (LP) A = produced kg’s of cement A per day B = produced kg’s of cement B per day Maximize 4 A + 3 B Subject to A + B ≤ 1600 A + B ≤ 1600 B ≥ 500 B ≥ A B ≤ A B ≤ 480 A ≥ 0, B ≥ 0 A ≥ 0, B ≥ 0

4 Almost Linear Programming (LP) A cement manufacturer produces two types of cement: A and B. They cannot make more than 1600 bags a day due to a shortage of transport vehicles. A sales contract forces them to produce at least 500 bags of cement B per day. It takes 0.48 (0.24) minutes to make a bag of cement A (B) and the plant operates 8 hours a day. The profit is $4 ($3) per bag of cement A (B). How many bags of cement A and B should they make to maximize their profit?

5 Appendix Linear Programming (LP) A manufacturer produces animal feed with 2 active ingredients and a filler ingredient. One kg of feed mix must contain 90g of nutrient A, 50g of nutrient B, 20g of nutrient C and 2g of nutrient D. The ingredients have the following nutrient values and costs. What should be the amount of ingredients in one kg of feed mix to minimize cost? (The filler ingredient costs nothing.) ABCD$/kg Active Ingredient 1 (g/kg) Active Ingredient 2 (g/kg)

6 Appendix Linear Programming (LP) A = kg of ingredient 1 per kg of feed mix B = kg of ingredient 2 per kg of feed mix Minimize 40 A + 60 B Subject to A + B ≤ 1 A + B ≤ A B ≥ A B ≥ A B ≥ A B ≥ A + 20 B ≥ A + 20 B ≥ A ≥ 2 10 A ≥ 2 A ≥ 0, B ≥ 0 A ≥ 0, B ≥ 0

7 Appendix Linear Programming (LP) Exact solution: A = B = Feasible region (all of these points satisfy the constraints) Solution (a point in the feasible region that minimizes the objective function)

8 Appendix Linear Programming (LP) LPs can be solved in polynomial time. In practice, one often uses variants of the simplex method (which is not guaranteed to run in polynomial time but often runs very fast).

9 Appendix Mixed Integer Programming (MIP) What if there is a fixed cost of $15 if any of active ingredient 2 is used?

10 Appendix Mixed Integer Programming (MIP) A = kg of ingredient 1 per kg of feed mix B = kg of ingredient 2 per kg of feed mix X = 1 if B > 0, 0 otherwise Minimize 40 A + 60 B + 15 X Subject to A + B ≤ 1 A + B ≤ A B ≥ A B ≥ A B ≥ 5 80 A B ≥ 5 40 A + 20 B ≥ A + 20 B ≥ A ≥ 2 10 A ≥ 2 B ≤ X B ≤ X A ≥ 0, B ≥ 0, X ≥ 0 A ≥ 0, B ≥ 0, X ≥ 0 X is integer X is integer

11 Appendix Mixed Integer Programming (MIP) What if they need to satisfy only three of the four nutrient constraints?

12 Appendix Mixed Integer Programming (MIP) A = kg of ingredient 1 per kg of feed mix B = kg of ingredient 2 per kg of feed mix X1 = 1 if constraint 1 is satisfied, 0 otherwise X2 = … Minimize 40 A + 60 B + 15 X Subject to A + B ≤ 1 A + B ≤ A B ≥ 90 X1 100 A B ≥ 90 X1 80 A B ≥ 5 X2 80 A B ≥ 5 X2 40 A + 20 B ≥ 20 X3 40 A + 20 B ≥ 20 X3 10 A ≥ 2 X4 10 A ≥ 2 X4 X1 + X2 + X3 + X4 ≥ 3 X1 + X2 + X3 + X4 ≥ 3 A ≥ 0, B ≥ 0, 1 ≥ X1 ≥ 0, 1 ≥ X2 ≥ 0, 1 ≥ X3 ≥ 0, 1 ≥ X4 ≥ 0 A ≥ 0, B ≥ 0, 1 ≥ X1 ≥ 0, 1 ≥ X2 ≥ 0, 1 ≥ X3 ≥ 0, 1 ≥ X4 ≥ 0 X1, X2, X3 and X4 are integer X1, X2, X3 and X4 are integer

13 Appendix Mixed Integer Programming (MIP) MIPs can likely not be solved in polynomial time (solving them is NP-hard). Viewing MIPs as LPs and rounding variables to the closest integer can result in large errors. In practice, one often uses CPLEX, industrial-strength software that can solve LPs and MIPs.

14 Appendix Source for LP and MIP Material This problem and many more examples can be found in the OR Notes by J. E. Beasly at people.brunel.ac.uk/~mastjjb/jeb/or/contents.html

15 An AI Problem Assume that there are N robots in the plane at initial locations R1, …, RN. There are M target locations T1, …, TM in the same plane. Each target has to be visited by at least one robot. The robots do not need to return to their initial locations. Write a mixed integer program that determines which robot should visit which target locations and in which order if the team objective is to minimize the sum of the travel distances of all robots.

16 An AI Problem Multi-robot routing problems can be solved optimally with Mixed Integer Programming (MIP) methods, such as CPLEX: Index sets and constants: V R = Set of robot vertices V T = Set of target vertices c(i,j) = Path cost from vertex i to vertex j Variables: x ij = Is vertex j visited by some robot directly after vertex i? (1 = yes, 0 = no)

17 An AI Problem Multi-robot routing problems can be solved optimally with Mixed Integer Programming (MIP) methods, such as CPLEX: (C1) (C2) (C3)

18 An AI Problem Multi-robot routing problems can be solved optimally with Mixed Integer Programming (MIP) methods, such as CPLEX: (C1) Each target vertex is entered exactly once (C2) Each (robot or target) vertex is left at most once (C3) There are no subtours (= cycles)

19 An AI Problem Objective only

20 An AI Problem Objective and constraint C1 only (a possible solution, not necessarily the optimal one)

21 An AI Problem Objective and constraints C1 and C2 only (a possible solution, not necessarily the optimal one)

22 An AI Problem Objective and constraints C1, C2 and C3 (a possible solution, not necessarily the optimal one)

23 An AI Problem The number of subtour elimination constraints (C3) is exponential in the number of targets. Only small multi-robot routing problems can be solved optimally with MIP methods, even after tuning them (for example, by using cutting plane techniques).

24 An AI Problem See page 5 of “Simple Auctions with Performance Guarantees for Multi-Robot Task Allocation” by Lagoudakis et al. (IROS 2004) idm-lab.org/bib/abstracts/Koen04i.html


Download ppt "CSCI 573 Linear and Mixed Integer Programming Sven Koenig."

Similar presentations


Ads by Google