CSC 8301 Design & Analysis of Algorithms: Linear Programming

Similar documents
Copyright 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch.

CSC 8301 Design & Analysis of Algorithms: Warshall s, Floyd s, and Prim s algorithms

CSC 1700 Analysis of Algorithms: Minimum Spanning Tree

COT 6936: Topics in Algorithms! Giri Narasimhan. ECS 254A / EC 2443; Phone: x3748

Outline: Finish uncapacitated simplex method Negative cost cycle algorithm The max-flow problem Max-flow min-cut theorem

The Simplex Algorithm

Source. Sink. Chapter 10: Iterative Programming Maximum Flow Problem. CmSc250 Intro to Algorithms

Solutions for Operations Research Final Exam

Optimization of Design. Lecturer:Dung-An Wang Lecture 8

CSC 8301 Design & Analysis of Algorithms: Kruskal s and Dijkstra s Algorithms

Linear Programming. Linear programming provides methods for allocating limited resources among competing activities in an optimal way.

Advanced Operations Research Techniques IE316. Quiz 1 Review. Dr. Ted Ralphs

An example of LP problem: Political Elections

Linear Programming. Course review MS-E2140. v. 1.1

ISE203 Optimization 1 Linear Models. Dr. Arslan Örnek Chapter 4 Solving LP problems: The Simplex Method SIMPLEX

The Simplex Algorithm. Chapter 5. Decision Procedures. An Algorithmic Point of View. Revision 1.0

Outline. CS38 Introduction to Algorithms. Linear programming 5/21/2014. Linear programming. Lecture 15 May 20, 2014

Read: H&L chapters 1-6

Linear programming II João Carlos Lourenço

An iteration of the simplex method (a pivot )

CMPSCI611: The Simplex Algorithm Lecture 24

CS261: Problem Set #2

CSC 8301 Design and Analysis of Algorithms: Exhaustive Search

Advanced Operations Research Techniques IE316. Quiz 2 Review. Dr. Ted Ralphs

How to Solve a Standard Maximization Problem Using the Simplex Method and the Rowops Program

4.1 Graphical solution of a linear program and standard form

16.410/413 Principles of Autonomy and Decision Making

Linear Programming. Readings: Read text section 11.6, and sections 1 and 2 of Tom Ferguson s notes (see course homepage).

Linear Programming. Widget Factory Example. Linear Programming: Standard Form. Widget Factory Example: Continued.

CSE 417 Network Flows (pt 4) Min Cost Flows

Introduction. Linear because it requires linear functions. Programming as synonymous of planning.

Artificial Intelligence

LECTURES 3 and 4: Flows and Matchings

Linear Programming. them such that they

Math 414 Lecture 30. The greedy algorithm provides the initial transportation matrix.

DM545 Linear and Integer Programming. Lecture 2. The Simplex Method. Marco Chiarandini

AM 121: Intro to Optimization Models and Methods Fall 2017

3 INTEGER LINEAR PROGRAMMING

Algorithmic Game Theory and Applications. Lecture 6: The Simplex Algorithm

Section Notes 5. Review of Linear Programming. Applied Math / Engineering Sciences 121. Week of October 15, 2017

CSC 8301 Design and Analysis of Algorithms: Recursive Analysis

Mathematical and Algorithmic Foundations Linear Programming and Matchings

Notes for Lecture 18

Lecture Notes 2: The Simplex Algorithm

Chapter 1 Linear Programming. Paragraph 4 The Simplex Algorithm

Minimum Cost Edge Disjoint Paths

CS675: Convex and Combinatorial Optimization Spring 2018 The Simplex Algorithm. Instructor: Shaddin Dughmi

Lecture 9: Linear Programming

CLASS: II YEAR / IV SEMESTER CSE CS 6402-DESIGN AND ANALYSIS OF ALGORITHM UNIT I INTRODUCTION

Civil Engineering Systems Analysis Lecture XV. Instructor: Prof. Naveen Eluru Department of Civil Engineering and Applied Mechanics

Lecture 3: Graphs and flows

Section Notes 4. Duality, Sensitivity, and the Dual Simplex Algorithm. Applied Math / Engineering Sciences 121. Week of October 8, 2018

CSC 8301 Design and Analysis of Algorithms: Heaps

Previously Local sensitivity analysis: having found an optimal basis to a problem in standard form,

