Linear Programming.

Slides:



Advertisements
Similar presentations
The simplex algorithm The simplex algorithm is the classical method for solving linear programs. Its running time is not polynomial in the worst case.
Advertisements

Linear Programming (LP) (Chap.29)
Introduction to Algorithms
Chapter 6 Linear Programming: The Simplex Method
The Simplex Method The geometric method of solving linear programming problems presented before. The graphical method is useful only for problems involving.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2002 Lecture 8 Tuesday, 11/19/02 Linear Programming.
1 Introduction to Linear Programming. 2 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. X1X2X3X4X1X2X3X4.
Chapter 6 Linear Programming: The Simplex Method
Water Resources Development and Management Optimization (Linear Programming) CVEN 5393 Feb 18, 2013.
Dragan Jovicic Harvinder Singh
Theory of Computing Lecture 14 MAS 714 Hartmut Klauck.
CS 312 – Linear Programming
Optimization of thermal processes2007/2008 Optimization of thermal processes Maciej Marek Czestochowa University of Technology Institute of Thermal Machinery.
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
Political problem Suppose a politician trying to win an election 3 types of areas --- urban, suburban, rural. Certain issues --- road, gun control, farm.
MAXIMUM FLOW Max-Flow Min-Cut Theorem (Ford Fukerson’s Algorithm)
Linear Inequalities and Linear Programming Chapter 5
The Simplex Method: Standard Maximization Problems
Operation Research Chapter 3 Simplex Method.
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.
Design and Analysis of Algorithms
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.
Optimization Linear Programming and Simplex Method
Chapter 4 The Simplex Method
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2008 Lecture 9 Tuesday, 11/18/08 Linear Programming.
6  Graphing Systems of Linear Inequalities in Two Variables  Linear Programming Problems  Graphical Solutions of Linear Programming Problems  The Simplex.
Chapter 19 Linear Programming McGraw-Hill/Irwin
Linear Programming - Standard Form
Chapter 6 Linear Programming: The Simplex Method
Some Key Facts About Optimal Solutions (Section 14.1) 14.2–14.16
Chapter 6 Linear Programming: The Simplex Method Section 2 The Simplex Method: Maximization with Problem Constraints of the Form ≤
Topic III The Simplex Method Setting up the Method Tabular Form Chapter(s): 4.
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Learning Objectives for Section 6.4 The student will be able to set up and solve linear programming problems.
Linear Programming Data Structures and Algorithms A.G. Malamos References: Algorithms, 2006, S. Dasgupta, C. H. Papadimitriou, and U. V. Vazirani Introduction.
Linear Programming McGraw-Hill/Irwin Copyright © 2012 by The McGraw-Hill Companies, Inc. All rights reserved.
Theory of Computing Lecture 13 MAS 714 Hartmut Klauck.
4  The Simplex Method: Standard Maximization Problems  The Simplex Method: Standard Minimization Problems  The Simplex Method: Nonstandard Problems.
Chapter 4 Linear Programming: The Simplex Method
Chapter 6 Linear Programming: The Simplex Method Section 4 Maximization and Minimization with Problem Constraints.
McGraw-Hill/Irwin © The McGraw-Hill Companies, Inc., Table of Contents CD Chapter 14 (Solution Concepts for Linear Programming) Some Key Facts.
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.
McGraw-Hill/Irwin Copyright © 2009 by The McGraw-Hill Companies, Inc. All Rights Reserved. Supplement 6 Linear Programming.
1 Introduction to Linear Programming. 2 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. X1X2X3X4X1X2X3X4.
TU/e Algorithms (2IL15) – Lecture 12 1 Linear Programming.
Maximum Flow Problem Definitions and notations The Ford-Fulkerson method.
1 Optimization Linear Programming and Simplex Method.
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.
(iii) Simplex method - I D Nagesh Kumar, IISc Water Resources Planning and Management: M3L3 Linear Programming and Applications.
TU/e Algorithms (2IL15) – Lecture 12 1 Linear Programming.
Chapter 4 The Simplex Algorithm and Goal Programming
Slide 4- 1 Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1 Copyright © 2010 Pearson Education, Inc. Publishing.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2010 Lecture 9 Tuesday, 4/20/10 Linear Programming 1.
An Introduction to Linear Programming
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.
EMGT 6412/MATH 6665 Mathematical Programming Spring 2016
LINEAR PROGRAMMING.
The minimum cost flow problem
Linear Programming (LP) (Chap.29)
Linear Programming Prof. Sweta Shah.
Linear Programming.
Linear Programming CISC4080, Computer Algorithms CIS, Fordham Univ.
Chapter 3 The Simplex Method and Sensitivity Analysis
CISC5835, Algorithms for Big Data
Chapter 2. Simplex method
Presentation transcript:

Linear Programming

An example of LP problem: Political Elections Suppose that you are a politician trying to win an election. Your district has three different types of areas: urban, suburban, and rural. These areas have, respectively, 100,000, 200,000,and 50,000 registered voters. To govern effectively, you would like to win a majority of the votes in each of the three regions. you can estimate how many votes you win or lose from each population segment by spending $1,000 on advertising on each issue.

