© All Rights Reserved

6 views

© All Rights Reserved

- LEC_01
- Belotti-Et-Al-12-TR.pdf
- Excel Solver Sensitivity Analysis
- AVU - Linear Programming
- Recommendation Reports 調查性與建議性報告(上)
- bkFXRWrmn9M
- Linear Programming
- Operations Research - An Introduction - Hamdy a. Taha
- Fuzzy Transportation Problem
- 229755557 Open Pit Mine Planning With Blending Constraints
- Lagrangean Relaxation
- Optimizing Logistics Through Operations Research
- Linear Programming I
- Optimization in Finance
- or1-vil-1
- 05484415
- 0c960515c56d1dfaab000000
- 3 - Study of or Packages
- Exemplu Paper Cu Algorithm
- LinearProgramming1.docx

You are on page 1of 16

Hi, welcome to a

tutorial on converting We hope that you

an LP to Standard enjoy it and find it

Form. useful.

Mita, an MIT

Amit, an MIT Beaver Beaver 2

Linear Programs in Standard Form

We say that a linear program is in standard form if I think it is really cool

the following are all true: that when Ella speaks,

1. Non-negativity constraints for all variables. some of her words are

2. All remaining constraints are expressed as in red, and some are

equality constraints. underlined. I wish I

3. The right hand side vector, b, is non- could do that.

negative.

Stan

x1 + 2x2 + x3 - x4 5 ; not equality

Ella -2x1 - 4x2 + x3 + x4 -1; not equality, and negative RHS

x1 0, x2 0 x2 is required to be nonpositive;

x3 and x4 may be positive or

negative. 3

The main reason that we care about

Why do students need standard form is that this form is the starting

to know how to convert point for the simplex method, which is the

a linear program to primary method for solving linear programs.

standard form? Students will learn about the simplex

Whats so special algorithm very soon.

about standard form?

In addition, it is good practice for students to

think about transformations, which is one of

the key techniques used in mathematical

modeling.

some techniques

Tom

(or tricks) for

transforming an

LP into standard

form.

4

Converting a constraint into standard form

We first consider a simple

Nooz can speak in red,

inequality constraint. The

just like Ella. How

first inequality constraint of

does he do that?

the previous LP is

x1 + 2x2 + x3 - x4 5

Wow! I just

spoke in

boldface. Cool!

an equality, add a slack variable, which measures

variable. In this case, the the amount of unused

inequality constraint becomes resource. Note that

the equality constraint:

x1 + 2x2 + x3 - x4 +s1 = 5. s1 = 5 - x1 - 2x2 - x3 + x4.

We also require that the slack

variable is non-negative. That

is s1 0. 5

Converting a constraint into standard form, and

converting inequalities with a negative RHS.

We next consider the I know how to do that

constraint one. Just add a slack

-2x1 - 4x2 + x3 + x4 -1 variable, like we did on

the last slide.

First we have to multiply

the inequality by -1 in order

to obtain a positive RHS. s2 is called a surplus

Then we get variable, which

2x1 + 4x2 - x3 - x4 1. measures the amount by

Then we add a surplus which the LHS exceeds

variable and get the RHS. Note that

2x1 + 4x2 - x3 - x4 - s2 = 1.

s2 = 2x1 + 4x2 - x3 - x4 -1

equality, add a slack variable. equality, add a surplus variable.

Getting Rid of Negative Variables

Next, Ill show you how to Cant we just

transform the constraint write:

constraint: x2 0 x2 + s3 = 0 and

into standard form. s3 0?

Standard form requires all variables to be non-negative.

But after your proposed change, it is still true that x2 0.

The solution in this case is a substitution of variables.

We let y2 = -x2. Then y2 0. And we substitute y2 for

x2 wherever x2 appears in the LP. The resulting LP is

given below. (after you click.)

max z= 3x1 -+ 2x

2y2 - x3 + x4

x1 -+ 2x

2y2 + x3 - x4 + s1 = 5 ;

2x1 -+ 4x