Solution for Homework set 3

CSC 1700 Analysis of Algorithms: Heaps

CSE 40/60236 Sam Bailey

CS261: Problem Set #1

Finite Math Linear Programming 1 May / 7

Chapter 5 Graph Algorithms Algorithm Theory WS 2012/13 Fabian Kuhn

Lecture 11: Maximum flow and minimum cut

BCN Decision and Risk Analysis. Syed M. Ahmed, Ph.D.

Chapter 15 Introduction to Linear Programming

Linear Programming Problems

CSE 417 Network Flows (pt 3) Modeling with Min Cuts

Lecture 3: Totally Unimodularity and Network Flows

Easter Term OPTIMIZATION

Linear Optimization. Andongwisye John. November 17, Linkoping University. Andongwisye John (Linkoping University) November 17, / 25

Linear and Integer Programming :Algorithms in the Real World. Related Optimization Problems. How important is optimization?

Simulation. Lecture O1 Optimization: Linear Programming. Saeed Bastani April 2016

Linear Programming. Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015

Some Advanced Topics in Linear Programming

Problem Set 7 Solutions

CSC 8301 Design and Analysis of Algorithms: Graph Traversal

Introduction to Linear Programming

Linear Programming. Linear Programming. Linear Programming. Example: Profit Maximization (1/4) Iris Hui-Ru Jiang Fall Linear programming

16.410/413 Principles of Autonomy and Decision Making

Introduction to Mathematical Programming IE496. Final Review. Dr. Ted Ralphs

Homework 3 Solutions

Maximum flows & Maximum Matchings

1 Linear programming relaxation

MA4254: Discrete Optimization. Defeng Sun. Department of Mathematics National University of Singapore Office: S Telephone:

COMP 251 Winter 2017 Online quizzes with answers

Tuesday, April 10. The Network Simplex Method for Solving the Minimum Cost Flow Problem

Convex Optimization CMU-10725

VARIANTS OF THE SIMPLEX METHOD

THEORY OF LINEAR AND INTEGER PROGRAMMING

Practice Problems for the Final

Discrete Optimization. Lecture Notes 2

5.4 Pure Minimal Cost Flow

Problem set 2. Problem 1. Problem 2. Problem 3. CS261, Winter Instructor: Ashish Goel.

Marginal and Sensitivity Analyses

Graphs and Network Flows IE411. Lecture 13. Dr. Ted Ralphs

Introduction to Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

