Optimisation and Operations Research

Similar documents
Optimisation and Operations Research

Week Cuts, Branch & Bound, and Lagrangean Relaxation

MVE165/MMG630, Applied Optimization Lecture 6 Integer linear programming: models and applications; complexity. Ann-Brith Strömberg

3.4 Relaxations and bounds

Introduction to Bin Packing Problems

Introduction to Mathematical Programming IE406. Lecture 21. Dr. Ted Ralphs

Unit 1A: Computational Complexity

Optimization Exercise Set n.5 :

5 Integer Linear Programming (ILP) E. Amaldi Foundations of Operations Research Politecnico di Milano 1

Optimization Prof. A. Goswami Department of Mathematics Indian Institute of Technology, Kharagpur. Lecture - 20 Travelling Salesman Problem

Travelling Salesman Problem

What is an integer program? Modelling with Integer Variables. Mixed Integer Program. Let us start with a linear program: max cx s.t.

Integer Linear Programming

Hands-on Tutorial on Optimization F. Eberle, R. Hoeksma, and N. Megow September 26, Branch & Bound

Algorithms and Complexity theory

IE418 Integer Programming

Easy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P

Maximum Flow Problem (Ford and Fulkerson, 1956)

Exercises NP-completeness

Integer Programming for Bayesian Network Structure Learning

Lecture 23 Branch-and-Bound Algorithm. November 3, 2009

Computational Integer Programming. Lecture 2: Modeling and Formulation. Dr. Ted Ralphs

Branch-and-Bound. Leo Liberti. LIX, École Polytechnique, France. INF , Lecture p. 1

Integer Linear Programming Modeling

Lecture 8: Column Generation

Lecture 11 October 7, 2013

Optimisation and Operations Research

Algorithms. NP -Complete Problems. Dong Kyue Kim Hanyang University

Optimization Exercise Set n. 4 :

(tree searching technique) (Boolean formulas) satisfying assignment: (X 1, X 2 )

IS703: Decision Support and Optimization. Week 5: Mathematical Programming. Lau Hoong Chuin School of Information Systems

Modeling with Integer Programming

Chapter 3: Discrete Optimization Integer Programming

Lecture 8 Network Optimization Algorithms

Introduction to LP. Types of Linear Programming. There are five common types of decisions in which LP may play a role

Chapter 3: Discrete Optimization Integer Programming

Integer programming: an introduction. Alessandro Astolfi

Approximation Algorithms

Modelling linear and linear integer optimization problems An introduction

Integer Programming. Wolfram Wiesemann. December 6, 2007

Technische Universität München, Zentrum Mathematik Lehrstuhl für Angewandte Geometrie und Diskrete Mathematik. Combinatorial Optimization (MA 4502)

8.5 Sequencing Problems

Combinatorial Optimization

Gestion de la production. Book: Linear Programming, Vasek Chvatal, McGill University, W.H. Freeman and Company, New York, USA

REVISION SHEET DECISION MATHS 2 DECISION ANALYSIS

D1 Discrete Mathematics The Travelling Salesperson problem. The Nearest Neighbour Algorithm The Lower Bound Algorithm The Tour Improvement Algorithm

Integer Linear Programming (ILP)

Week 8. 1 LP is easy: the Ellipsoid Method

Introduction to Integer Linear Programming

4/12/2011. Chapter 8. NP and Computational Intractability. Directed Hamiltonian Cycle. Traveling Salesman Problem. Directed Hamiltonian Cycle

Discrete (and Continuous) Optimization WI4 131

Scheduling and Optimization Course (MPRI)

Recoverable Robustness in Scheduling Problems

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

Optimisation and Operations Research

Knapsack. Bag/knapsack of integer capacity B n items item i has size s i and profit/weight w i

Section Notes 9. Midterm 2 Review. Applied Math / Engineering Sciences 121. Week of December 3, 2018

This means that we can assume each list ) is

21. Set cover and TSP

NP-Complete Reductions 2

Advances in Bayesian Network Learning using Integer Programming

LECTURE 1: INTRODUCTION

Integer Programming for Bayesian Network Structure Learning

CS Algorithms and Complexity

MVE165/MMG631 Linear and integer optimization with applications Lecture 8 Discrete optimization: theory and algorithms

Intractable Problems Part Two

Introduction to optimization and operations research

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

Math 381 Midterm Practice Problem Solutions

15.081J/6.251J Introduction to Mathematical Programming. Lecture 24: Discrete Optimization

How hard is it to find a good solution?

The Ellipsoid (Kachiyan) Method

Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter Some Problems. A Brief History of Ideas

