Difference between revisions of "Optimization for Business Problems"

From Bitnami MediaWiki
Jump to navigation Jump to search
Line 88: Line 88:
 
** maximize: 12*desk + 20*cell - 2*overtime
 
** maximize: 12*desk + 20*cell - 2*overtime
 
* a '''variable is unbounded''' when one or both of its bounds is infinite.  
 
* a '''variable is unbounded''' when one or both of its bounds is infinite.  
−
* an ''unbounded model''' exists when its objective value can be increased/decreased arbitrarily (usually a sign of mispecification)
+
* an '''unbounded model''' exists when its objective value can be increased/decreased arbitrarily (usually a sign of mispecification); this usually implies that an important constraint is either missing or insufficiently restrictive
 +
 
 +
===Algorithms for Solving LP P1===
 +
* Simplex method developed by George Danzig in 1947. Iterative method that starts with an initial feasible solution and continues until it stops. It starts at a vertex, and proceeds vertex-by-vertex until reaching an optimum
 +
* Revised in 1953 by Danzig and W. Orchard-Hays
 +
* CPLEX studio uses the revised method
 +
* '''Duality''': every LP max(min)imization has a dual min(max)imization problem
 +
* Each constraint (x) has an associated dual variable (y); any feasible solution to the dual problem is an '''upper bound to the primal problem.'''. Any feasible solution to the primal problem is a '''lower bound to the dual problem'''
 +
* '''The optimal objective of the dual and primal are equivalent where these bounds meet'''

Revision as of 18:17, 18 April 2022

The first page is here

Module 1: The Big Picture

What is OR?

  • developed by British during WWII to solve logistics problems and operational planning. OR
  • by the 1950s, "management science" replaced OR to avoid the connotation of military operations
  • OR uses: optimization, statistics, probability theory, simulation and decision analysis
  • LP is the best know mathematical optimization technique
  • Danzig (1963) formulated the simplex method; CPLEX uses a revised version of simplex algorithm
  • Most OR today done to help organizations improve their business

What is Optimization?

  • optimization model includes: an objective, decision variables, constraints
  • purpose is to find values of the decision variables, satisfy constraints and optimize the objective function (e.g., maximize profits or minimize costs/losses)
  • using model interactively allows users to judge impact of data changes & analyze trade-offs between conflicting goals and constraints
  • inputs: demand, resource availability, costs, yields, recipes, operational constraints, customer preferences, business goals
  • inputs used to construct optimization models, solved by optimization engines that generate output
  • outputs: minimize costs, maximize yields, optimal activity timing, optimal resource assignment
  • 2 IBM ILOG products: 1) mathematical programming (linear, integer, mixed-integer, quadratic, MI quadratic) and 2) constraint programming (detailed scheduling problems, combinatorial optimization problems that can't be linearized).

Optimization Model

  • begins with scope definition, then identify objectives, decision variables, constraints
  • gather data to populate model, create and test a prototype with small data set. Then create a complete instance and test
  • the objective function is a mathematical representation of the business objectives or goals to be achieved. Always entails "minimize" or "maximize"
  • bus objectives: maximize profit, minimize cost, minimize tardiness, maximize cust service
  • decision variables: how much to produce, how many people to hire, location of a warehouse
  • decision variables have a domain (range of possible values) and upper and lower bounds (infinite bounds okay)
  • constraints define relationships among decision variables. E.g.: amount produced should be less than capacity; people hired need a minimum set of skills; total construction cost should be below budget
  • hard or soft: hard constraints are inviolable, e.g., production capacity when no additional is available. Soft constraints can be violated under certain conditions and usually involve adding a penalty to the objective to minimize the constraint violation
  • IBM ILOG CPLEX optimizer is a solver engine for MP problems, including Simplex, Barrier, and Mixed-Integer algorithms. Also offers the CP optimizer for CP problems

Module 2: Linear Programming

Intro to LP

  • LP deals with max/minimization of a linear objective function, subject to linear constraints where all the decision variables are continuous. Everything is linear (no square roots, squares, logs, combined terms, etc.)
  • constraints are expressed as equalities or inequalities with linear expressions on both LHS and RHS
  • decision variables all take values from [math]\displaystyle{ \mathbb{R} }[/math]; they cannot be restricted such that they are discontinuous
  • the canonical from is
[math]\displaystyle{ \begin{align} & \text{Find a vector} && \mathbf{x} \\ & \text{that maximizes} && \mathbf{c}^T \mathbf{x}\\ & \text{subject to} && A \mathbf{x} \leq \mathbf{b} \\ & \text{and} && \mathbf{x} \ge \mathbf{0}. \end{align} }[/math]
  • where c and b are vectors containing the objective coefficients and RHS values of the constraints, A is the matrix of constraint coefficients and x is the vector of decision variables.
  • restrictions:
    • objective function must be linear;
    • the constraints must be linear;
    • inequalities must be [math]\displaystyle{ \geq }[/math] or [math]\displaystyle{ \leq }[/math], strict inequalities aren't allowed;
    • decision variables must be continuous, not discrete

A Production Problem P1

[math]\displaystyle{ \begin{matrix} & \text{Desk} & \text{Cell} \\ \text{assembly (max 400hr)} & 12 & 24 \\ \text{painting (max 490hr)} & 30 & 24 \\ \text{profit/unit} & 12 & 20 \end{matrix} }[/math]

  • decision variables: number of desk phones and cell phones to be produced
  • objective: maximize profit ($12/desk phone, $20/cell phone)
  • constraints:
    • desk + cell output [math]\displaystyle{ \geq }[/math] 100 units
    • desk + cell assembly time [math]\displaystyle{ \leq }[/math] 400 hours
    • desk + cell painting time [math]\displaystyle{ \leq }[/math] 490 hours
  • The full model
    • desk_prod [math]\displaystyle{ \geq }[/math] 100
    • cell_prod [math]\displaystyle{ \geq }[/math] 100
    • assembly_time_limit: 0.2*desk_prod + 0.4*cell_prod [math]\displaystyle{ \leq }[/math] 400
    • painting_time_limit: 0.5*desk_prod + 0.4*cell_prod [math]\displaystyle{ \leq }[/math] 490
    • desk_prod, cell_prod [math]\displaystyle{ \in\mathbb{R} }[/math]
    • subject to maximizing: 12*desk_prod + 20*cell_prod

A Production Problem P2

  • The region delimited by the constraints define a feasible region
  • Iso-profit/iso-cost lines are parallel to the tangent of the optimum
  • Optimal solution always lies along an extreme point of the feasible region--either a vertex or an edge
  • CPLEX reports the first optimal solution found

A Production Problem P3

  • Solution to the above is desk=300, cell=850.
  • Binding constraint: if the constraint becomes an equality when the solution values are substituted (i.e., the constraint is at its limit: 0.2(300) + 0.4(850) = 400.)
  • Non-binding constraint: LHS [math]\displaystyle{ \neq }[/math] RHS given the solution values. E.g.: total production for each phone type is non-binding because 300 [math]\displaystyle{ \neq }[/math] 100 (desk) and 850 [math]\displaystyle{ \neq }[/math] 100 (cell).
  • Model is infeasible when no constraint-satisfying solution exists. This may be because: 1) the formulation is wrong, 2) the data are wrong, or 3) there's a real-world conflict among objectives in the system being modeled.
  • CPLEX provides tools to help identify potential causes of infeasibility.
  • Correcting an infeasible model entails knowledge of the real-world situation.
  • CPLEX might suggest relaxing one or more constraints. E.g., 0.2*desk + 0.4*cell [math]\displaystyle{ \leq }[/math] 400 might be relaxed to 440, representing a relaxation of the RHS of the equation.
  • A soft constraint can be used to relax the model. A soft constraint maybe violated, a hard constraint may NOT be violated.
  • Converting hard constraints to soft constraints is one way to relax assumptions. E.g.,
    • add an overtime term: 0.2*desk + 0.4*cell [math]\displaystyle{ \leq }[/math] 400 + overtime, subject to
    • a hard limit to the overtime term: overtime [math]\displaystyle{ \leq }[/math] 40, and an additional cost constraint
    • maximize: 12*desk + 20*cell - 2*overtime
  • a variable is unbounded when one or both of its bounds is infinite.
  • an unbounded model exists when its objective value can be increased/decreased arbitrarily (usually a sign of mispecification); this usually implies that an important constraint is either missing or insufficiently restrictive

Algorithms for Solving LP P1

  • Simplex method developed by George Danzig in 1947. Iterative method that starts with an initial feasible solution and continues until it stops. It starts at a vertex, and proceeds vertex-by-vertex until reaching an optimum
  • Revised in 1953 by Danzig and W. Orchard-Hays
  • CPLEX studio uses the revised method
  • Duality: every LP max(min)imization has a dual min(max)imization problem
  • Each constraint (x) has an associated dual variable (y); any feasible solution to the dual problem is an upper bound to the primal problem.. Any feasible solution to the primal problem is a lower bound to the dual problem
  • The optimal objective of the dual and primal are equivalent where these bounds meet