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

Similar documents
Motivating examples Introduction to algorithms Simplex algorithm. On a particular example General algorithm. Duality An application to game theory

Lectures 6, 7 and part of 8

4. Duality Duality 4.1 Duality of LPs and the duality theorem. min c T x x R n, c R n. s.t. ai Tx = b i i M a i R n

CSC373: Algorithm Design, Analysis and Complexity Fall 2017 DENIS PANKRATOV NOVEMBER 1, 2017

Another max flow application: baseball

Algorithms and Theory of Computation. Lecture 13: Linear Programming (2)

CS Algorithms and Complexity

Linear Programming Duality P&S Chapter 3 Last Revised Nov 1, 2004

Linear Programming Duality

Linear Programming: Simplex

Topics in Theoretical Computer Science April 08, Lecture 8

1 Column Generation and the Cutting Stock Problem

4.6 Linear Programming duality

Resource Constrained Project Scheduling Linear and Integer Programming (1)

BBM402-Lecture 20: LP Duality

- Well-characterized problems, min-max relations, approximate certificates. - LP problems in the standard form, primal and dual linear programs

Dr. S. Bourazza Math-473 Jazan University Department of Mathematics

The Dual Simplex Algorithm

CS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs. Instructor: Shaddin Dughmi

Lecture #21. c T x Ax b. maximize subject to

Linear Programming. Linear Programming I. Lecture 1. Linear Programming. Linear Programming

Outline. Outline. Outline DMP204 SCHEDULING, TIMETABLING AND ROUTING. 1. Scheduling CPM/PERT Resource Constrained Project Scheduling Model

Integer Programming (IP)

Linear and Integer Programming - ideas

March 13, Duality 3

SECTION 5.1: Polynomials

Topic: Primal-Dual Algorithms Date: We finished our discussion of randomized rounding and began talking about LP Duality.

LINEAR PROGRAMMING I. a refreshing example standard form fundamental questions geometry linear algebra simplex algorithm

Fundamentals of Operations Research. Prof. G. Srinivasan. Indian Institute of Technology Madras. Lecture No. # 15

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

Chapter 1 Linear Programming. Paragraph 5 Duality

F 1 F 2 Daily Requirement Cost N N N

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

Ω R n is called the constraint set or feasible set. x 1

Lecture slides by Kevin Wayne

CSC Design and Analysis of Algorithms. LP Shader Electronics Example

CS 6820 Fall 2014 Lectures, October 3-20, 2014

4.5 Simplex method. LP in standard form: min z = c T x s.t. Ax = b

Planning and Optimization

IE 5531: Engineering Optimization I

Chapter 5 Linear Programming (LP)

Dual fitting approximation for Set Cover, and Primal Dual approximation for Set Cover

1 T 1 = where 1 is the all-ones vector. For the upper bound, let v 1 be the eigenvector corresponding. u:(u,v) E v 1(u)

MVE165/MMG631 Linear and integer optimization with applications Lecture 5 Linear programming duality and sensitivity analysis

Note 3: LP Duality. If the primal problem (P) in the canonical form is min Z = n (1) then the dual problem (D) in the canonical form is max W = m (2)

CS675: Convex and Combinatorial Optimization Fall 2016 Combinatorial Problems as Linear and Convex Programs. Instructor: Shaddin Dughmi

Linear Programming: Chapter 5 Duality

Optimization (168) Lecture 7-8-9

III. Linear Programming

Sensitivity Analysis and Duality in LP

1 Primals and Duals: Zero Sum Games

Lecture 9 Tuesday, 4/20/10. Linear Programming

Lecture Note 18: Duality

The use of shadow price is an example of sensitivity analysis. Duality theory can be applied to do other kind of sensitivity analysis:

3. Duality: What is duality? Why does it matter? Sensitivity through duality.


1 The linear algebra of linear programs (March 15 and 22, 2015)

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

COMP3121/9101/3821/9801 Lecture Notes. Linear Programming

Integer programming: an introduction. Alessandro Astolfi

Integer Linear Programs

UNIT-4 Chapter6 Linear Programming