policy urban suburban rural build roads -2 5 3 gun control 8 2 -5 farm subsidies 10 gasoline tax Figure 1: The effects of policies on voters. Each entry describes the number of thousands of urban, suburban, or rural voters who could be won over by spending $1,000 on advertising support of a policy on a particular issue. Negative entries denote votes that would be lost.

• x1 is the number of thousands of dollars spent on advertising on building roads, • x2 is the number of thousands of dollars spent on advertising on gun control, • x3 is the number of thousands of dollars spent on advertising on farm subsidies, and • x4 is the number of thousands of dollars spent on advertising on a gasoline tax. We can write the requirement that we win at least 50,000 urban votes as

Similarly, we can write the requirements that we win at least 100,000 suburban votes and 25,000 rural votes as And To minimize the expression

there is no such thing as negative-cost advertising. We format this problem as

General linear programs In the general linear-programming problem, we wish to optimize a linear function subject to a set of linear inequalities. Given a set of real numbers a1, a2, ..., an and a set of variables x1, x2,..., xn, a linear function f on those variables is defined by

are linear inequalities are linear inequalities. We use the term linear constraints to denote either linear equalities or linear inequalities. In linear programming, we do not allow strict inequalities.

A linear programming is in standard form is the maximization of a linear function subject to linear inequalitis. A linear program in slack form is the maximization of a linear function subject to linear equalities.

Let us first consider the following linear program with two variables (example 2):

We call any setting of the variables x1 and x2 that satisfies all the constraints a feasible solution to the linear program.

Figure 2: (a) The linear program given in example 2 Figure 2: (a) The linear program given in example 2. Each constraint is represented by a line and a direction. The intersection of the constraints, which is the feasible region, is shaded. (b) The dotted lines show, respectively, the points for which the objective value is 0, 4, and 8. The optimal solution to the linear program is x1 = 2 and x2 = 6 with objective value 8.

Because the feasible region in Figure 2 is bounded, there must be some maximum value z for which the intersection of the line x1 + x2 = z and the feasible region is nonempty. An optimal solution to the linear program must be on the boundary of the bounded feasible region. In this case, the point is x1 = 2 and x2 = 6 with objective value 8. An optimal solution to the linear program occurred at a vertex or a line segment of the feasible region for two variables.

This is because of the convexity of bounded feasible regions. Similarly, if the LP has n variables, each constraint defines a half-space in n-dimensional space. The feasible region formed by the intersection of these half-spaces is called a simplex. The objective function is now a hyper-plane and, because of the convexity, an optimal solution will still occur at a vertex of the simplex.

Algorithms for LP Simplex algorithm – worst case exponential-time. Practical – very simple and performance is good. Ellipsoid algorithm -- polynomial-time Interior-point method – polynomial-time.

The basic idea of simplex algorithm The simplex algorithm takes as input a linear program and returns an optimal solution. It starts at some vertex of the simplex and performs a sequence of iterations. In each iteration, it moves along an edge of the simplex from a current vertex to a neighboring vertex whose objective value is no smaller than that of the current vertex (and usually is larger.)

The simplex algorithm terminates when it reaches a local maximum, which is a vertex from which all neighboring vertices have a smaller objective value. Because the feasible region is convex and the objective function is linear, this local optimum is actually a global optimum. (What if it is non-convex or non-linear)

If we add to a linear program the additional requirement that all variables take on integer values, we have an integer linear program. It has been proven that even finding the feasible region of an integer program is NP-hard.

Standard form In standard form, we are given n real numbers c1, c2, ..., cn; m real numbers b1, b2, ..., bm; and mn real numbers aij for i = 1, 2, ..., m and j = 1, 2, ..., n. We wish to find n real numbers for n variables: x1, x2,..., xn that maximize the objective function.

We call the maximize expression above, the objective function and the n + m inequalities, the constraints, among them the n constraints, are called the non-negativity constraints.

In a more compact form for LP, let A = (aij ) be an m x n matrix b = (bi ) be an m dimensional vector c = (cj ) be an n dimensional vector x = (xj ) be an n dimensional vector We can rewrite the LP as follows:

Where cT x is inner product of two n dimensional vectors; Ax is a matrix-vector Product; x must be non-negative.

A linear program may not be in standard form for one of four possible reasons: 1. The objective function may be a minimization rather than a maximization. 2. There may be variables without non-negativity constraints. 3. There may be equality constraints, which have an equal sign rather than a less-than or -equal-to sign. 4. There may be inequality constraints, but instead of having a less-than-or-equal-to sign, they have a greater-than-or-equal-to sign.

Method to convert to Standard form: To convert a minimization linear program L into an equivalent maximization linear program L′, we simply negate the coefficients in the objective function. For example, if we have the linear program

To convert a linear program in which some of the variables do not have non-negativity constraints into one in which each variable has a non-negativity constraint. Suppose that some variable xj does not have a non-negativity constraint. Then we replace each occurrence of xj by and add the non-negativity constraints

Thus, if the objective function has a term cjxj , it is replaced by Any feasible solution x to the new linear program corresponds to a feasible solution to the original linear program with and with the same objective value, and thus the two solutions are equivalent. We apply this conversion scheme to each variable that does not have a non-negativity constraint to yield an equivalent linear program in which all variables have non-negativity constraints.

