Fundamentals of Integer Programming Di Yuan Department of Information Technology, Uppsala University January 2020
Outline ◼ Definition of integer programming Informationsteknologi ◼ Formulating some classical problems with integer programming ◼ Linear programming ◼ Solution methods for integer programming ◼ (Introduction to modeling language and solver) ◼ Impact of modeling on problem solving 2 Institutionen för informationsteknologi | www.it.uu.se
Definition of Integer Programming Optimization and Programming ◼ Mathematical programming: to find the best solution from a set of Informationsteknologi alternatives ◼ A generic formulation: Objective function Solution set Variables ◼ The variables (their values) represent problem solution ◼ The solution set is specified by equations and inequalities 3 Institutionen för informationsteknologi | www.it.uu.se
Definition of Integer Programming Binary Knapsack ◼ Given: Informationsteknologi A set of items, each with a value and weight A knapsack with a weight capacity limit ◼ Select items to maximize the total value of the knapsack, without exceeding the weight limit $10 $11 1 kg 2.5 kg $30 $12 4 kg 2 kg $24 $25 3 kg 5 kg 4 Institutionen för informationsteknologi | www.it.uu.se
Definition of Integer Programming Types of Optimization Models Informationsteknologi ◼ Linear programming ◼ Integer (linear) programming ◼ Nonlinear programming ◼ Integer nonlinear programming 5 Institutionen för informationsteknologi | www.it.uu.se
Definition of Integer Programming Generic Model of Mixed Integer (Linear) Programming (MIP) Informationsteknologi Special case: binary variables Note: All combinatorial optimization problems can be formulated as MIP 6 Institutionen för informationsteknologi | www.it.uu.se
Modeling Some Classical Problems with Integer Programming Coloring ◼ Given: a graph with nodes and edges Informationsteknologi ◼ Assign a color to each vertex (node); two adjacent vertexes must use different colors ◼ Minimize the total number of colors used 7 Institutionen för informationsteknologi | www.it.uu.se
Modeling Some Classical Problems with Integer Programming Coloring (cont’d) Node 2 Informationsteknologi Node 1 8 Institutionen för informationsteknologi | www.it.uu.se
Modeling Some Classical Problems with Integer Programming Coloring (cont’d) Informationsteknologi Node 2 Node 1 9 Institutionen för informationsteknologi | www.it.uu.se
Modeling Some Classical Problems with Integer Programming Set Covering ◼ Given: Informationsteknologi Candidate service centers and demand points Each service center has a deployment cost, and can serve a subset of the demand points ◼ Select a subset of service centers at minimum total cost, to cover all demand points 10 Institutionen för informationsteknologi | www.it.uu.se
Modeling Some Classical Problems with Integer Programming Set Covering (cont’d) Informationsteknologi 11 Institutionen för informationsteknologi | www.it.uu.se
Modeling Some Classical Problems with Integer Programming Uncapacitated Facility Location ◼ Given: Informationsteknologi A set of candidate facility (e.g., warehouse) locations A set of customers Opening a facility has a fixed charge Transportation cost between facility locations and customers ◼ Determine which facilities to deploy and the customers served by each deployed facility, minimizing the total cost 12 Institutionen för informationsteknologi | www.it.uu.se
Modeling Some Classical Problems with Integer Programming Uncapacitated Facility Location (cont’d) Informationsteknologi 13 Institutionen för informationsteknologi | www.it.uu.se
Modeling Some Classical Problems with Integer Programming Traveling Salesman Problem ◼ Given: a graph with edge cost Informationsteknologi ◼ Find a tour visiting each node in a graph exactly once with minimum length 14 Institutionen för informationsteknologi | www.it.uu.se
Modeling Some Classical Problems with Integer Programming Traveling Salesman Problem (cont’d) Informationsteknologi ◼ How to formulate this problem by integer programming? Have we overlooked anything? Potential drawback of the formulation? 15 Institutionen för informationsteknologi | www.it.uu.se
Linear Programming A Small Example x 2 Informationsteknologi 5 x 1 5 16 Institutionen för informationsteknologi | www.it.uu.se
Linear Programming Linear Programming Relaxation ◼ Relaxation: “removal” of some constraints/restrictions Informationsteknologi ◼ In general, the linear programming relaxation is an approximation of the integer model; the solution of the former may be fractional ◼ Which one is easier to solve? ◼ LP is in P 17 Institutionen för informationsteknologi | www.it.uu.se
Linear Programming Solving a Linear Programming Model ◼ Fundamental property: Optimum is located at one of the Informationsteknologi extreme/corner points of the feasible region (why?) Linear objective function Feasible region ◼ This is used by the Simplex Method for solving linear programs (visiting a sequence of objective-improving extreme points) ◼ There are other efficient, interior-point methods 18 Institutionen för informationsteknologi | www.it.uu.se
Linear Programming The Convex Hull ◼ Convex hull: The minimum convex set containing the solution space Informationsteknologi ◼ Integer programming = linear programming on the convex hull of the integer points ◼ Convex hull exists, but its description is hard to derive in general 19 Institutionen för informationsteknologi | www.it.uu.se
Solution Methods for Integer Programming Computing the Global Optimum ◼ General-purpose method: Linear programming relaxation + Informationsteknologi Iterative improvement in approximating the convex hull, a.k.a. cutting planes (cf. inference) Divide-and-conquer, a.k.a. branch-and-bound (relaxation + search) LP optimum LP optimum ◼ Optimality gap : The (relative) difference between the objective value of the best known integer solution and that of the best (“optimistic”) LP bound so far 20 Institutionen för informationsteknologi | www.it.uu.se
Solution Methods for Integer Programming Cutting Planes: An Example Knapsack problem instance: Informationsteknologi Can we pack items 1, 4, 6, and 7 all in the knapsack? (5+6+6+5=22) The above inequality (referred to as a “cover cut”) is valid for integer solutions, but violated by the LP relaxation optimum 21 Institutionen för informationsteknologi | www.it.uu.se
Solution Methods for Integer Programming Cutting Planes: An Example (cont’d) Adding the cut to the linear programming relaxation: Informationsteknologi Challenge for the solver: To time-efficiently find valid and useful cuts 22 Institutionen för informationsteknologi | www.it.uu.se
Solution Methods for Integer Programming Branch-and-Bound: An Example Same knapsack problem instance: Informationsteknologi 23 Institutionen för informationsteknologi | www.it.uu.se
Solution Methods for Integer Programming Branch-and- Bound: An Example (cont’d) Branching generates a search tree Informationsteknologi Opt. gap = ? LP = 29.16 x 4 = 0 : 167 (one fractional variable) x 4 = 0 x 4 = 1 Opt. gap = ? LP = 28.75 x 3 = 0 : 125 Opt. gap = ? x 3 = 0 x 3 = 1 LP = 25.5 LP = 28.66 . . . . . . x 5 = 0 : 5 x 2 = 0 : 167 We can stop branching here if the integer solution of value 29 is known (why?) Can we stop branching here because of an integer solution of value 28? 24 Institutionen för informationsteknologi | www.it.uu.se
Introduction to Modeling Language and Solver Optimization Solver ◼ Solver: software implementing methods for solving optimization Informationsteknologi models (here: integer programming models) ◼ Interface + optimization engine knapsack.lp 25 Institutionen för informationsteknologi | www.it.uu.se
Introduction to Modeling Language and Solver Another Sample of Solver Log for Integer Programming Informationsteknologi 26 Institutionen för informationsteknologi | www.it.uu.se
Introduction to Modeling Language and Solver Modeling Language: Separation between Model and Data knapsack.mod knapsack6.dat Informationsteknologi 27 Institutionen för informationsteknologi | www.it.uu.se
Introduction to Modeling Language and Solver Command Script: An Example Informationsteknologi 28 Institutionen för informationsteknologi | www.it.uu.se
Introduction to Modeling Language and Solver Modeling System + Solver - Model and data specification Command - Solver options Informationsteknologi script - Display options - etc. Model Data Modeling system - Set elements - Sets - Parameter values - Parameters - Variables Solver - Objective function - Constraints Feasible solution? Result analysis ◼ Optimal solution? ◼ Optimum and variable value ◼ Solution time ◼ etc. ◼ 29 Institutionen för informationsteknologi | www.it.uu.se
Introduction to Modeling Language and Solver AMPL Basics: Sets ◼ Simple sets (numbers or symbols) Informationsteknologi ◼ Indexed collection of sets 30 Institutionen för informationsteknologi | www.it.uu.se
Recommend
More recommend