4y2 - x3 - x4 - s2 = 1;

x1 0, xy22 0,

0 s1 0, s2 0 7

Getting Rid of Variables that are

Unconstrained in Sign

Next, well show Actually, well show you two ways. The first way is

you how to get rid substitution. For example, x3 below is unconstrained

of a variable that in sign. (Sometimes we call this a free variable.)

is unconstrained Notice that the second constraint can be rewritten as:

in sign. That is, it x3 = 2x1 - 4y2 - x4 - s2 - 1.

can be positive or

negative. Now substitute 2x1 - 4y2 - x4 - s2 - 1 for x3 into the

current linear program. Notice that you get an

equivalent linear program without x3. You can see it on

the next slide.

x1 - 2y2 + x3 - x4 + s1 = 5 ;

2x1 - 4y2 - x3 - x4 - s2 = 1;

x1 0, y2 0, s1 0, s2 0 8

Getting Rid of Free Variables by Substitution

When we substitute 2x1 - 4y2 - x4 - s2 - 1 This trick only works for variables that are

for x3 here is what we get. (Click now.) unconstrained in sign. If you tried

eliminating x1 instead of x3 by substitution,

The variable x4 is also unconstrained in the optimal solution for the resulting LP

sign. You can substitute for it as well. would not necessarily satisfy the original

After this substitution, all that will remain constraint x1 0. So eliminating x1 in this

is an objective function and non-negativity manner would not create an equivalent

constraints for x1, y2, s1 and s2. LP.

x1 - 2y2 + x3 - x4 + s1 = 5 ;

2x1 - 4y2 - x3 - x4 - s2 = 1;

x1 0, y2 0, s1 0, s2 0

3x1 - 6y2 - 2x4 + s1 + s2 = 5 ; Cathy

x1 0, y2 0, s1 0, s2 0

9

Getting Rid of Free Variables: Version 2

There is an even simpler way of getting After solving this new linear

rid of free variables. We replace a free program, we can find the

variable by the difference of two non- solution to the original linear

negative variables. For example, we program. For example,

replace x3 by y3 w3, and require y3 and x3 = y3 w3 and

w3 to be non-negative. (Click now.) You x4 = y4 w4.

can then substitute y4 w4 for x4.

x1 - 2y2 + x3 - x4 + s1 = 5 ;

2x1 - 4y2 - x3 - x4 - s2 = 1;

x1 0, y2 0, s1 0, s2 0

x1 - 2y2 + y3 - w3 - x4 + s1 = 5 ;

2x1 - 4y2 - y3 + w3 - x4 - s2 = 1;

10

x1 0, y2 0, y3 0, w3 0, s1 0, s2 0

Getting Rid of Free Variables: Version 2

This doesnt make sense It depends on what you mean by the same. Here

to me. Before we had a is what we mean. For every solution to the original

variable x3, and now we LP, there is a solution to the transformed LP with

have two variables y3 and the same objective value. For example, if there is a

w3. How can two feasible solution with x3 = -4, then there is a feasible

variables be the same as solution to the transformed problem with the same

a single variable? objective value. In this case, let y3 = 0 and w3 = 4.

x1 - 2y2 + x3 - x4 + s1 = 5 ;

2x1 - 4y2 - x3 - x4 - s2 = 1;

x1 0, y2 0, s1 0, s2 0

x1 - 2y2 + y3 - w3 - x4 + s1 = 5 ;

2x1 - 4y2 - y3 + w3 - x4 - s2 = 1;

11

x1 0, y2 0, y3 0, w3 0, s1 0, s2 0

But for every solution to the

Similarly, if there is a feasible solution for the

original problem, there are an

transformed problem, then there is a feasible

infinite number of solutions to

solution for the original problem with the same

the transformed problem. If

objective value. For example, if there is a

x3 = -4, we could have

feasible solution with y3 = 1, and w3 = 5, then there

chosen y3 = 2 and w3 = 6, or

is a feasible solution for the original problem with

any other solution such that

the same objective value. In this case, let x3 = -4.

