ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of...

23
ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002

Transcript of ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of...

Page 1: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

ECE 556Linear Programming

Ting-Yuan Wang

Electrical and Computer EngineeringUniversity of Wisconsin-Madison

March 4. 2002

Page 2: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

Outline: Related Courses:

CS525 Linear Programming CS726 Nonlinear Programming Theory and

Applications CS730 Nonlinear Programming Algorithms

Jordan Exchange Linear Programming (Simplex Method)

Phase II Phase I

Page 3: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

Jordan Exchange ( pivot operation)

,m,,ixAxAxAy niniii 21 2211

variablesdependent :

st variableindependen :

iy

xj

Consider a linear system of m equations:

Page 4: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

mnmsm1

rnrsr1

1n1s111

ns1

A A A

A A A

A A A

x x x

m

r

y

y

y

Tableau Form

Page 5: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

A Jordan exchange with pivot Ars is the process of interchanging the dependent variable yr and the independent variables xs.

Process:1. Solve the rth equation for xs in terms of x1,

x2, …, xs-1, yr, xs+1,…,xn. Note Ars ≠ 02. Substitute for xs in the remaining equations3. Write the new system in a new tableau form

Page 6: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

)(

1

rjisij

rj

rs

is

ijij

rs

is

is

rs

rj

rj

rs

rs

ABA

AA

AAB

A

AB

A

AB

AB

mnmsm1

1

rnrsr1s

1

1n1s111

n1sr1-s1

B B B

B B B x

B B B

x xy x x

m

r

r

y

y

y

y

Tableau Form

Page 7: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

The Simplex MethodA linear program (or a linear programming problem) is the problem of minimizing (or maximizing) a linear function subject to linear inequalities and linear equalities.The Simplex Method: First find a feasible vertex of the standard linear program. If none exists, the problem is infeasible. Starting at this feasible vertex, move to the adjacent vertex such that the objective function z strictly decreases. If no such adjacent vertex exists, then stop, the current vertex is a solution of the problem or the objective is unbounded.

Page 8: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

LP standard form:

0 ,

:

'0' min,

NB

NB

BNXNXB

xx

bAx xtosubject

xxpz

Objective function

Constraints

Bounds0

x

b to: Axsubject

p'xz (Max): Min

LP canonical form:

Variables Basic },,2,1{

Variables basic-Non },,2,1{

mnnnB

nN

Page 9: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

Tableau form

0 p

b- A A

b- A A

1

n1

mmnm1

11n111

1

pz

x

x

xx

mn

n

n

Basic variables(slack variables)

Non-basic variables

feasible:b 0

Page 10: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

Example 1

Minimize:

Subject to:

0,

234

134

1

02

12

63

21

21

21

21

21

21

21

xx

xx

xx

xx

xx

xx

xx X1 X2 1

X3 = 1 2 1

X4 = 2 1 0

X5 = 1 -1 1

X6 = 1 -4 13

X7 = -4 1 23

Z 3 -6 0

TableauForm

Page 11: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

Pivot Selection Rules

1. Pricing (Pivot Column s Selection ): The pivot column is any column s with a negative element in the bottom row. We choose the most negative element as pivot column, which gives the most steepest local descent in the objective function z.

2. Ratio Test (Pivot Row r Selection ): The pivot row is any row r such that

}0{min is

is

i

i

rs

r HH

h

H

h

Page 12: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

X1 X5 1

X3 = 3 -2 3

X4 = 3 -1 1

X2 = 1 -1 1

X6 = -3 4 9

X7 = -3 -1 24

Z -3 6 -6

X6 X5 1

X3 = -1 2 12

X4 = -1 3 10

X2 = -1/3 1/3 4

X1 = -1/3 4/3 3

X7 = 1 -5 15

Z 1 2 -15

Pivot (X1,X5) Pivot (X1,X6)

Page 13: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

Geometric Illustration

Vertex 1: N{1,2}

Vertex 3: N{5,6}

Vertex 2: N{1,5}

X1=0

X2=0

Feasible region

X7=0

X5=0

X3=0

X4=0

X6=0

Z=-6

Z=0

Page 14: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

Phase II Procedure

1. Formulate the problem into standard form.2. Create an initial feasible tableau.3. Determine the pivot column s by pricing rule.

If none exists, then tableau is optimal.4. Determine the pivot row r by ratio test. If none

exists, then tableau is unbounded.5. Exchange XB and XN using Jordan exchange

on Hrs.6. Go to step (3).

Page 15: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

Example 2

X1 X5 X7 X4

X2= -0.333 -0.333 0 0.333 1.333

X6= -1.667 0.333 0 0.333 1.667

X3= 0.083 0.083 -0.250 -0.167 0.417

Z= -0.750 1.25 0.250 0.500 -5.750X1 X2 X3 X4

X5= -1 -3 0 -1 4

X6= -2 -1 0 0 3

X7= 0 -1 -4 -1 3

Z= -2 -4 -1 -1 0

X1 X5 X3 X4

X2= 0.333 -0.333 0 -0.333 1.333

X6= -1.667 0.333 0 0.333 1.667

X7= 0.333 0.333 -4 -0.667 1.667

Z= -0.667 1.333 -1 0.333 -5.333

X1 X5 X7 X4

X2= 0.2 -0.4 0 0.4 1

X6= -0.6 0.2 0 0.2 1

X3= -0.05 0.1 -0.25 -0.15 0.5

Z= 0.45 1.1 0.25 0.35 -6.5

Pivot (X7,X3)

Pivot (X6,X1)

Pivot (X5,X2)

0 , :subject to

' min

xb Ax

xpz

1

1

4

2

,

3

3

4

,

1410

0012

1031

pbA

Page 16: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

Example 3

X1 X2

X3= -1 1 2

X4= -1 -1 6

Z= 1 -1 0

Pivot (X4,X2)

0,0

6

2

:subject to

min

yx

yx

yx

yxz

X1 X4

X3= -2 -1 8

X2= -1 -1 6

Z= 2 1 -6

X2=0

X4=0

X3=0

X1=0

Vertex 1: N{1,2}

Vertex 2: N{1,4}

Z=-6

Z=0

Page 17: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

Example 4

X1 X2

X3= 2 -1 1

X4= -1 1 1

Z= -1 -1 0

Pivot (X3,X2)

0,0

1

12

:subject to

min

yx

yx

yx

yxz

X1 X3

X2= 2 -1 1

X4= 1 -1 2

Z= -3 1 -1

X2=0

X4=0

X3=0X1=0

Vertex 2: N{1,3}

Vertex 1: N{1,2}

Unbounded !!

Z=0

Page 18: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

Phase I Procedure

1. If b>0, introduce the artificial variable x0 ≥ 0 in all the constraints that are violated and set z0 = x0.

2. The first pivot is chosen in the x0 column and the row with worst infeasibility. Then do Jordan exchange.

3. Apply the standard simplex pivot rules until an optimal tableau is obtained. If the optimal value is positive, the original problem has no feasible point.

4. Strike out the column corresponding to x0 and the row corresponding to z0.

5. Go to Phase II.

Page 19: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

Infeasible ??

0,

04

022

01

21

15

214

213

xx

x x

xx x

xx x

X0=0

X3=0

X1=0 X5=0

X2=0

X4=0

Infeasible vertex 1

Plane{(x1,x2,x0)|x0=0}

00

0

0

0

x

x

x

x

Page 20: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

X0

X3=0,X0=2

X1=0,X0=2 X5=0,X0=2

X2=0,X0=2

X4=0,X0=2

feasible vertex 2 (0,0,2)

X1 X2 X0 1

X3= 1 1 1 -1

X4= 2 1 1 -2

X5= -1 0 0 4

Z0= 0 0 1 0

X1 X2 X4 1

X3= -1 0 1 1

X0= -2 -1 1 2

X5= -1 0 0 4

Z0= -2 -1 1 2

X0 X2 X4 1

X3= 0.5 0.5 0.5 0

X1= -0.5 -0.5 0.5 1

X5= 0.5 0.5 -0.5 3

Z0= 1 0 0 0

Plane{(x1,x2,x0)|x0=2}

Page 21: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

Example 5

X1 X2 X3 X4 1

X5= -1 -3 0 -1 4

X6= -2 -1 0 0 3

X7= 0 -1 -4 -1 3

X8= 1 1 2 0 -1

X9= -1 1 4 0 -1

Z= -2 -4 -1 -1 0Pivot (X8,X0)

0 , :subject to

' min

xb Ax

xpz

1

1

4

2

,

1

1

3

3

4

,

0411

0211

1410

0012

1031

pbA

X1 X2 X3 X4 X0 1

X5= -1 -3 0 -1 0 4

X6= -2 -1 0 0 0 3

X7= 0 -1 -4 -1 0 3

X8= 1 1 2 0 1 -1

X9= -1 1 4 0 1 -1

Z= -2 -4 -1 -1 0 0

Z0= 0 0 0 0 1 0

Phase I

Add column

Add row

Page 22: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

X1 X2 X3 X4 X8 1

X5= -1 -3 0 -1 0 4

X6= -2 -1 0 0 0 3

X7= 0 -1 -4 -1 0 3

X0= -1 -1 -2 0 1 1

X9= -2 0 2 0 1 0

Z= -2 -4 -1 -1 0 0

Z0= -1 -1 -2 0 1 1

X1 X2 X0 X4 X8 1

X5= -1 -3 0 -1 0 4

X6= -2 -1 0 0 0 3

X7= 2 1 2 -1 -2 1

X3= -0.5 -0.5 -0.5 0 0.5 0.5

X9= -3 -1 -1 0 2 1

Z= -1.5 -3.5 0.5 -1 -0.5 -0.5

Z0= 0 0 1 0 0 0

Pivot (X0,X3)X1 X2 X4 X8 1

X5= -1 -3 -1 0 4

X6= -2 -1 0 0 3

X7= 2 1 -1 -2 1

X3= -0.5 -0.5 0 0.5 0.5

X9= -3 -1 0 2 1

Z= -1.5 -3.5 -1 -0.5 -0.5

Delete row X0 & column Z0

Pivot (X3,X2)

Go to Phase II

Page 23: ECE 556 Linear Programming Ting-Yuan Wang Electrical and Computer Engineering University of Wisconsin-Madison March 4. 2002.

X1 X3 X4 X8 1

X5= 2 6 -1 -3 1

X6= -1 2 0 -1 2

X7= 1 -2 -1 -1 2

X2= -1 -2 0 1 1

X9= -2 2 0 1 0

Z= 2 7 -1 -4 -4

X1 X3 X4 X5 1

X8= 0.667 2 -0.333 -0.333 0.333

X6= -1.667 0 0.333 0.333 1.667

X7= 0.333 -4 -0.667 0.333 1.667

X2= -0.333 0 -0.333 -0.333 1.333

X9= -1.333 4 -0.333 -0.333 0.333

Z= -0.667 -1 0.333 1.333 -5.333

X1 X7 X4 X5 1

X8= 0.833 -0.5 -0.667 -0.167 1.167

X6= -1.667 0 0.333 0.333 1.667

X3= 0.083 -0.25 -0.167 0.083 0.417

X2= -0.333 0 -0.333 -0.333 1.333

X9= -1 -1 -1 0 2

Z= -0.75 0.25 0.5 1.25 -5.75

X6 X7 X4 X5 1

X8= -0.5 -0.5 -0.5 0 2

X1= -0.6 0 0.2 0.2 1

X3= -0.05 -0.25 -0.15 0.1 0.5

X2= 0.2 0 -0.4 -0.4 1

X9= 0.6 -1 -1.2 -0.2 1

Z= 0.45 0.25 0.35 1.1 -6.5

Pivot (X5,X8)

Pivot (X7,X3)

Pivot (X6,X1)