DEPARTMENT OF STATISTICS AND OPERATIONS RESEARCH OPERATIONS RESEARCH DETERMINISTIC QUALIFYING EXAMINATION. Part I: Short Questions

1 Review Session. 1.1 Lecture 2

An example of LP problem: Political Elections

SAMPLE QUESTIONS. b = (30, 20, 40, 10, 50) T, c = (650, 1000, 1350, 1600, 1900) T.

C&O 355 Mathematical Programming Fall 2010 Lecture 18. N. Harvey

END3033 Operations Research I Sensitivity Analysis & Duality. to accompany Operations Research: Applications and Algorithms Fatih Cavdur

Optimization WS 13/14:, by Y. Goldstein/K. Reinert, 9. Dezember 2013, 16: Linear programming. Optimization Problems

Today: Linear Programming (con t.)

Part 1. The Review of Linear Programming

Multicommodity Flows and Column Generation

Duality of LPs and Applications

CO759: Algorithmic Game Theory Spring 2015

Advanced Algorithms 南京大学 尹一通

Chapter 3, Operations Research (OR)

Exercises - Linear Programming

A Strongly Polynomial Simplex Method for Totally Unimodular LP

TRANSPORTATION PROBLEMS

Introduction to Semidefinite Programming I: Basic properties a

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

The simplex algorithm

The Simplex Algorithm

Optimization methods NOPT048

Supplementary lecture notes on linear programming. We will present an algorithm to solve linear programs of the form. maximize.

ECE 307- Techniques for Engineering Decisions

2. Linear Programming Problem

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

Linear Programming. Jie Wang. University of Massachusetts Lowell Department of Computer Science. J. Wang (UMass Lowell) Linear Programming 1 / 47

Linear Programming. Scheduling problems

Integer Linear Programming (ILP)

Section Notes 9. IP: Cutting Planes. Applied Math 121. Week of April 12, 2010

MATH 445/545 Test 1 Spring 2016

CSC304: Algorithmic Game Theory and Mechanism Design Fall 2016

Yinyu Ye, MS&E, Stanford MS&E310 Lecture Note #06. The Simplex Method

1 Integer Decomposition Property

Review Solutions, Exam 2, Operations Research

Mathematical Programs Linear Program (LP)

THE UNIVERSITY OF HONG KONG DEPARTMENT OF MATHEMATICS. Operations Research I

3.3 Easy ILP problems and totally unimodular matrices

Transcription:

COT 6936: Topics in Algorithms! Giri Narasimhan ECS 254A / EC 2443; Phone: x3748 giri@cs.fiu.edu https://moodle.cis.fiu.edu/v2.1/course/view.php?id=612

Gaussian Elimination! Solving a system of simultaneous equations x 1-2x 3 = 2 x 2 + x 3 = 3 x 1 + x 2 - x 4 = 4 x 2 + 3x 3 + x 4 = 5 O(n 3 ) algorithm x 1-2x 3 = 2 x 2 + x 3 = 3 x 2 + 2x 3 - x 4 = 2 x 2 + 3x 3 + x 4 = 5

Linear Programming! Want more than solving simultaneous equations We have an objective function to optimize

Chocolate Shop [DPV book]! 2 kinds of chocolate milk [Profit: $1 per box] [Demand: 200] Deluxe [Profit: $6 per box] [Demand: 300] Production capacity: 400 boxes Goal: maximize profit Maximize x 1 + 6x 2 subject to constraints: x 1 200 x 2 300 x 1 + x 2 400 x 1, x 2 0

Diet Problem! Food type: Nutrients: F 1,,F m N 1,,N n Min daily requirement of nutrients: c 1,,c n Price per unit of food: b 1,,b m Nutrient N j in food F i : a ij Problem: Supply daily nutrients at minimum cost Min Σ i b i x i Σ i a ij x i c j x i 0 for 1 j n

Transportation Problem! Ports or Production Units: P 1,,P m Markets to be shipped to: M 1,,M n Min daily market need: r 1,,r n Port/production capacity: s 1,,s m Cost of transporting to M j from port P i : a ij Problem: Meet market need at minimum transportation cost