y3 w3 = -4.

solutions will still have the same objective

function value. In each case - y3 + w3 = 4. So,

even though the two linear programs differ in

some ways, they are equivalent in the most

important way. An optimal solution for the original

problem can be transformed into an optimal

solution for the transformed problem. And an

optimal solution for the transformed problem can

be transformed into an optimal solution for the

original problem.

12

Transforming Max to Min

We still have one last pair of We illustrate with our original linear

transformations. We will show program, which is given below. All

you how to transform a you need to know is that if we

maximization problem into a maximize z, then we are minimizing

minimization problem, and how to z, and vice versa. See if you can

transform a minimization problem use this hint to figure out how to

into a maximization problem. change the problem to a minimization

This is not part of converting to problem. Then click to see if you are

standard form, but it is still useful. right.

min

max z-z==3x

-3x 1 -2x

1 + 2x

2 2- +

x3x+3 -xx

44

x1 + 2x2 + x3 - x4 5 ;

-2x1 - 4x2 + x3 + x4 -1;

x1 0, x2 0

McGraph

13

min z = x1 - x2 + x3

x1 + 2x2 - x3 3

Here is an example

for which you can test - x1 + x2 + x3 2

out these techniques. x1 - x2 = 10

Consider the LP to

x1 0, x2 0

the right. See if you

can transform it to

standard form, with Transformations.

maximization instead

of minimization. s1 = slack variable for 1st constraint.

s2 = surplus variable for 2nd constraint.

y2 = - x2

To see the y3 - y4 = x3.

new

variables,

click once.

To see the

max -z = -x1 y2 (y3 y4)

transformed x1 2y2 (y3 y4) + s1 = 3

problem, - x1 y2 + (y3 y4) - s2 = 2

click again.

x1 + y2 = 10

x1 0, y2 0, y3 0, y4 0, s1 0, s2 0

14

Last Slide

Remember that the major reason we do

Well, that

this is because the simplex method

concludes this

starts with a linear program in standard

tutorial on

form. But it turns out that these types

transforming a

of transformation are useful for other

linear program into

types of algorithms too. Perhaps we

standard form. We

shall see their usefulness again some

hope to see you

time later in this course.

again soon.

15

MIT OpenCourseWare

http://ocw.mit.edu

Spring 2013

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

- LEC_01Uploaded bysharath
- Belotti-Et-Al-12-TR.pdfUploaded byJorge Ignacio Cisneros Saldana
- Excel Solver Sensitivity AnalysisUploaded byJishnu Chakraborty
- AVU - Linear ProgrammingUploaded bycantor2000
- Recommendation Reports 調查性與建議性報告(上)Uploaded by柯泰德 (Ted Knoy)
- bkFXRWrmn9MUploaded byReham Hegazy
- Linear ProgrammingUploaded byKristienalyn De Asis
- Operations Research - An Introduction - Hamdy a. TahaUploaded byRauph Kaxif
- Fuzzy Transportation ProblemUploaded byAditya Bhansali
- 229755557 Open Pit Mine Planning With Blending ConstraintsUploaded byAngel Jesus
- Lagrangean RelaxationUploaded byBui Quoc Trung
- Optimizing Logistics Through Operations ResearchUploaded byJorgeCanoRamirez
- Linear Programming IUploaded byBong Nepo
- Optimization in FinanceUploaded bybobtenrd
- or1-vil-1Uploaded byKunal Puri
- 05484415Uploaded byHafeez Ansari
- 0c960515c56d1dfaab000000Uploaded byAfshan shahnawaz
- 3 - Study of or PackagesUploaded byRanjan Raj Urs
- Exemplu Paper Cu AlgorithmUploaded byMircea Bujor
- LinearProgramming1.docxUploaded byÖzlem Yurtsever
- Linear ProgrammingUploaded byteepl
- A Simple Method for Solving Type-2 and Type-4 Fuzzy Transportation ProblemsUploaded byP.SENTHIL KUMAR
- Langfield-Smith7e IRM Ch20Uploaded bySophia Duong
- 01A Intro Cut BranchUploaded byArya Chowdhury
- 3088450 (1).pdfUploaded byAndresLugo
- kaurAMS149-152-2014Uploaded byPrabjot Kaur Bajaj
- Information 07 00013Uploaded byRaul6669
- 03 Geometry 2011Uploaded bychristycatbun
- Kuhn HungarianUploaded byshar1112
- 11_819Uploaded byAnonymous A8A7zTEmq