15.083J/6.859J Integer Optimization. Lecture 2: Efficient Algorithms and Computational Complexity

Graduate Algorithms CS F-21 NP & Approximation Algorithms

Advanced linear programming

Discrete Optimization 2010 Lecture 8 Lagrangian Relaxation / P, N P and co-n P

Limits to Approximability: When Algorithms Won't Help You. Note: Contents of today s lecture won t be on the exam

8. INTRACTABILITY I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 2/6/18 2:16 AM

NP-complete problems. CSE 101: Design and Analysis of Algorithms Lecture 20

New Theory and Algorithms for Scheduling Arc Shutdown Jobs in Networks

3.8 Strong valid inequalities

New Integer Programming Formulations of the Generalized Travelling Salesman Problem

Lecture 20: LP Relaxation and Approximation Algorithms. 1 Introduction. 2 Vertex Cover problem. CSCI-B609: A Theorist s Toolkit, Fall 2016 Nov 8

Algorithms and Complexity Theory. Chapter 8: Introduction to Complexity. Computer Science - Durban - September 2005

Introduction to Integer Programming

1 Column Generation and the Cutting Stock Problem

Introduction column generation

Branch-and-Bound for the Travelling Salesman Problem

Polynomial-time Reductions

BBM402-Lecture 20: LP Duality

Branch-and-cut Approaches for Chance-constrained Formulations of Reliable Network Design Problems

Discrete Optimization 2010 Lecture 7 Introduction to Integer Programming

Data Structures in Java

NP-Complete Problems

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18

Integer Programming (IP)

ECS122A Handout on NP-Completeness March 12, 2018

BCCS: Computational methods for complex systems Wednesday, 16 June Lecture 3

Algorithm Design Strategies V

Transcription:

Optimisation and Operations Research Lecture 11: Integer Programming Matthew Roughan <matthew.roughan@adelaide.edu.au> http://www.maths.adelaide.edu.au/matthew.roughan/ Lecture_notes/OORII/ School of Mathematical Sciences, University of Adelaide July 12, 2017

Section 1 Integer Programming Problems July 12, 2017 2 / 36

Section 2 Native Integer Variables July 12, 2017 3 / 36

Integer variables A long time ago, in Lecture 1, we looked at our first problem: A manufacturing scheduling problem max z = 13x 1 + 12x 2 + 17x 3 s.t. 2x 1 + x 2 + 2x 3 225 x 1 + x 2 + x 3 117 3x 1 + 3x 2 + 4x 3 420 x 1 0, x 2 0, x 3 0 x 1 = the number of desks; x 2 = the number of chairs; and, x 3 = the number of bed frames, made per time period. Shouldn t we ensure that x 1, x 2 and x 3 are integers?! July 12, 2017 4 / 36

Allocation problem 1 Example (Knapsack problem) A hiker can choose from the following items when packing a knapsack: 1 2 3 4 5 Item chocolate raisins camera jumper drink w i (kg) 0.5 0.4 0.8 1.6 0.6 v i (value) 2.75 2.5 1 5 3.0 v i /w i 5.5 6.25 1.25 3.125 5 However, the hiker cannot carry more than 2.5 kg all together. Objective: choose the number of each item to pack in order to maximise the total value of the goods packed, without violating the mass constraint. July 12, 2017 5 / 36

Allocation problem 2 Example (Knapsack problem Formulation) Let x i bet the number of copies of item i to be packed, such that x i 0 and integer (cannot pack 1/2 a jumper!). max v = 2.75x 1 + 2.5x 2 + x 3 + 5x 4 + 3x 5 s.t. 0.5x 1 + 0.4x 2 + 0.8x 3 + 1.6x 4 + 0.6x 5 2.5 x i 0 and integer. July 12, 2017 6 / 36

Allocation problems http://xkcd.com/287/ July 12, 2017 7 / 36

Network Problems Many optimisation problems are related to a Network or Graph Consider a set of nodes (or vertices) N and a set of directed links (or edges) L between those nodes. These directed links then give us a directed network or directed graph G(N, L) like that below 1 2 5 4 7 3 6 July 12, 2017 8 / 36

Network Problems Many optimisation problems are related to a Network Consider a set of nodes (or vertices) N and a set of undirected links (or edges) L between those nodes. These directed links then give us an undirected network G(N, L) like that below 1 2 5 4 7 3 6 July 12, 2017 9 / 36

Graph terminology Definition (undirected graph) An undirected graph has edges (or links) that are unordered pairs of nodes {i, j} L, i, j N, meaning node i is adjacent to node j and visa versa. Definition (directed graph) A directed graph has edges (or arcs) that are ordered pairs of nodes (i, j), meaning node i is adjacent to node j. July 12, 2017 10 / 36

