An example of LP problem: Political Elections

Similar documents
29 Linear Programming

III. Linear Programming

Today: Linear Programming

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

CSC Design and Analysis of Algorithms. LP Shader Electronics Example

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

The simplex algorithm

An introductory example

Types of Networks. Internet Telephone Cell Highways Rail Electrical Power Water Sewer Gas

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

Flow Network. The following figure shows an example of a flow network:

Network Flows. CS124 Lecture 17

Graph Algorithms -2: Flow Networks. N. H. N. D. de Silva Dept. of Computer Science & Eng University of Moratuwa

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

CS 1501 Recitation. Xiang Xiao

Exercises - Linear Programming

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

10 Max-Flow Min-Cut Flows and Capacitated Graphs 10 MAX-FLOW MIN-CUT

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

Introduction to Algorithms

Algorithms and Theory of Computation. Lecture 11: Network Flow

6.046 Recitation 11 Handout

Maximum Flow Problem (Ford and Fulkerson, 1956)

We say that a flow is feasible for G (or just feasible if the graph and capacity function in question are obvious) if

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

Linear programs, convex polyhedra, extreme points

Algorithms: Lecture 12. Chalmers University of Technology

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

Internet Routing Example

Network Flows. 7. Multicommodity Flows Problems. Fall 2010 Instructor: Dr. Masoud Yaghini

Lesson 27 Linear Programming; The Simplex Method

Linear Programming Duality

A Review of Linear Programming

x 1 + 4x 2 = 5, 7x 1 + 5x 2 + 2x 3 4,

3. Vector spaces 3.1 Linear dependence and independence 3.2 Basis and dimension. 5. Extreme points and basic feasible solutions

Review Questions, Final Exam

Another max flow application: baseball

Duality of LPs and Applications

16.1 Min-Cut as an LP

Integer programming: an introduction. Alessandro Astolfi

6.854 Advanced Algorithms

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

u = 50 u = 30 Generalized Maximum Flow Problem s u = 00 2 u = 00 u = 50 4 = 3=4 u = 00 t capacity u = 20 3 u = 20 = =2 5 u = 00 gain/loss factor Max o

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

Linear programming: algebra

Optimization (168) Lecture 7-8-9

Energy minimization via graph-cuts

Mathematics for Decision Making: An Introduction. Lecture 13

Multicommodity Flows and Column Generation

CMPSCI 611: Advanced Algorithms

IP Cut Homework from J and B Chapter 9: 14, 15, 16, 23, 24, You wish to solve the IP below with a cutting plane technique.

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

Discrete Optimization

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

Chapter 5 Linear Programming (LP)

BBM402-Lecture 20: LP Duality

Network Flows. CTU FEE Department of control engineering. March 28, 2017

Network Flows. 6. Lagrangian Relaxation. Programming. Fall 2010 Instructor: Dr. Masoud Yaghini

Introduction to Linear and Combinatorial Optimization (ADM I)

Duality. Peter Bro Mitersen (University of Aarhus) Optimization, Lecture 9 February 28, / 49

Slack Variable. Max Z= 3x 1 + 4x 2 + 5X 3. Subject to: X 1 + X 2 + X x 1 + 4x 2 + X X 1 + X 2 + 4X 3 10 X 1 0, X 2 0, X 3 0

Discrete Optimization Lecture 5. M. Pawan Kumar

SOLVING INTEGER LINEAR PROGRAMS. 1. Solving the LP relaxation. 2. How to deal with fractional solutions?

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

Lecture 8 Network Optimization Algorithms

Section 4.2 Polynomial Functions of Higher Degree

Input: System of inequalities or equalities over the reals R. Output: Value for variables that minimizes cost function

4.6 Linear Programming duality

Lecture 2: The Simplex method. 1. Repetition of the geometrical simplex method. 2. Linear programming problems on standard form.

Network Flow Problems Luis Goddyn, Math 408

Maximum flow problem CE 377K. February 26, 2015

CSE 326: Data Structures Network Flow. James Fogarty Autumn 2007

IE 5531: Engineering Optimization I

CS Algorithms and Complexity

The min cost flow problem Course notes for Optimization Spring 2007

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

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

directed weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time

Section 4.1 Solving Systems of Linear Inequalities

UNIT-4 Chapter6 Linear Programming

Running Time. Assumption. All capacities are integers between 1 and C.

Optimization - Examples Sheet 1

OPERATIONS RESEARCH. Linear Programming Problem

1 Primals and Duals: Zero Sum Games

The Graphical Method & Algebraic Technique for Solving LP s. Métodos Cuantitativos M. En C. Eduardo Bustos Farías 1

Maximum Flow. Reading: CLRS Chapter 26. CSE 6331 Algorithms Steve Lai

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

Sensitivity Analysis and Duality

1 Review for Lecture 2 MaxFlow

Maximum flow problem (part I)

Discrete Optimization 23

Operations Research Lecture 2: Linear Programming Simplex Method

Professor Alan H. Stein October 31, 2007

Lecture notes on the ellipsoid algorithm

Understanding the Simplex algorithm. Standard Optimization Problems.

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

Chapter 7 Network Flow Problems, I

7. Lecture notes on the ellipsoid algorithm

15-780: LinearProgramming

II. Analysis of Linear Programming Solutions

Transcription:

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 0 0 10 gasoline tax 10 0-2 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. 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 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. 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 exponentialtime. 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 NPhard.

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 = (a ij ) be an m x n matrix b = (b i ) be an m dimensional vector c = (c j ) be an n dimensional vector x = (x j ) be an n dimensional vector We can rewrite the LP as follows:

Where c T 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 nonnegativity constraint. Then we replace each occurrence of xj by and add the nonnegativity 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 nonnegativity constraints.

In our previous example, Variable x1 has a nonnegative 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 greaterthan-or-equal-to constraints to lessthan-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 lessthan-or-equal-to constraint. Finishing our example, we replace the equality in constraint by two inequalities, obtaining

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 = (a 41, a 42, a 43, a 51, a 52, a 53, a 61, a 62, a 63 ) = (-1, -1, 1, 1, 1, -1, -1 2-2 ) b = (b 4, b 5, b 6 ) = (7, -7, 4) c = (c 1, c 2, c 3 ) = (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}, SUM v in V f(u,v) = 0 The value of a flow f is f = SUM v 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.