- INTRO ROBOTICSUploaded byariff05
- Vdma English FinalUploaded bygwapito03
- Td ThermalPPUploaded byHectorDavidPreciadoValenzuela
- Design and Development of a Vertical AxiUploaded byHectorDavidPreciadoValenzuela
- Designing Sociable Robots - Cynthia L BreazealUploaded byAlexander Cuervo
- U.S. Department of Energy Solar Photovoltaic System GuideUploaded bycatersolar
- GIZ-_How_to_do_business_with_Germans_Kavalchuk-angles-1359942678515.pdfUploaded byHectorDavidPreciadoValenzuela
- Or in EnergyEconomics Exercise4 (1)Uploaded byHectorDavidPreciadoValenzuela
- The Solar Resource Assessment in Mexico State of tUploaded byHectorDavidPreciadoValenzuela
- Calculations of Solar Energy OutputUploaded byHectorDavidPreciadoValenzuela
- Building. .Integrated.photovoltaic.power.systemsUploaded byknoxd77
- 133249 eUploaded bySoumyabrata Barik
- th _ english.pdfUploaded byEddie Tai
- Kinematics RobotUploaded byadrianwtx90
- Robotics PICUploaded byPedro Alberto López Cuenca
- The Engineers Sketchbook of Mechanical Movements 1902Uploaded byHectorDavidPreciadoValenzuela
- MDWpo_EUploaded byb-ferguson6432
- The NozzleDiffuser Wind TurbineUploaded byHectorDavidPreciadoValenzuela

- History of ProbabilityUploaded byJo Ey Goh
- Handbook of Financial EngineeringUploaded byJonathan Harris
- lec 1-4.pptxUploaded byWaleed Khetran
- Lse Applicablemathematics InfoUploaded bymilutin milankovic
- Project Management for Construction_ Fundamental Scheduling ProceduresUploaded bymanoj9114
- PSO PaperUploaded bySalman Zafar
- Optimum Coordination of Overcurrent Relays Using SADE AlgorithmUploaded byJamile_P_N
- simplexUploaded byIshaq Ahmad
- FrontlineSolvers_UserGuideV11.pdfUploaded byVijay Gudigunta
- 10.1.1.128Uploaded byblackjim
- M1L4_LNUploaded bysantosprsd
- 12. Mathematics JntukUploaded byds_kumar74
- ormpexUploaded byDanielle Smith
- SyllabusOptim1819Uploaded by_MerKeZ_
- B.tech ME - Or I Semester (R07) Regular Examinations,NOVEMBER 2Uploaded byRajesh Guntur
- cvUploaded byTerrence Carter
- Slides for Ch07Uploaded byRiri
- Bcom 2nd Year SyllabusUploaded byRudra S Upadhyaya
- MBA JNTU Kakinada Full syllabus 2013-14Uploaded bychantib
- ch7Uploaded byfadfebrian
- L1Uploaded bytequesta95
- Occupancy behavior based model predictive control for building indoor climate—A critical reviewUploaded byakbar
- Using_CPLEX.pdfUploaded bysundar1469
- Management_Science_BBA_Pabbi.pdfUploaded bySaqlain Khan
- KeplerUploaded bySaravanan Munusamy
- Modelling With Linear ProgUploaded byvijaydh
- Simplex Method and Sensitivity Analysis2012Uploaded byOky Tresia
- SeDuMi RemarksUploaded byte123mp123
- Unconstrained and Constrained Optimization Algorithms By Soman K.PUploaded byprasanthrajs
- Dantzig SelectorUploaded byehsan