Linear Programming and Simplex Algorithm Reference: Numerical Recipe Sec. 10.8.

Slides:



Advertisements
Similar presentations
Duality for linear programming. Illustration of the notion Consider an enterprise producing r items: f k = demand for the item k =1,…, r using s components:
Advertisements

1 LP Duality Lecture 13: Feb Min-Max Theorems In bipartite graph, Maximum matching = Minimum Vertex Cover In every graph, Maximum Flow = Minimum.
Geometry and Theory of LP Standard (Inequality) Primal Problem: Dual Problem:
Solving LP Models Improving Search Special Form of Improving Search
EMGT 501 HW #1 Solutions Chapter 2 - SELF TEST 18
Linear Programming Simplex Method
Introduction to Algorithms
Linear Programming (graphical + simplex with duality) Based on Linear optimization in application by Sui lan Tang. Linear Programme (LP) for Optimization.
Chapter 5 The Simplex Method The most popular method for solving Linear Programming Problems We shall present it as an Algorithm.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2002 Lecture 8 Tuesday, 11/19/02 Linear Programming.
Dragan Jovicic Harvinder Singh
The Simplex Method and Linear Programming Duality Ashish Goel Department of Management Science and Engineering Stanford University Stanford, CA 94305,
Linear Programming?!?! Sec Linear Programming In management science, it is often required to maximize or minimize a linear function called an objective.
How should we define corner points? Under any reasonable definition, point x should be considered a corner point x What is a corner point?
Linear Programming Fundamentals Convexity Definition: Line segment joining any 2 pts lies inside shape convex NOT convex.
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
Chapter 6 Linear Programming: The Simplex Method Section 3 The Dual Problem: Minimization with Problem Constraints of the Form ≥
The Most Important Concept in Optimization (minimization)  A point is said to be an optimal solution of a unconstrained minimization if there exists no.
Linear programming Thomas S. Ferguson University of California at Los Angeles Compressive Sensing Tutorial PART 3 Svetlana Avramov-Zamurovic January 29,
CS38 Introduction to Algorithms Lecture 15 May 20, CS38 Lecture 15.
1 Linear Programming Jose Rolim University of Geneva.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2006 Lecture 9 Wednesday, 11/15/06 Linear Programming.
1 Introduction to Linear and Integer Programming Lecture 9: Feb 14.
Introduction to Linear and Integer Programming Lecture 7: Feb 1.
Fall 2006, Sep. 5 and 7 ELEC / Lecture 4 1 ELEC / (Fall 2006) Low-Power Design of Electronic Circuits (Formerly ELEC / )
Dual Problem of Linear Program subject to Primal LP Dual LP subject to ※ All duality theorems hold and work perfectly!
Approximation Algorithms
Chapter 10: Iterative Improvement
7(2) THE DUAL THEOREMS Primal ProblemDual Problem b is not assumed to be non-negative.
Unconstrained Optimization Problem
5.6 Maximization and Minimization with Mixed Problem Constraints
Linear-Programming Applications
Algebra 2 Chapter 3 Notes Systems of Linear Equalities and Inequalities Algebra 2 Chapter 3 Notes Systems of Linear Equalities and Inequalities.
Algebra 2 Chapter 3 Notes Systems of Linear Equalities and Inequalities Algebra 2 Chapter 3 Notes Systems of Linear Equalities and Inequalities.
C&O 355 Lecture 2 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A.
Linear Programming Chapter 13 Supplement.
Duality Theory 對偶理論.
STDM - Linear Programming 1 By Isuru Manawadu B.Sc in Accounting Sp. (USJP), ACA, AFM
Public Policy Modeling Simplex Method Tuesday, October 13, 2015 Hun Myoung Park, Ph.D. Public Management & Policy Analysis Program Graduate School of International.
1 Chapter 7 Linear Programming. 2 Linear Programming (LP) Problems Both objective function and constraints are linear. Solutions are highly structured.
Chapter 6 Linear Programming: The Simplex Method Section R Review.
Systems of Inequalities in Two Variables Sec. 7.5a.
Duality Theory  Every LP problem (called the ‘Primal’) has associated with another problem called the ‘Dual’.  The ‘Dual’ problem is an LP defined directly.
TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A A A A A A A Image:
Chapter 6 Linear Programming: The Simplex Method Section 3 The Dual Problem: Minimization with Problem Constraints of the Form ≥
Linear Programming Erasmus Mobility Program (24Apr2012) Pollack Mihály Engineering Faculty (PMMK) University of Pécs João Miranda
Machine Learning Weak 4 Lecture 2. Hand in Data It is online Only around 6000 images!!! Deadline is one week. Next Thursday lecture will be only one hour.
Chapter 3 Linear Programming Methods
Part 3 Linear Programming 3.3 Theoretical Analysis.
C&O 355 Mathematical Programming Fall 2010 Lecture 5 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A.
CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.
OR Chapter 7. The Revised Simplex Method  Recall Theorem 3.1, same basis  same dictionary Entire dictionary can be constructed as long as we.
Sullivan Algebra and Trigonometry: Section 12.9 Objectives of this Section Set Up a Linear Programming Problem Solve a Linear Programming Problem.
Linear Programming Piyush Kumar Welcome to CIS5930.
Business Mathematics MTH-367 Lecture 14. Last Lecture Summary: Finished Sec and Sec.10.3 Alternative Optimal Solutions No Feasible Solution and.
1 Simplex algorithm. 2 The Aim of Linear Programming A Linear Programming model seeks to maximize or minimize a linear function, subject to a set of linear.
Part 3 Linear Programming 3.3 Theoretical Analysis.
1 Chapter 4 Geometry of Linear Programming  There are strong relationships between the geometrical and algebraic features of LP problems  Convenient.
EMGT 6412/MATH 6665 Mathematical Programming Spring 2016
Solving Linear Program by Simplex Method The Concept
Chapter 5 The Simplex Method
The minimum cost flow problem
Duality for linear programming.
Chap 9. General LP problems: Duality and Infeasibility
The Simplex Method: Standard Minimization Problems
Chapter 5. Sensitivity Analysis
3-3 Optimization with Linear Programming
CS5321 Numerical Optimization
Chapter 10: Iterative Improvement
Linear Constrained Optimization
Presentation transcript:

Linear Programming and Simplex Algorithm Reference: Numerical Recipe Sec. 10.8

2 Content Linear programming problems Simplex algorithm QSOpt solver LP Applications –Collision detection –Melodic similarity –Underdetermined linear systems

3 The Diet Problem Dietician preparing a diet consisting of two foods, A and B. CostProteinFatCarbohydrate A B Minimum requirement: protein 60g; fat 24g; carbohydrate 30g Looking for minimum cost diet

4 Linear Programming subject to Cp. NLP

5 The Problem Maximize Subject to N: dimension of x M: number of constraints (M = m 1 +m 2 +m 3 ) N: dimension of x M: number of constraints (M = m 1 +m 2 +m 3 )

6 Theory of Linear Optimization Terminology: Feasible vector Feasible basic vector Optimal feasible vector

7 Theory (cont) Feasible region is convex and bounded by hyperplanes Feasible vectors that satisfy N of the original constraints as equalities are termed feasible basic vectors. Optimal occur at boundary (gradient vector of objective function is always nonzero) Combinatorial problem: determining which N constraints (out of the N+M constraints) would be satisfied by the optimal feasible vector

8 Simplex Algorithm (Dantzig 1948) A series of combinations is tried to increase the objective function Number of iterations less than O(max(M,N)) Worst case complexity is exponential (in number of variables); yet has polynomial smoothed complexity (and works well in practice)

9 The Canonical Problem Maximize Subject to N: dimension of x M: number of constraints (M = m 1 +m 2 +m 3 ) N: dimension of x M: number of constraints (M = m 1 +m 2 +m 3 ) I. II. III.

11 QSopt [ref]ref Contains a GUI and a callable library

12 LP Format Example Problem smallExample Minimize obj: 0.60x x2 Subject to c1: 12x1 + 6x2 >= 24 30x1 + 15x2 >= 30 Bounds 0 <= x1 0 <= x2 End Somehow x1 >= 0 x2 >= 0 Doesn’t work!? BNF BNF for QSOpt scripts

QSOpt Examples 13

14 Duality Primal problemDual problem

15

16 Duality If a linear program has a finite optimal solution then so does the dual. Furthermore, the optimal values of the two programs are the same. If either problem has an unbounded optimal solution, then the other problem has no feasible solutions.

17 Diet Problem

Applications

19 The Problem Under-determined system (infinite number of solutions) Find the solution with minimum magnitude (i.e., closest to origin)

20 Example Approach 1: find complete solution (-2,0,0) subtract its projection along (1,-1,1) (1,-1,1) (-2,0,0)

21 Linear Programming Solution Most simplex algorithm assume nonnegative variables Set

22 Example

23 Solved by QSopt The real minimum (-4/3, -2/3, 2/3) The LP constraint is not exactly ||x|| 2 (but ||x||  ) This problem can also be solved by SVD (singular value decomposition)

24 LP in CD (narrow phase, ref)ref A pair of convex objects: each facet represented by the plane inequality a i x+b i y+c i z  d i If two sets of inequality (from two convex objects) define a feasible region, then a collision is detected The type of optimization (min|max) and the objective function used is irrelevant.

25 LP for CD Convert to dual problem for better efficiency(?!)

Transportation Distance as a Measure to Melodic Similarity Ref: Typke et al. 2003Typke et al. 2003

27 Example Partially matched

28 Earth Mover Distance

29 EMD as Linear Program Solve by simplex algorithm

30 EMD for Melodic Similarity Ground distance: Euclidean distance Scale time coordinate (so that they are comparable) Transposition: transpose one of the melodies so that the weighted average pitch is equal (not optimum but acceptable)

31 HW: Verify planar CD using LP Warning: Non-negative assumption (for some solvers)!! Warning: Non-negative assumption (for some solvers)!!

32 Verify planar CD using LP

33 LP Solvers Lp_solve: MILP QSopt GLPK

35 QSopt [ref]ref Contains a GUI and a callable library

36 LP Format Example Problem smallExample Minimize obj: 0.60x x2 Subject to c1: 12x1 + 6x2 >= 24 30x1 + 15x2 >= 30 Bounds 0 <= x1 0 <= x2 End [weird] Somehow x1 >= 0 x2 >= 0 Doesn’t work!?

37 LP format BNF definition 1

38 LP format BNF definition 2

QSOpt API

40 Scenario: Read and Solve

41 Accessing a Solution value: objective function x: solution vector (columns) pi: dual variables slack: slack variables rc: reduced cost In our applications, we don’t really care about pi, slack, and rc. Set them to NULL

42 # of nonzeros in jth column Location of start entry cmatind QS_MAX or QS_MIN

43 Modify an LP Problem QSnew_row QSadd_rows QSnew_col QSadd_cols QSdelete_row QSdelete_col QSchange_coef QSchange_objcoef QSchange_rhscoef QSchange_sense See reference manuals for more details (Ch.5) Use QSwrite_prob to verify the change