Linear Programming Data Structures and Algorithms A.G. Malamos References: Algorithms, 2006, S. Dasgupta, C. H. Papadimitriou, and U. V. Vazirani Introduction.

Slides:



Advertisements
Similar presentations
1 LP Duality Lecture 13: Feb Min-Max Theorems In bipartite graph, Maximum matching = Minimum Vertex Cover In every graph, Maximum Flow = Minimum.
Advertisements

Geometry and Theory of LP Standard (Inequality) Primal Problem: Dual Problem:
Linear Programming (LP) (Chap.29)
Transportation Problem (TP) and Assignment Problem (AP)
Introduction to Algorithms
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2002 Lecture 8 Tuesday, 11/19/02 Linear Programming.
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc
Dragan Jovicic Harvinder Singh
CS 312 – Linear Programming
Optimization of thermal processes2007/2008 Optimization of thermal processes Maciej Marek Czestochowa University of Technology Institute of Thermal Machinery.
Linear Inequalities and Linear Programming Chapter 5 Dr.Hayk Melikyan/ Department of Mathematics and CS/ Linear Programming in two dimensions:
Learning Objectives for Section 5.3
Ch 2. 6 – Solving Systems of Linear Inequalities & Ch 2
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
Linear programming Thomas S. Ferguson University of California at Los Angeles Compressive Sensing Tutorial PART 3 Svetlana Avramov-Zamurovic January 29,
The Simplex Method: Standard Maximization Problems
CS38 Introduction to Algorithms Lecture 15 May 20, CS38 Lecture 15.
1 Linear Programming Jose Rolim University of Geneva.
Linear Programming Unit 2, Lesson 4 10/13.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2006 Lecture 9 Wednesday, 11/15/06 Linear Programming.
Totally Unimodular Matrices Lecture 11: Feb 23 Simplex Algorithm Elliposid Algorithm.
Design and Analysis of Algorithms
1 Introduction to Linear and Integer Programming Lecture 9: Feb 14.
Approximation Algorithms
Chapter 10: Iterative Improvement
Finite Mathematics & Its Applications, 10/e by Goldstein/Schneider/SiegelCopyright © 2010 Pearson Education, Inc. 1 of 99 Chapter 4 The Simplex Method.
Linear Programming – Max Flow – Min Cut Orgad Keller.
Chapter 4 The Simplex Method
6  Graphing Systems of Linear Inequalities in Two Variables  Linear Programming Problems  Graphical Solutions of Linear Programming Problems  The Simplex.
LINEAR PROGRAMMING SIMPLEX METHOD.
Linear Programming David Kauchak cs161 Summer 2009.
C&O 355 Lecture 2 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A.
1 Linear Programming:Duality theory. Duality Theory The theory of duality is a very elegant and important concept within the field of operations research.
ENCI 303 Lecture PS-19 Optimization 2
Duality Theory LI Xiaolei.
Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 7.6 Linear Programming.
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:
Linear Programming Problem. Definition A linear programming problem is the problem of optimizing (maximizing or minimizing) a linear function (a function.
A LINEAR PROGRAMMING PROBLEM HAS LINEAR OBJECTIVE FUNCTION AND LINEAR CONSTRAINT AND VARIABLES THAT ARE RESTRICTED TO NON-NEGATIVE VALUES. 1. -X 1 +2X.
4  The Simplex Method: Standard Maximization Problems  The Simplex Method: Standard Minimization Problems  The Simplex Method: Nonstandard Problems.
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
1 Chapter 4 The Simplex Algorithm PART 2 Prof. Dr. M. Arslan ÖRNEK.
OR Chapter 8. General LP Problems Converting other forms to general LP problem : min c’x  - max (-c)’x   = by adding a nonnegative slack variable.
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.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
TU/e Algorithms (2IL15) – Lecture 12 1 Linear Programming.
Copyright © 2006 Brooks/Cole, a division of Thomson Learning, Inc. Linear Programming: An Algebraic Approach 4 The Simplex Method with Standard Maximization.
Approximation Algorithms Duality My T. UF.
Linear Programming Piyush Kumar Welcome to CIS5930.
Approximation Algorithms based on linear programming.
1 LP-3 Symplex Method. 2  When decision variables are more than 2, it is always advisable to use Simplex Method to avoid lengthy graphical procedure.
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.
TU/e Algorithms (2IL15) – Lecture 12 1 Linear Programming.
CS 312: Algorithm Analysis Lecture #27: Network Flow This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.Creative.
Network Topology Single-level Diversity Coding System (DCS) An information source is encoded by a number of encoders. There are a number of decoders, each.
Introduction to Linear Programming Romil Jain. The Nutrition Problem Each fruit contains different nutrients Each fruit has different cost An apple a.
Linear Programming for Solving the DSS Problems
Linear Programming Many problems take the form of maximizing or minimizing an objective, given limited resources and competing constraints. specify the.
Lap Chi Lau we will only use slides 4 to 19
Topics in Algorithms Lap Chi Lau.
The minimum cost flow problem
Perturbation method, lexicographic method
Copyright © Cengage Learning. All rights reserved.
Linear Programming Prof. Sweta Shah.
Linear Programming.
Chap 9. General LP problems: Duality and Infeasibility
Linear Programming I: Simplex method
Copyright © 2014, 2010, 2007 Pearson Education, Inc.
Flow Feasibility Problems
Presentation transcript:

Linear Programming Data Structures and Algorithms A.G. Malamos References: Algorithms, 2006, S. Dasgupta, C. H. Papadimitriou, and U. V. Vazirani Introduction to Algorithms, Cormen, Leiserson, Rivest & Stein

Intro Linear programming describes a broad class of optimization tasks in which both the constraints and the optimization criterion are linear functions. In a linear programming problem we are given a set of variables, and we want to assign real values to them so as to (1) satisfy a set of linear equations and/or linear inequalities involving these variables and (2) maximize or minimize one (or more) given linear objective function Feasible solutions are in the polyhedron that is produced by the constraints and is usually the highest point of the volume

Profit Maximization

Profit Maximization (feasible and optimal)

Feasible and optimal solution It is a general rule of linear programs that the optimum is achieved at a vertex of the feasible region. The only exceptions are cases in which there is no optimum; this can happen in two ways: 1. The linear program is infeasible; that is, the constraints are so tight that it is impossible to satisfy all of them. 2. The constraints are so loose that the feasible region is unbounded, and it is possible to achieve arbitrarily high objective values.

Variants of linear programming As evidenced in our example, a general linear program has many degrees of freedom. 1. It can be either a maximization or a minimization problem. 2. Its constraints can be equations and/or inequalities. 3. The variables are often restricted to be nonnegative, but they can also be unrestricted in sign. How can we transform on LP problem to another? By applying transformations we can reduce any LP (maximization or minimization, with both inequalities and equations, and with both nonnegative and unrestricted variables) into an LP of a much more constrained kind that we call the standard form, in which the variables are all nonnegative, the constraints are all equations, and the objective function is to be minimized.

Variants of linear programming

Important! Think theoretically with sets, graphs etc not with code and programming APIs

Examples: Production Planning

Production Planning

Optimum Bandwidth Allocation Suppose we are managing a network whose lines have the bandwidths shown in Fig. and we need to establish three connections: between users A and B, between B and C, and between A and C. Each connection requires at least two units of bandwidth, but can be assigned more. Connection A–B pays $3 per unit of bandwidth, and connections B–C and A–C pay $2 and $4, respectively. Each connection can be routed in two ways, a long path and a short path, or by a combination: for instance, two units of bandwidth via the short route, one via the long route. How do we route these connections to maximize our network's revenue?

Optimum Bandwidth Allocation This is a linear program. We have variables for each connection and each path (long or short); for example, x AB is the short-path bandwidth allocated to the connection between A and B, and x’ Ab the long-path bandwidth for this same connection. We demand that no edge‘s bandwidth is exceeded and that each connection gets a bandwidth of at least 2 units.

Optimum Bandwidth Allocation Even a tiny example like this one is hard to solve on one's own (try it!), and yet the optimal solution is obtained instantaneously via simplex: Every edge except a–-c is used at full capacity.

Assignments 1. A store has requested a manufacturer to produce shirts and trousers. For materials, the manufacturer has 750 m 2 of cotton textile and 1,000 m 2 of wool. Every pair of shirts (1 unit) needs 1 m 2 of cotton and 2 m 2 of wool. Every trouser needs 1.5 m 2 of cotton and 1 m 2 of wool. The price of the shirts is fixed at 34€ and the trousers 64€. What is the number of shirts and trousers that the manufacturer must give to the stores so that these items obtain a maximum sale? (Just Express the problems into matrix vector LP format. Do not solve it.) 2. Express 7.2, 7.3, 7.4 and 7.5 prob;lems of textbook in matrix vector LP format. Do not solve them.

The Simplex algorithm At a high level, the simplex algorithm takes a set of linear inequalities and a linear objec-tive function and finds the optimal feasible point by the following strategy: let v be any vertex of the feasible region while there is a neighbor v’ of v with better objective value: set v = v’

Simplex Pick a subset of the inequalities. If there is a unique point that satisfies them with equality, and this point happens to be feasible, then it is a vertex. Each vertex is specified by a set of n inequalities Two vertices are neighbors if they have n-1 defining inequalities in common I have reached optimality when all objective function coefficients in LP are becoming negative… ( objective function changes slope from increasing –positive coeficient to decreasing –negative coeficient)

Simplex Neighbors

Degeneracy in vertices of solution spaces in Simpex

Simplex complexity What is the running time of simplex, for a generic linear program max c T x such that Ax = =0; where there are n variables and A contains m inequality constraints? It is proved that the running time per iteration of simplex is just O(mn). But how many iterations could there be? Naturally, there can't be more than, * which is an upper bound on the number of vertices. But this upper bound is exponential in n. And in fact, there are examples of LPs for which simplex does indeed take an exponential number of iterations. In other words, simplex is an exponential-time algorithm. However, such exponential examples do not occur in practice, and it is this fact that makes simplex so valuable and so widely used. *

Flow Algorithms Figure shows a directed graph representing a network of pipelines along which oil can be sent. The goal is to ship as much oil as possible from the source s to the sink t. Each pipeline has a maximum capacity it can handle, and there are no opportunities for storing oil

Max Flow

There is just one complication. What if we had initially chosen a different path, the one in Figure 7.5(e)? This gives only one unit of flow and yet seems to block all other paths. Simplex gets around this problem by also allowing paths to cancel existing flow. In this particular case, it would subsequently choose the path of Figure 7.5(f). Edge (b; a) of this path isn't in the original network and has the effect of canceling flow previously assigned to edge (a; b). Start with zero flow. Repeat: choose an appropriate path from s to t, and increase flow along the edges of this path as much as possible. Figure 7.5(a)–(d) shows a small example in which simplex halts after two iterations. The final flow has size 2, which is easily seen to be optimal.

Max Flow – Min Cut Max-Flow min-cut theorem: The size of the maximum flow in a network equals the capacity of the smallest (s; t)-cut

Bipartite matching

Duality We have seen that maximum flow and minimum cut exactly coincide and each is therefore a certificate of the other's optimality. It turns out that every linear maximization problem has a dual minimization problem, and they relate to each other in much the same way as flows and cuts

Primal Dual Duality theorem If a linear program has a bounded optimum, then so does its dual, and the two optimum values coincide.