Workers: b 1,,b n Jobs: g 1,,g m Assignment Problem! Value of assigning person b i to job g j : a ij Problem: Choose job assignment to maximize value

Bandwidth Allocation Problem! Need: A B 2 units B C 2 units C A 2 units Connections: Short route Long route Revenue: A B pays $3 per unit B C pays $2 per unit C A pays $4 per unit

Bandwidth Allocation Problem! Maximize revenue by allocating bandwidth to connections along two routes without exceeding bandwidth capacities Max 3(x AB +x AB ) + 2(x BC +x BC ) + 4(x AC +x AC ) s.t. x AB + x AB + x BC + x BC 10 x AB + x AB + x AC + x AC 12 x BC + x BC + x AC + x AC 8 x AB + x BC + x AC 6; x AB + x AB 2; x BC + x BC 2 x AB + x BC + x AC 13; x AC + x AC 2 x AB + x BC + x AC 11;& all nonneg constraints

Standard LP! Maximize Σc j x j [Objective Function] Subject to Σa ij x j b j [Constraints] and x j 0 [Nonnegativity Constraints] Matrix formulation of LP Maximize c T x Subject to Ax b and x 0

Converting to standard form! Min -2x 1 + 3x 2 Subject to x 1 + x 2 = 7 x 1 2x 2 4 x 1 0 Max 2x 1-3x 2 Subject to x 1 + x 2 7 -x 1 - x 2-7 x 1 2x 2 4 x 1 0

Converting to standard form! Max 2x 1-3x 2 Subject to x 1 + x 2 7 -x 1 - x 2-7 x 1 2x 2 4 x 1 0 Max 2x 1 3(x 3 - x 4 ) Subject to x 1 + x 3 - x 4 7 -x 1 (x 3 - x 4 ) -7 x 1 2(x 3 - x 4 ) 4 x 1, x 3, x 4 0 x 2 is not constrained to be non-negative

Converting to Standard form! Max 2x 1 3x 2 + 3x 3 Subject to x 1 + x 2 x 3 7 -x 1 x 2 + x 3-7 x 1 2x 2 2x 3 4 x 1, x 2, x 3 0

Slack Form! Max 2x 1 3x 2 + 3x 3 Subject to x 1 + x 2 x 3 7 -x 1 x 2 + x 3-7 x 1 2x 2 2x 3 4 x 1, x 2, x 3 0 Max 2x 1 3x 2 + 3x 3 Subject to x 1 + x 2 x 3 + x 4 = 7 -x 1 x 2 + x 3 + x 5 = -7 x 1 2x 2 2x 3 + x 6 = 4 x 1, x 2, x 3, x 4, x 5, x 6 0

Duality! Max c T x Subject to Ax b and x 0 [Primal] Min y T b Subject to y T A c and y 0 [Dual]

Understanding Duality! Maximize x 1 + 6x 2 subject to constraints: x 1 200 (1) x 2 300 (2) x 1 + x 2 400 (3) x 1, x 2 0 (100,300) is feasible; value = 1900. Optimum? Adding 1 times (1) + 6 times (2) gives us x 1 + 6x 2 2000 How were mutipliers determined? Adding 1 times (3) + 5 times (2) gives us x 1 + 6x 2 1900 Certificate of Optimality for solution (100,300)

Understanding Duality! Maximize x 1 + 6x 2 subject to: x 1 200 (y 1 ) x 2 300 (y 2 ) [(100,300)] x 1 + x 2 400 (y 3 ) x 1, x 2 0 Different choice of multipliers gives us different bounds. We want smallest bound. Minimize 200y 1 + 300y 2 + 400y 3 subject to: y 1 + y 3 1 (x 1 ) y 2 + y 3 6 (x 2 ) [(0,5,1)] y 1, y 2 0

Duality Principle! Primal feasible values dual feasible values Max primal value = min dual value Duality Theorem: If a linear program has a bounded optimal value then so does its dual and the two optimal values are equal.

