36
Optimization from Prof. Goldsman’s lecture notes

Optimization

  • Upload
    kellan

  • View
    31

  • Download
    1

Embed Size (px)

DESCRIPTION

Optimization. from Prof. Goldsman’s lecture notes. Outline. What is a Model? Operation Research Optimization Example Shortest Path Introduction to Modeling. What is a Model?. Abstraction, representation Infinitely many models of the same reality Often a model is created for a purpose - PowerPoint PPT Presentation

Citation preview

  • Optimizationfrom Prof. Goldsmans lecture notes

    Program Binusian 2012

  • OutlineWhat is a Model?

    Operation Research

    Optimization Example

    Shortest Path

    Introduction to Modeling

    Program Binusian 2012

  • What is a Model?Abstraction, representation

    Infinitely many models of the same reality

    Often a model is created for a purposeA good model discards the irrelevantA good model retains what is crucial

    Often we believe we understand something better after modeling it

    We trust a model if it gives accurate predictions (qualitative or quantitative)

    Program Binusian 2012

  • Note thatWhen you want to create a model

    Collect the necessary dataDistinguish between the model input and model output Lengthy notes are worthlessKISS Rule

    Program Binusian 2012

  • Operation ResearchHigher level of theoretical and mathematical orientation

    Categorization of Operation Research:

    Wants to model the problemEncounter the problems of estimating the values of the parametersParameters may not be constant over time

    2 Approaches:Forget the fact that they are RV and use the model w/o RV taken into consideration Deterministic ApproachUse model w/ RV Probabilistic Approach

    Program Binusian 2012

  • Optimization ExampleShortest Path of Auto Travel Routes

    Distances are in miles

    Program Binusian 2012

  • Shortest Path (Contd)Optimal Solution has length 270 miles

    But it did not go to node d and a

    Program Binusian 2012

  • Shortest Path (Contd)Algorithm actually finds a tree giving shortest paths from s to every node in graph

    Program Binusian 2012

  • Shortest Path: DefinitionsGraph G= (V,E)V: vertex set, contains special vertices s and tE: edge set

    Costs Cij on edges (i, j) in ECij >= 0no cycles with negative total cost

    Cost of a path = sum of edge costsObjective: find min cost path from s to t

    Program Binusian 2012

  • Shortest Path (Contd)A Mathematical ProblemAn Optimization Problem

    It has: A set of possible solutions (paths from s to t)An objective function (min the sum of edge costs)

    An algorithm that correctly and quickly solves cases of the shortest path problem, provided that

    The instances satisfy Cij >= 0The instances are not too huge

    Program Binusian 2012

  • ExampleGoal: use a car for 4 years at min cost

    Program Binusian 2012

    Purchase Cost

    1st year

    maint.

    1 year

    Resale

    2nd year

    maint

    2 year

    Resale

    3rd year

    maint

    3rd year

    Resale

    New

    Car

    15000

    1000

    11000

    1000

    9000

    1500

    8000

    Used

    Car

    5000

    2000

    4000

    3000

    3000

    3500

    2500

  • Example (Contd)Vertices of graph need not represent physical locationsV= {0,1,2,3,4}time 0, 1,...,4 in years

    Seek least expensive path from 0 to 4

    Edge cost from i to j: cost of buying a car at time i, using it, and selling it at time jfor each edge, pick cheapest alternative (new or used)

    Program Binusian 2012

  • Example (Contd)Keep the new car for 1 year: 5000Keep the used car for 1 year: 3000Keep the new car for 2 years: 8000Keep the used car for 2 years:7000

    Program Binusian 2012

  • Example (Contd)Continue and find the shortest path

    Note that: shortest path does allow directed graph

    i.e. you cannot go from node 2 to node 1 at a cost of 3000

    Program Binusian 2012

  • Optimization Model Usage

    Program Binusian 2012

  • What is A Successful Model?Models must fit the real problemRealism and Generality

    Able to solve the model Solvability and Tractability

    Program Binusian 2012

  • Modeling FAQTradeoff between realism and solvability

    Good modelers know Different models limitationsFitting a model into a wider range of real problemsFitting a real problem into a model

    Advanced modelers know how to Solve a wider range of modelsExtend the range of cases that can be solved with software tools

    Program Binusian 2012

  • Optimization Models SpectrumNetworks LP Convex QP IP NLPShortest PathMin Span TreeMax FlowAssignmentTransportationMin Cost Flowportfoliooptimizationchemicalprocesses

    materialsdesignblending

    planninglogistics

    schedulingproduction/distributionflow of materials

    Program Binusian 2012

  • Mathematical ProgrammingLinear ProgrammingNonlinear ProgrammingInteger ProgrammingBinary ProgrammingQuadratic ProgrammingGeometric ProgrammingDynamic ProgrammingMixed Integer Programming

    Program Binusian 2012

  • Mathematical Programming (Contd)Three important characteristics:

    Decision VariablesObjective FunctionConstraints

    Solving:GraphicallySimplex

    Program Binusian 2012

  • A Piece of Cake ExampleFarmer Jones must determine how many acres of corn and wheat to plant this year. An acre of wheat yields 25 bushels of wheat and requires 10 hours of labor per week. an acre of corn yields 10 bushels of corn and requires 4 hours of labor per week. All wheat can be sold at $4 a bushel and all corn can be sold at $3 a bushel. Seven acres of land and 40 hours per week of labor are available. Government regulations require that at least 30 bushels of corn can be produced during the current year.

    Formulate an LP whose solution will tell Farmer Jones how to maximize the total revenue from wheat and corn.

    Find the solution using graphical method.

    Program Binusian 2012

  • Assignment ProblemAssignment Problem

    Simplest and easiestDef: there are N items or services available at N locations and N other locations that require one and only one of these N items or servicesExample: 4 types of product and 4 machines. Each machine can only produce one type of products.Objective: assign jobs to machines that will minimize the total cost

    Program Binusian 2012

  • Assignment Problem (Contd)For unbalanced assignment problems

    Add dummy rows or columnsSet the cost of these rows or columns to be all zeros

    Program Binusian 2012

  • Solving Assignment ProblemUsing Hungarian Method Subtract the smallest number in each row from every entry in that rowSubtract the smallest number in each column from every entry in that columnA zero cost assignment (if it can be made) is optimal. If not, complete the Hungarian MethodDraw the min # of horizontal and vertical lines (no diagonals) that intersect all the zerosSubtract the smallest uncrossed number from every other uncrossed number and add it to all elements where the vertical and horizontal lines intersectIf a zero cost assignment can be made, it is optimalOw repeat steps 4 and 5 until one can be made

    Program Binusian 2012

  • Solving Assignment Problem (Contd)Draw the min # of horizontal and vertical lines (no diagonals) that intersect all the zeros

    Subtract the smallest uncrossed number from every other uncrossed number and add it to all elements where the vertical and horizontal lines intersectSmallest no = 1Row 4 & 5: Subtract 1Intersection: add 1

    12345173200240111300011411130511160

    12345173201240112300012400020500050

    Program Binusian 2012

  • Solving Assignment Problem (Contd)If a zero cost assignment can be made optimal

    Solution?4-1, 2-2, 3-3, 1-4, 5-5

    12345173201240112300012400020500050

    Program Binusian 2012

  • Hungarian Method: MaxObjective: maximize Note that max f(x) = min f(x)

    Solve:Replace all the cost elements by their negativeContinue w/ the minimization procedure

    Program Binusian 2012

  • Hungarian Method: Max (Contd)Replace all the cost elements by their negative

    Subtract the smallest number in each row from every entry in that row (perform similar calculation for column)Find the smallest number per rowFind the smallest number per column

    123415354221633546246314

    12341-5-3-5-42-2-1-6-33-5-4-6-24-6-3-1-4

    123410201245033120440352

    123410000243023100340151

    Program Binusian 2012

  • Transportation ProblemThere are M sources with something available and N destinations needing something

    Difference:Assignment Problem: f(x): x yTransportation problem: f(x): x y1, y2,,ynf(x): x1, x2,,xm y

    Program Binusian 2012

  • Transportation Problem (Contd)Mathematical Formulation:

    ai = number of units available at ibj = #units needed at j cij = cost to ship 1 unit from i to jxij = #units shipped from source i to destination j

    Program Binusian 2012

  • More ExampleSmallco, Inc.Smallco, Inc. manufactures two products, wooden toy cars and wooden toy trucks, made from mahogany. The profit margin for the two toys is $1.10 and $0.70, respectively. Based on careful market analysis, it appears that Smallco can sell about 2000 of each toy each week. However, Smallco can only obtain a limited amount of mahogany, roughly 3000 board-feet per week. Producing either toy requires 1 board foot of wood. What is the best mix of toys for Smallco to produce if the goal is to maximize total profit margin?

    Program Binusian 2012

  • More Example (Contd)What is the objective?What can be controlled?How do the decisions affect the objective?What limits the decisions?The LP model is Solve it!

    Program Binusian 2012

  • Example AgainDorial Auto manufactures luxury cars and trucks. The company believes that its most likely customers are high-income women and men. To reach these groups, Dorial Auto has embarked on an ambitious TV advertising campaign, and has decided to purchase 1-minute ad spots on two types of programs; comedy shows and football games. Each comedy commercial is seen by 7 million high-income women and 2 million high-income man. A 1-minute comedy spot costs $50,000 and a 1-minute football spot costs $100,000. Dorial wants to reach at least 28 million high-income women and 24 million high-income man. How should Dorian buy commercial time to reach their target at the lowest possible cost?

    Program Binusian 2012

  • Model With Discrete VariablesModel with specific (discrete) values, is not a linear programming modelTypes:Integer ProgrammingMixed Integer ProgrammingBinary Integer Programming

    Program Binusian 2012

  • Model With Discrete Variables (Contd)When do you need discrete variables?Continuous problemsyes/no aspects to the decisionHow many not How much

    How to model it?Non-obvious trickTreat each linear function as a separate cost function, with its own variableAssociate a binary variable with each of the linear functionEnforce the requirement that you cannot do this if you dont have this (TRICK)

    Program Binusian 2012

  • Model With Discrete Variables (Contd)It is trickyIt is not obvious and most of us (including myself) would have a hard time inventing this ourselvesCan be very difficult to solveExample: selecting among investment alternatives, designing supply chains, sourcing products, production/inventory planning, crew scheduling, vehicle routing, etc

    Program Binusian 2012