Graph terminology Example (Undirected graph) 1 2 5 4 7 3 6 G(N, E) where N is the set of nodes, and E is the set of edges N = {1, 2, 3, 4, 5, 6, 7} E = { (1, 2), (1, 3), (2, 4), (2, 5), (3, 4), (3, 6), (4, 5), (4, 7), (5, 7), (6, 7) } July 12, 2017 11 / 36

Graph terminology A walk is an ordered list of nodes i 1, i 2,..., i t such that, in an undirected graph, {i k, i k+1 } L, or, in a directed graph, (i k, i k+1 ) L for k = 1, 2,..., t 1. A path is a walk where the nodes i 1, i 2,..., i k are all distinct. A graph is connected if there is a path connecting every pair of nodes. A cycle is a walk where the nodes i 1, i 2,..., i k 1 are all distinct, but i 1 = i k. A directed graph is acyclic if it contains no cycles. we call it a DAG = Directed Acyclic Graph July 12, 2017 12 / 36

Network Problems Example (The Travelling Salesperson Problem (TSP)) Given a set of towns, i = 1,..., n, and links (i, j) between the towns. The links each have a specified length, given by a distance matrix D = 1 2. i. n 1 2 j n... d ij Objective: construct a directed cycle of minimum total distance going through each town exactly once. July 12, 2017 13 / 36