Shortest Path Problem as a LP! Graph G = (V,E); Vertices: v 1,,v n ; Edges: e 1,,e m ; Weight function on edges w(e i ); Source s; Dest t; LP: min w T x s.t. A x = b and x 0 Here A and b are defined as follows: A ij = +1 if e j leaves v i ; b s = +1 = -1 if e j enters v i ; b t = -1 = 0 otherwise; b i = 0 else; We want integral solutions for x

LP: min w T x Dual LP! s.t. A x = b and x 0 Dual LP: max y s -y t s.t. y u - y v w(e) for every edge e = (u,v)

Visualizing Duality! Shortest Path Problem Build a physical model and between each pair of vertices attach a string of appropriate length To find shortest path from s to t, hold the two vertices and pull them apart as much as possible without breaking the strings This is exactly what a dual LP solves! Max x s -x t subject to x u -x v w uv for every edge (u.v) The taut strings correspond to the shortest path, i.e., they have no slack

Linear Constraints: Geometric View! 2,3,7 1,3,7 i.e., some inequalities satisfied as equalities Vertex: point where n hyperplanes meet; Neighbor: vertices sharing n-1 hyperplanes

Simplex Algorithm! Start at v, any vertex of feasible region while (there is neighbor v of v with better objective value) do set v = v Report v as optimal point and its value as optimal value What is a Vertex?, neighbor? Start vertex? How to pick next neighbor?

Steps of Simplex Algorithm! In order to find next neighbor from arbitrary vertex, we do a change of origin (pivot)

Simplex Algorithm Example!

Simplex Algorithm Example!

Simplex Algorithm Example!

Simplex Algorithm: Degenerate vertices! i.e., some inequalities satisfied as equalities 2,3,4,5 2,3,7 1,3,7 Vertex: point where n hyperplanes meet; Neighbor: vertices sharing n-1 hyperplanes

Polynomial-time algorithms for LP! Simplex is not poly-time in the worst-case Khachiyan s ellipsoid algorithm: LP is in P Karmarkar s interior-point algorithm Good implementations for LP exist Works very well in practice More competitive than the poly-time methods for LP

Integer Linear Programming! LP with integral solutions NP-hard If A is a totally unimodular matrix, then the LP solution is always integral. A TUM is a matrix for which every nonsingular submatrix has determinant 0, +1 or -1. A TUM is a matrix for which every nonsingular submatrix has integral inverse.

Vertex Cover as an LP?! For vertex v, create variable x v For edge (u,v), create constraint x u + x v 1 Objective function: Σx v Additional constraints: x v 1 Doesn t work because x v needs to be from {0,1}

Integer Linear Programming! LP with integral solutions NP-hard If A is a totally unimodular matrix, then the LP solution is always integral. A TUM is a matrix for which every nonsingular submatrix has determinant 0, +1 or -1. A TUM is a matrix for which every nonsingular submatrix has integral inverse.

Vertex Cover as an LP?! For vertex v, create variable x v For edge (u,v), create constraint x u + x v 1 Objective function: Σx v Additional constraints: x v 1 Doesn t work because x v needs to be from {0,1}

Set Cover! Given a universe of items U = {e 1,, e n } and a collection of subsets S = {S 1,, S m } such that each S i is contained in U Find the minimum set of subsets from S that will cover all items in U (i.e., the union of these subsets must equal U) Weighted Set Cover: Given universe U and collection S, and a cost c(s i ) for each subset S i in S, find the minimum cost set cover

Fractional LP may have higher objective U = {e, f, g} S 1 = {e, f} S 2 = {f, g} S 3 = {e, g} function value than integer LP! Optimal set cover = {S 1, S 2 } Fractional optimal set cover assigns ½ to each of three sets giving a total optimal value of 3/2.

K-Approximation Alg using Dual Fitting! Ratio to be bounded by K 0 Value of Greedy solution Value of Dual Feasible solution obtained from greedy solution Value of Optimal ILP solution Value of Primal Optimal LP solution = Value of Dual Optimal LP solution

Rounding Algorithm for Set Cover! Algorithm Find an optimal solution to the LP Relaxation Pick all sets S for which x S 1/f in this solution f = frequency of most frequent item Analysis Is the resulting solution a valid set cover? How good is the solution? How close is to the optimal set cover?

Analysis of Rounding Algorithm!