1 / 30

DMOR

DMOR. Linear Programming. Unconstrained optimization Constrained optimization Linear programming Non-linear programming programming – arch. planning Constrained optimization elements : decision variables objective function constraints variable bounds. Bike company.

merry
Download Presentation

DMOR

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DMOR LinearProgramming

  2. Unconstrainedoptimization • Constrainedoptimization • Linearprogramming • Non-linearprogramming programming – arch. planning Constrainedoptimizationelements: • decision variables • objective function • constraints • variable bounds

  3. Bike company • Bike company produces: • Mountainbikes • Race bikes • Wants to maximize profit by settingquantities of eachbikeproduced • No demandrestrictions • Twoteamsproducetwokinds of bikes: • Mountainbike team canproduceup to 2 bikes per day • Race bike team canproduceup to 3 bikes per day • Equalamount of time using metal finishingmachineisneeded for bothkinds of bikes. • Up to 4 bikescan go throughthemachinedaily • Theacountantestimatesprofits for eachbike • Mountain$15 • Race$10

  4. Solution • Intuitivesolution • We produce as many mountainbikes as possible(max 2) and what’sleftgoes for race bikes (2). • Generated Profit: $30+$20=$50. • Linearprogramming • Decisionvariables: Number of mountainx1and race x2bikes • Nonnegative: x1≥0, x2≥0 • Objectivefunction: max daily profit: max Z=15x1+10x2(in $/day) • Constraints: • Dailymountainbikeproduction limit: x1≤2(inbikes/day) • Daily race bikeproduction limit: x2≤3(inbikes/day) • Metal finishingmachine limit: x1+x2 ≤ 4 (inbikes/day)

  5. Cornersareimportant • feasible region • Isoprofit lines areparallel • Profit increasesthe most for the gradient direction • Cornersstickoutsidethe most • Optimum is a corneror a an edgetogetherwithtwoendpoint (neighbouring) corners • Iftwocornersareoptimalthenthelinebetweenthemisalso

  6. Linearprogrammingassumptions • Linearindecisionvariables • Additivity and proportionality • Excludescurves, step-functions, interactionfactors, e.g. 5x1x2, start-upcosts • Decisionvariablesarereal-valued • And not integer-valued • Programmingin general assumesknowledge of alltheparameters • Nevertheless we can do sensitivity analysis

  7. An LP problem instandard form Features: • Objectiveis to maximze • Constraintsonly≤ • Non-negativeconstraints’ RHS • Decisionvariablesarenonnegative Algebraicformulation: • Objectivefunction: • mfunctionalconstraints: • Variablebounds

  8. Definitions • solution • cornerpoint solution • feasible cornerpointsolution • adjacent cornerpointsolutions

  9. Keyproperties • Optimalcornerpointsolutionisalways a feasiblecornerpointsolution • Ifobjectivefunctionvalue for a givenfeasiblecornerpointsolutionis not less thantheobjectivefunctionvalue for allfeasibleadjacentcornerpointsolution, thenthissolutionisoptimal • Thereisfinitenumber of feasiblecornerpointsolutions Implications • Searchthecornerpoints • Easy to saywhichcornerpointisoptimal • Algorithm will stop afterfinitenumber of iterations

  10. Simplexmethod Twophases: • Start-up– findanyfeasiblecornerpointsolution • Standard form isgoodbecausetheorginisalways a feasiblecornerpointsolution • If not in standard form, we needadditionalprocedure (to be describedlater) • Iterations– move to adjacentfeasiblecornerpointsolutionssuchthateach time youimprovetheobjectivefunctionvalue • Stop when no improvementpossible

  11. Algebraicmethod • Millions of decisionvariablesinrealapplications • Graphicalmethod not possible • Algebraicmethodworksfine • Inequalityconstraintschangedintoequalityconstraints • Solving a system of equationsbeing a subset of allconstraints • Subset– sincecommonly not allequalitiesmeyholdatthe same time • We need a way to rememberwhichequalitiesareinthesubset(activeconstraints) • We introduceslack variablese.g. x1 ≤ 2 changedintox1 + s1 = 2, wheres1≥ 0is a slackvariable

  12. Bike company • Twodimensional problem becomesnowfive-dimesional • Slackvariableispositiveonlyifthecorrespondingconstraintisactive More concepts: • augmented solution: valuesgiven for allvariables, e.g. extendedoptimalcornersolution for Bike company isx1,x2,s1,s2,s3 = (2,2,0,1,0) • basic solution: extendedcornerpointsolution (feasibleorinfeasible), e.g.(2,3,0,0,-1) isbasicinfeasiblesolution • basic feasible solution:feasiblecornerpointsolutione.g.(0,3,2,0,1)

  13. Settingvariablevalues • degrees of freedom df df =(number of variables) - (number of independent equalities) • Simplexmethodautomaticallyassigns zero value (correspondingconstraintactive) to df out of allvariables and thendeterminestheothervalues • x1=0 meansthatconstraintx1 ≥ 0 isactive • x2=0 meansthatconstraint x2 ≥ 0 isactive • s1=0 meansthatconstraint x1≤ 2 isactive • s2=0 meansthatconstraint x2 ≤ 3isactive • s3=0 meansthatconstraint x1+x2≤ 4isactive • In ourexampledf=2, hencetwovariableswill be assigneda zero value

  14. More terminology • nonbasic variable: variablewhichcurrentlyisassigned a zero value • basic variable: variablewhichiscurrently NOT assigned a zero value • In standard form positive • Zero inspecialcases • basis: the set of currentbasicvariables MANTRA: Nonbasic, value zero, constraintactive • We canguessthebasis but we have to be careful • We cangetinfeasiblecornerpointsolution(previouspicture) • No cornerpointatall (below)

  15. Moving to a betteradjacentfeasiblecornerpointsolution • Adjacentcornerpointsolutionisa goodchoicebecause: • In twoadjacentcornerpointsthebasic and nonbasic set areidentical but for one element • Example • PointA: nonbasic set= {s2,s3}, basic set= {x1,x2,s1} • PointB: nonbasic set= {s1,s2}, basic set= {x1,x2,s3} Thisisnecessaryyet not sufficientcondition for adjacency (vide(0,4) and(4,0))

  16. Threeconditions for moving to a newcornerpointsolution • Have to be adjacent • Have to be feasible • Thenewsolutionhave to be betterthanthe old one • Twosteps: • Determine a nonbasicvariablewhichimprovestheobjectivefunction most. Movethisvariableintobasic set (entering basic variable) • Increasevalue of enteringbasicvariableup to the moment one of thebasicvariablesreaches zero. Movethisvariableintononbasic set (leaving basic variable) • x1improvesobjectivefunction most • Constraintx1≥ 0 ceases to be active • Onlyx1increases so we knowthemovementdirection • Theconstraintwhich will be crossedover first isx1 ≤ 2.

  17. Algebraically • In theoriginthesituationisthefollowing: • Basic variables: s1,s2,s3 • Nonbasicvariables: x1,x2 • Basic enteringvariable: x1 • In a newcornerpointsolution, whichislocatedattheintersection of theedges of twoconstraintsx2≥ 0 and x1≤ 2 (point (2,0)), we have: • Basic variables: x1,s2,s3 • Nonbasicvariables: x2,s1 • We exchangedx1fors1

  18. Minimumratio test • In order to findbascileavingvariable we have to findthesmallestvalue for thefollowingratio: • In ourexample, the denominator isalways 1. Generallyitdoesn’thave to be thatway. • Twospecialcases: • Enteringbasicvariablecoefficientis0 (theconstraints do not intersect) • Enteringbasicvariablecoefficientisnegative (theconstraintsintersect but theenteringbasicvariableincreasesintheoppositedirectioninrelation to theintersection point)

  19. Finding a newbasicfeasiblesolution • We found a newbasis – whatthen? • We cansuibstitute zero intoallnonbasicvariables and solvetheresulting system of m x m equations by Gaussianelimination • More effectiveis to performonly a part of Gaussianeliminationineach step • When to stop iterating? (Jokeabout a computer scientist) • When we cannotfindbasicenteringvariable

  20. Simplexmethod

  21. Simplex tableau • Starting point • Tableau inproper form • One basicvariable for eachequality • Basic variablecoefficientalways+1 and coefficientsabove and beloware zero • Z istreated as a basicvariable of theobjectivefunction • Theadvantage of theproper form istaht we cannreadcurrentsolutiondirectlyfromthe tableau.

  22. 2.1 Are we done? No, we have 2 negativecoefficientsinthe first raw 2.2 Choosebasicenteringvariable Most negativecoefficientis for x1 2.3 Choosebasicleavingvariable Minimalratio test: • Ifthereis 0 ornegativenumberinthepivotcolumnwrite „no limit” • Thesmallestvalueis 2: thecorrespondingrawiscalledthepivotraw Pivot element

  23. 2.4 Updatethe tableau • In „basicvariable” columnexchangebasicleavingvariablewithbasicenteringvariable • Ifpivot element is not equal to 1, divideallpivotrawcoefficients by pivot element value • But for thepivot element, we make allthecoefficientsinthepivotcolumnequal to zero

  24. Continued • New solution (x1,x2,s1,s2,s3)=(2,0,0,3,2), Objectivefunctionvalue Z=30 2.1 We are not optimalyet 2.2, 2.3 A newbasicentering and leavingvariable 2.4 Back to proper form

  25. Specialcases • A drawwhenchoosingbasicenteringvariable, e.g. Z = 15x1+15x2 • A drawwhenchoosingbasicleavingvariable– choosethe one you want – thecorner will the same anyway • A variablewhich was not chosen for thebasicleavingvariable will remainbasic but will have a calculatedvalue of 0 • A variablewhich was chosen will have an assignedvalue of 0 Basic feasiblesolutioninsuchcaseiscalleddegenerateand canlead to cyclesinmorethantwodimensions (cornersA,C – B,C – A,C)

  26. Minimalratio test gives „no limit” everywhere– unbounded problem – no solution • Usuallymeanyouforgotsomeconstraint • In theoptimalsolutioncoefficients of somenonbasicvariableshavevalue of zero intheobjectivefunctionraw • Choosingthisvariable to enter thebasishas no effect on theobjectivefunctionvalue • But itchangesbasicfeasiblesolution • Itmeans we havemultipleoptimum solutions

  27. In practice • input formats: • Algebraicformulation • Spreadsheetformulation(columns: variables, raws: constraints) • Algebraiclanguage, compact way to writethe model (indices make itshort) – thebestinpractice • Individualformats

  28. 1963 model • Factories (Seattle i San Diego) and Markets (New York, Chicago i Topeka) • Satisfyingthesupply and demandresrtictions we strive to minimize transport costs of a homogenousgoodsbetweenfactories and markets

More Related