TSP The decision is, basically, which links do we choose to use in the tour. { 1 if link (i, j) is chosen x ij = 0 if link (i, j) is not chosen then the ILP (Integer Linear Program) formulation is n n min d = d ij x ij s.t. i=1 j=1 n x ij = 1, i = 1,..., n (only one link from i) j=1 n x ij = 1, j = 1,..., n (only one link to j) i=1 x ij j S c 1, S N (connectedness) i S x ij = 0 or 1 for all i, j July 12, 2017 14 / 36

Network Problems http://xkcd.com/399/ July 12, 2017 15 / 36

Other Network Problems Graph and network problems come up a lot! Example (Shortest path problem) (Differs from a TSP in that it does not look for a tour through all nodes, but rather a path from one node to another.) Find a minimum length path through a network G(N, L), from a specified source node, say 1, to a specified destination node n, where each link (i, j) L has an associated length, d ij. Example (Maximum flow problem) Given a network with a single source node (generator of traffic ) and a sink (attractor of traffic); network has directed links with links (i, j) having an upper capacity of u ij. We have no cost for unit flows, just bounds on the capacities of the links and we wish to send the maximum flow from one specified node to another. July 12, 2017 16 / 36

Section 3 Supplementary Integer Variables July 12, 2017 17 / 36

Supplementary Integer Variables Sometimes the original variables in the problem aren t variables, but we have to add in extra, artificial variables for some other reason disjoint objective functions fixed-cost problems disjunctive constraints July 12, 2017 18 / 36

Disjoint objective function fixed-cost problem Example (Production planning) Here we have N products, where the production cost for product j (j = 1,..., N) consists of a fixed setup cost K j 0 and a variable cost c j that depends on the number of copies of item j produced. That is, the cost associated with producing x j copies of item j is { K j + c j x j x j > 0, C j (x j ) = 0 x j 0. Objective: minimise total cost, min z = N j=1 C j(x j ), subject to x j 0, and any other constraints on supplies, orders, etc. Note that variables x j are not necessarily integer! July 12, 2017 19 / 36

Fixed costs problems The problem is non-linear, because of the discontinuity at x j = 0 in C j (x j ), which can be removed by introducing j new variables y j, where { 1 x j > 0 y j = 0 x j = 0. Then C j (x j ) = K j y j + c j x j, and the problem can be formulated as min z = N (K j y j + c j x j ) j=1 s.t. x j 0 y j = 0 or 1 x j My j where M upper bound on all x j. (+other constraints, e.g., order sizes) July 12, 2017 20 / 36

Fixed costs problems (a) The original problem didn t have integer variables these arose as artificial variables to keep the problem linear. (b) This is a mixed Integer, Linear Program (ILP), because some variables are continuous and some are integers. (c) If x j = 0 then minimising z requires y j = 0. (d) For all production of item j given by x j > 0 means that we have to set y j > 0 to satisfy the new constraints x j My j for each item j. July 12, 2017 21 / 36

Disjunctive and conjunctive constraints Definition A constraint in the form of A and B is called conjunctive. Most of our earlier constraints are already conjunctive we require all of them to be true in the feasible region. Definition A constraint in the form of A or B is called disjunctive. These might be used to make it possible to create multiple (separate) feasible regions. Note, mathematicians sometimes denote AND by and OR by July 12, 2017 22 / 36

Disjunctive constraints Example (Sorta Auto) Sorta Auto is considering manufacturing 3 types of of cars: compact, medium and large. Resources required and profits yielded by each type of car are Compact Medium Large Steel required (tonnes) 0.5 1 3 Labour required (hrs) 30 25 40 Profit ($ 1,000 s) 3 5 8 The amount of steel available is at most 2,000 tonnes and at most 60,000 hrs of labour are available. Production of any car type is feasible only if at least 1,000 cars of that type are made. Objective: maximise profit, by determining how many of each type to produce, while satisfying the constraints. July 12, 2017 23 / 36

Disjunctive constraints Variables x 1 = number of compact cars produced x 2 = number of medium size cars produced x 3 = number of large size cars produced. Then the objective function is with constraints: max 3x 1 + 5x 2 + 8x 3 x 1, x 2, x 3 0, and integer 0.5x 1 + x 2 + 3x 2 2000 30x 1 + 25x 2 + 40x 3 60, 000 either x 1 = 0 or x 1 1000 either x 2 = 0 or x 2 1000 either x 3 = 0 or x 3 1000. July 12, 2017 24 / 36

Disjunctive constraints Instead of either x i = 0 or x i 1000 introduce binary variable y i such that x i M i y i (a) (M i large constant) 1000 x i M i (1 y i ) (b) y i {0, 1} (c) Notice that if x i > 0, then y i = 1 by both constraints (a) and (c) x i 1000 because of constraint (b) y i = 0 then x i = 0 by constraint (a) and so we get the desired result! July 12, 2017 25 / 36

Disjunctive constraints in general In general, either f (x) 0 or g(x) 0 is equivalent to if f (x) > 0 then g(x) 0. Introduce 0 1 variable y and the constraints g(x) M(1 y), f (x) My where M is a large, positive number. if f (x) > 0, then y > 0 and so y = 1, giving g(x) 0. if y = 0 then f (x) 0. July 12, 2017 26 / 36

Section 4 Integer Programming: Naïve Solutions July 12, 2017 27 / 36

Naïve solutions 1 Exhaustive search 2 Approximate with a LP July 12, 2017 28 / 36

Exhaustive search When first considering (LP)s we suggested solving them by enumerating all basic solutions, determining which were feasible ones, and then choosing the one which gave the optimal evaluation of the objective function. we saw this was a bad idea (there are too many possibilities) but we have restricted the space now, maybe exhaustive works? Approach enumerate every potential solution, check its feasibility, and from amongst the feasible ones, choose the one that gives the optimal value of the objective function. July 12, 2017 29 / 36

Exhaustive search Consider a simple binary linear program with n binary variables there are 2 n possible solutions that is O(exp(n)) so an exhaustive search is hopeless for even moderate n. Consider the TSP N towns to visit (N 1)! different tours. 2 For example, if there were N = 100 towns to visit, this is then 4.6663 10 157 different tours. Exhaustive searches are a really bad idea except for toy problems. July 12, 2017 30 / 36

Approximate with a LP 1 Idea: drop the integrality constraint and solve the resulting LP we know how to solve LPs efficiently sounds a bit like rounding off, so there might be some errors, but how big can they be? 2 We call this relaxation in general relaxation means loosening up some constraint here we relax the integer constraint July 12, 2017 31 / 36

Relaxation (of integrality) We can guess that rounding might not be optimal, but it can be far away from optimal! optimum of LP objective rounded down optimum of ILP It gets worse in higher dimensions. July 12, 2017 32 / 36

Relaxation (of integrality) Solving a relaxed (LP) may lead to different solutions they might not even be feasible y Example max z = 3x + y s.t. 0.8x + y 2.1 1.2x + y 2.8 x, y 0 (and integral.) 2.8 2.1 1 0.8x+y=2.1 1.2x+y=2.8 feasible region x 1 2 2.5 2.65 So relaxation is a crude tool, but it can be useful if used carefully (we will see how later on). July 12, 2017 33 / 36

Less Naïve Solutions Methods we will look at... Greedy algorithms (heuristics) Branch and bound (enumeration with pruning) General purpose heuristics (genetic algorithms) And we ll look at some toolkits that help. July 12, 2017 34 / 36

Takeaways Lot s of real problems have integer variables Integer programming is much more than just linear programming with integer variables. Even if variables are continuous, other parts of the problem need extra integer variables disjunctive constraints (either or) discontinuous objectives Naïve solutions to ILPs aren t a great idea July 12, 2017 35 / 36

Further reading I July 12, 2017 36 / 36