1. Let n and m be positive integers with n m. a. Write the inclusion/exclusion formula for the number S(n, m) of surjections from {1, 2,...

Graphs. Edges may be directed (from u to v) or undirected. Undirected edge eqvt to pair of directed edges

Matching. Algorithms and Networks

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize.

1 Bipartite maximum matching

INEN 420 Final Review

Transcription:

CSC 8301 Design & Analysis of Algorithms: Linear Programming Professor Henry Carter Fall 2016

Iterative Improvement Start with a feasible solution Improve some part of the solution Repeat until the solution is optimal 2

A Geometric Solution y ( 0, 2 ) ( 3, 1 ) ( 0, 0 ) ( 4, 0 ) x 3x + 5y = 20 3x + 5y = 14 3x + 5y = 10 Maximize: 3x + 5y 3

The Simplex Method A convenient means for iterating over extreme points Problem must be: Maximization problem All constraints must be linear equations with nonnegative right-hand sides All variables must be nonnegative 4

Step 0: Standard Form Min-max conversion Representing inequalities with slack variables Replace negative variables with two nonnegative variables 5

Example Standard Form Maximize: 3x + 5y Subject to: x + y 4 x + 3y 6 x 0, y 0 Maximize: 3x + 5y + 0u + 0v Subject to: x + y + u = 4 x + 3y + v = 6 x, y, u, v 0 6

Basic Feasible Solution Find an initial extreme point to begin iterative improvement For m constraints over n variables, set (n - m) variables to 0 Common approach is to zero the original variables and set the slack variables accordingly For our example, (0, 0, 4, 6) 7

Constructing the Simplex Tableau Constraint Coefficients Objective Row Recognize the corresponding solution Maximize: 3x + 5y + 0u + 0v Subject to: x + y + u = 4 x + 3y + v = 6 x, y, u, v 0 8

Example Tableau x y u v u 1 1 1 0 4 v 1 3 0 1 6-3 -5 0 0 0 9

Iterating the Extreme Point Choose the entering variable (new basic variable) Choose the departing variable (new nonbasic variable) Pivot Operations 10

Example Iteration x y u v u 1 1 1 0 4 v 1 3 0 1 6-3 -5 0 0 0 11

Example Iteration x y u v u 1 1 1 0 4 θ u = v 1 3 0 1 6 θ v = -3-5 0 0 0 12

Example Iteration x y u v u 1 1 1 0 4 v 1 3 0 1 6-3 -5 0 0 0 13

Example Iteration x y u v u 1 1 1 0 4 v 1/3 1 0 1/3 2-3 -5 0 0 0 14

Example Iteration x y u v u 2/3 0 1-1/3 2 y 1/3 1 0 1/3 2-4/3 0 0 5/3 10 15

Example Iteration x y u v u 2/3 0 1-1/3 2 y 1/3 1 0 1/3 2-4/3 0 0 5/3 10 16

Example Iteration x y u v x 1 0 3/2-1/2 3 y 0 1-1/2 1/2 1 0 0 2 1 14 17

Practical Points Prevent cycling with Bland s Rule Algorithmically finding an initial feasible solution Two-phase Simplex Method 18

Analysis Number of extreme points grows exponentially In practice, between m and 3m iterations are needed Operations per iteration: O(mn) Other approaches: Ellipsoid method (polynomial worst-case) Karmarkar s algorithm (empirically efficient) 19

Practice Set up the first simplex tableau for the following linear programming problem: Maximize: x + 2y subject to: 4x y y 3 + x x 0, y 0 20

Recap Iterative methods start with a solution then iteratively improve it until optimal Linear programming optimizes a linear equation with constraints The Simplex Method iterates over extreme points in the feasible region Very common in practice (even included in Excel addon) 21

Modeling a Transportation Network Recall: weighted digraphs Represent start and end as a source vertex and a sink vertex Represent paths with positive capacity using edge weight Flow Network 22

Finding a Flow Rules: Flow-conservation Edge capacity Flow value Maximize the value 23

Ford-Fulkerson Initialize a 0-value flow Iteratively search for an augmented path Any path from source to sink with available flow capacity When no more augmenting paths can be found, the flow is maximized 24

Greedy Approach Example 5 3 4 1 2 5 2 3 2 6 3 4 1 25

Shortest Augmenting Path Uses a BFS to traverse the graph Along the path, adjust the incoming flow for each vertex if there is edge capacity available If a vertex with no outgoing capacity is encountered, adjust the incoming flow on a back edge Augment the current flow each time a new augmenting path reaches the sink Terminate if no augmenting path to the sink exists 26

Example: 1 st augmenting path 5 0/3 0/4 1 0/2 0/5 2 3 0/2 6 0/3 4 0/1 Queue: 1-2 3 4 5 6 27

Example: 2 nd augmenting path 5 0/3 0/4 1 2/2 2/5 2 3 2/2 6 0/3 4 0/1 Queue: 1-2 3 4 5 6 28

Example: no more augmenting paths 5 1/3 1/4 1 2/2 1/5 2 3 2/2 6 1/3 4 1/1 Queue: 1-2 3 4 5 6 29

Analysis Time to find one augmenting path (using adjacency lists): O( E ) Maximum iterations needed: E V /2 Worst-case: O( ) 30

Max-flow Min-cut theorem A cut is a set of edges that, when removed, eliminate all paths from source to sink A min-cut is a cut where the sum of the edge weights is minimized The value of a max-flow is equal to the capacity of the min-cut 31

Finding the Min-cut 5 1/3 1/4 1 2/2 1/5 2 3 2/2 6 1/3 4 1/1 Queue: 1, 4 1-2 3 4 2 1+ 5 6 32

Practice 5 1 2 5 2 6 4 4 3 7 8 4 6 33

Recap Iterative improvement of a max-flow using augmented paths Shortest augmenting path algorithm considers both forward and backward edges to find an augmenting path The max-flow value of a network is equal to the min-cut capacity 34

Next Time... Levitin Chapter 10.3-10.4 Remember, you need to read it BEFORE you come to class! Homework: 10.1: 3, 5, 8 10.2: 1-4, 10 35