In our previous example, Variable x1 has a non-negative constraint, but variable x2 does not. To ensure that each variable has a corresponding non-negativity constraint. we replace x2 by two variables, x’2 – x’’2 then we solve the modified linear program to obtain x2 = x’2 – x’’2 .

To convert equality constraints into inequality constraints, we can replace this equality constraint by the pair of inequality constraints. Suppose that a linear program has an equality constraint f (x1, x2, ..., xn) = b. Since x = y if and only if both x ≥ y and x ≤ y, we can replace f (x1, x2, ..., xn) = b by f (x1, x2, ...,xn) ≤ b and f (x1, x2, ..., xn) ≥ b.

Finally, we can convert the greater-than-or-equal-to constraints to less-than-or-equal-to constraints by multiplying these constraints through by -1. That is, any inequality of the form

Thus, by replacing each coefficient aij by -aij and each value bi by -bi, we obtain an equivalent less-than-or-equal-to constraint. Finishing our example, we replace the equality in constraint by two inequalities, obtaining

Finally, we negate constraint Finally, we negate constraint. For consistency in variable names, we rename X’ 2 to x2 and X’’ 2 to x3, obtaining the standard form as follows:

Converting linear programs into slack form To efficiently solve a linear program with the simplex algorithm, we prefer to express it in a form in which some of the constraints are equality constraints. Let be an inequality constraint. We introduce a new variable s and rewrite inequality as the two constraints:

We call s a slack variable because it measures the slack, or difference, between the left-hand and right-hand sides of equation.

we shall use xn+i (instead of s) to denote the slack variable associated with the i th inequality. The i th constraint is therefore along with the non-negativity constraint xn+i ≥ 0.

For example, we introduce slack variables x4, x5, and x6, obtaining maximize The variables on the left-hand side of the equalities are called basic variables, and those on the right-hand side are called non-basic variables.

We shall also use the variable z to denote the value of the objective function. Thus we can concisely define a slack form by a 5-tuple (N, B, A, b, c, v), denoting the slack form

N – set of indices of nonbasic variables B – set of indices of basic variables |N|= n; |B|=m; N U B = {1,2, …, n+m} A – coefficient matrix of variables b,c – vectors; v -- constant

In this slack form, we have that B= {4,5,6}; N={1,2,3}; A = (a41, a42, a43, a51,a52, a53, a61 ,a62 , a63 ) = (-1, -1, 1, 1, 1, -1, -1 2 -2 ) b = (b4 , b5 , b6 ) = (7, -7, 4) c = (c1 , c2 , c3 ) = (2, -3, 3) v = 0

For more example, the slack form below

Examples for formulation of problems into LP Shortest paths Maximum flow Minimum-cost flow Multi-commodity flow

Shortest paths The single-pair shortest path problem: Given a weighted directed graph G = (V,E) weight function w: E  R, a source vertex s and destination vertex t, compute the value d[t], the weight of the shortest path from s to t. Note that for each edge (u,v) in E, d[v] <= d[u] + w(u,v); d[s] = 0

Shortest paths We obtain the following linear program to compute the shortest-path weight from nodes s to t: In this linear program, there are |V | variables d[v]’s, one for each vertex v in V . There are |E| + 1 constraints, one for each edge plus the additional constraint that the source vertex always has the value 0.

Maximum flow A flow network G=(V,E) is a directed graph s.t. each edge (u,v) in E has non-negative capacity c(u,v) >=0. If (u,v) not in E, then c(u,v)=0. Designate a source s and a sink t in V. G is a connected graph. A flow in G is a real-valued function f: V X V  R satisfies three properties:

Capacity constraint: for all u,v in V, f(u,v) <= c(u,v) Skew symmetry: for all u,v in V, f(u,v) <= - f(u,v) Flow conservation: for all u,v in V-{s,t}, SUMv in V f(u,v) = 0 The value of a flow f is |f| = SUMv in V f(s,v) That is the total flow out of the source s.

The maximum flow problem is defined as Given a flow network G with source s and sink t, find a flow of maximum value. Ford-Fulkerson-method initialize flow f to 0 while there exists an augmenting path p do augment flow f along p return f O(E |f*|) time, f* the maximum value found by algorithm

Maximum flow we can express the maximum-flow problem as following linear program: This linear program has |V|-2 variables, corresponding to the flow between each pair of vertices, and it has 2|V|2 + |V| - 2 constraints.

Minimum-cost flow Figure .3: (a) An example of a minimum-cost-flow problem. We denote the capacities by c and the costs by a. Vertex s is the source and vertex t is the sink, and we wish to send 4 units of flow from s to t. (b) A solution to the minimum-cost flow problem in which 4 units of flow are sent from s to t. For each edge, the flow and capacity are written as flow/capacity.

Multi-commodity flow

The real power of linear programming comes from the ability to solve new problems (not the above shortest path, maximum flow etc, which already had efficient algorithms). Such as political vote problem is new one. It is also useful to solve these problems do not have a known efficient algorithms.