Integer Linear Programming
Total Page:16
File Type:pdf, Size:1020Kb
Introduction Linear Programming Integer Programming Integer Linear Programming Subhas C. Nandy ([email protected]) Advanced Computing and Microelectronics Unit Indian Statistical Institute Kolkata 700108, India. Introduction Linear Programming Integer Programming Organization 1 Introduction 2 Linear Programming 3 Integer Programming Introduction Linear Programming Integer Programming Linear Programming A technique for optimizing a linear objective function, subject to a set of linear equality and linear inequality constraints. Mathematically, maximize c1x1 + c2x2 + ::: + cnxn Subject to: a11x1 + a12x2 + ::: + a1nxn b1 ≤ a21x1 + a22x2 + ::: + a2nxn b2 : ≤ : am1x1 + am2x2 + ::: + amnxn bm ≤ xi 0 for all i = 1; 2;:::; n. ≥ Introduction Linear Programming Integer Programming Linear Programming In matrix notation, maximize C T X Subject to: AX B X ≤0 where C is a n≥ 1 vector |- cost vector, A is a m× n matrix |- coefficient matrix, B is a m × 1 vector |- requirement vector, and X is an n× 1 vector of unknowns. × He developed it during World War II as a way to plan expenditures and returns so as to reduce costs to the army and increase losses incurred by the enemy. The method was kept secret until 1947 when George B. Dantzig published the simplex method and John von Neumann developed the theory of duality as a linear optimization solution. Dantzig's original example was to find the best assignment of 70 people to 70 jobs subject to constraints. The computing power required to test all the permutations to select the best assignment is vast. However, the theory behind linear programming drastically reduces the number of feasible solutions that must be checked for optimality. Introduction Linear Programming Integer Programming History The linear programming method was first developed by Leonid Kantorovich in 1937. The method was kept secret until 1947 when George B. Dantzig published the simplex method and John von Neumann developed the theory of duality as a linear optimization solution. Dantzig's original example was to find the best assignment of 70 people to 70 jobs subject to constraints. The computing power required to test all the permutations to select the best assignment is vast. However, the theory behind linear programming drastically reduces the number of feasible solutions that must be checked for optimality. Introduction Linear Programming Integer Programming History The linear programming method was first developed by Leonid Kantorovich in 1937. He developed it during World War II as a way to plan expenditures and returns so as to reduce costs to the army and increase losses incurred by the enemy. Dantzig's original example was to find the best assignment of 70 people to 70 jobs subject to constraints. The computing power required to test all the permutations to select the best assignment is vast. However, the theory behind linear programming drastically reduces the number of feasible solutions that must be checked for optimality. Introduction Linear Programming Integer Programming History The linear programming method was first developed by Leonid Kantorovich in 1937. He developed it during World War II as a way to plan expenditures and returns so as to reduce costs to the army and increase losses incurred by the enemy. The method was kept secret until 1947 when George B. Dantzig published the simplex method and John von Neumann developed the theory of duality as a linear optimization solution. The computing power required to test all the permutations to select the best assignment is vast. However, the theory behind linear programming drastically reduces the number of feasible solutions that must be checked for optimality. Introduction Linear Programming Integer Programming History The linear programming method was first developed by Leonid Kantorovich in 1937. He developed it during World War II as a way to plan expenditures and returns so as to reduce costs to the army and increase losses incurred by the enemy. The method was kept secret until 1947 when George B. Dantzig published the simplex method and John von Neumann developed the theory of duality as a linear optimization solution. Dantzig's original example was to find the best assignment of 70 people to 70 jobs subject to constraints. However, the theory behind linear programming drastically reduces the number of feasible solutions that must be checked for optimality. Introduction Linear Programming Integer Programming History The linear programming method was first developed by Leonid Kantorovich in 1937. He developed it during World War II as a way to plan expenditures and returns so as to reduce costs to the army and increase losses incurred by the enemy. The method was kept secret until 1947 when George B. Dantzig published the simplex method and John von Neumann developed the theory of duality as a linear optimization solution. Dantzig's original example was to find the best assignment of 70 people to 70 jobs subject to constraints. The computing power required to test all the permutations to select the best assignment is vast. Introduction Linear Programming Integer Programming History The linear programming method was first developed by Leonid Kantorovich in 1937. He developed it during World War II as a way to plan expenditures and returns so as to reduce costs to the army and increase losses incurred by the enemy. The method was kept secret until 1947 when George B. Dantzig published the simplex method and John von Neumann developed the theory of duality as a linear optimization solution. Dantzig's original example was to find the best assignment of 70 people to 70 jobs subject to constraints. The computing power required to test all the permutations to select the best assignment is vast. However, the theory behind linear programming drastically reduces the number of feasible solutions that must be checked for optimality. Introduction Linear Programming Integer Programming History Linear-programming problem was first shown to be solvable in polynomial time by Leonid Khachiyan in 1979. Major breakthrough - Narendra Karmarkar's method for solving LP (1984) using interior point method. Introduction Linear Programming Integer Programming An Example A farmer has a piece of farm land of area α square kilometers. Wanted to plant wheat and barley. The farmer has β unit of fertilizer and γ unit of pesticides in hand. (f1; p1): The amount of fertilizer and pesticides needed for wheat per square kilometer. (f2; p2): The amount of fertilizer and pesticides needed for barley per square kilometer. Profit of wheat and barley per square kilometer is c1 and c2 The objective: To decide x1; x2, the area where wheat and barley needs to be planted. In matrix form: Maximize x1 c1 c2 x2 Subject to 0 1 0 1 1 1 α x1 @ f1 f2 A @ β A ; and x1; x2 0: x2 ≤ ≥ p1 p2 γ Introduction Linear Programming Integer Programming The Problem Constraints: Objective function: f1x1 + f2x2 β ≤ c1x1 + c2x2 p1x1 + p2x2 γ ≤ x1 + x2 α, and x1; x2 0. ≤ ≥ Introduction Linear Programming Integer Programming The Problem Constraints: Objective function: f1x1 + f2x2 β ≤ c1x1 + c2x2 p1x1 + p2x2 γ ≤ x1 + x2 α, and x1; x2 0. ≤ ≥ In matrix form: Maximize x1 c1 c2 x2 Subject to 0 1 0 1 1 1 α x1 @ f1 f2 A @ β A ; and x1; x2 0: x2 ≤ ≥ p1 p2 γ Introduction Linear Programming Integer Programming Linear Integer Programming The Problem Objective Function: Maximize 8x1 + 11x2 + 6x3 + 4x4 Subject to: 5x1 + 7x2 + 4x3 + 3x4 14 ≤ 7x1 + 2x3 + x4 10 + ≤ xi Z for all i = 1; 2; 3; 4 2 Introduction Linear Programming Integer Programming Linear Integer Programming Types of integer programming problems Pure Integer Programming Problem: All variables are required to be integer. Mixed Integer Programming Problem: Some variables are restricted to be integers; the others can take any value. Binary Integer Programming Problem: All variables are restricted to be 0 or 1. Introduction Linear Programming Integer Programming Linear Integer Programming Linear Relaxation Objective Function: Maximize z = 8x1 + 11x2 + 6x3 + 4x4 Subject to: 5x1 + 7x2 + 4x3 + 3x4 14 ≤ xi 0; 1 for all i = 1; 2; 3; 4 Relax it to: 2 f g Objective Function: Maximize z = 8x1 + 11x2 + 6x3 + 4x4 Subject to: 5x1 + 7x2 + 4x3 + 3x4 14 ≤ xi [0; 1] for all i = 1; 2; 3; 4 2 Non-optimality Integrality relaxation: x1 = x2 = 1, x3 = 0:5, x4 = 0, and z = 22. Rounding x3 = 0: gives z = 19. Rounding x3 = 1: Infeasible. Optimal integer solution: x1 = 0, x2 = x3 = x4 = 1, and z = 21. Introduction Linear Programming Integer Programming Converting finite valued integer variables to binary Assume that xj can assume values in p1; p2;:::; pk . f g To convert it to binary integer programming 1 2 k Introduce variables yj ; yj ;::: yj 0; 1 , and 1 2 2 f g k Substitute xj with: p1yj + p2yj + ::: + pk yj in objective function and all the constraints, and 1 2 p Introduce a new constraint: yj + yj + ::: + yj = 1 Introduction Linear Programming Integer Programming Converting finite valued integer variables to binary Example Objective Function: Maximize z = 8x1 + 11x2 + 6x3 + 4x4 Subject to: 5x1 + 7x2 + 4x3 + 3x4 14 ≤ x1 1; 2; 3 and xj 0; 1 for all i = 2; 3; 4 2 f g 2 f g 1 2 3 Converted Problem: substituting x1 = 1y1 + 2y1 + 3y1 1 2 3 Objective Function:Max z = 8y1 + 16y1 + 24y1 + 11x2 + 6x3 + 4x4 1 2 3 Subject to: 5y1 + 10y1 + 15y1 + 7x2 + 4x3 + 3x4 14 1 2 3 ≤ y1 + y1 + y1 = 1 1 2 3 y ; y ; y 0; 1 and xj 0; 1 for all i = 2; 3; 4 1 1 1 2 f g 2 f g 1 2 3 Solution: y1 = 0, y1 = 1, y1 = 0, x2 = 0, x3 = 1, x4 = 0, and z = 22. Implying: x1 = 2, x2 = 0, x3 = 1, x4 = 0, and z = 22. Introduction Linear Programming Integer Programming Applications of ILP Vertex Cover Problem Given a graph G = (V ; E), find a subset of vertices U V such that each edge in E is incident to at least one vertex in⊆U.