Вы находитесь на странице: 1из 48

7.

OPTIMIZATION CONCEPTS

Linear programming
Learning Objectives
• Understand basic assumptions and properties of linear
programming (LP).
• Use graphical solution procedures for LP problems with
only two variables to understand how LP problems are
solved.
• Understand special situations such as redundancy,
infeasibility, unboundedness, and alternate optimal
solutions in LP problems.
• Understand how to set up LP problems on a spreadsheet
and solve them using Excel’s solver.
Linear Programming
• The maximization or minimization of some quantity
is the objective in all linear programming problems.
• All LP problems have constraints that limit the
degree to which the objective can be pursued.
• A feasible solution satisfies all the problem's
constraints.
• An optimal solution is a feasible solution that results
in the largest possible objective function value when
maximizing (or smallest when minimizing).
• A graphical solution method can be used to solve a
linear program with two variables.
Linear Programming
• If both the objective function and the constraints
are linear, the problem is referred to as a linear
programming problem.
• Linear functions are functions in which each
variable appears in a separate term raised to the
first power and is multiplied by a constant (which
could be 0).
• Linear constraints are linear functions that are
restricted to be "less than or equal to", "equal to",
or "greater than or equal to" a constant.
Problem Formulation
• Problem formulation or modeling is the process of
translating a verbal statement of a problem into a
mathematical statement.
• Problem/model formulation involves:
ˉ Understand the problem thoroughly.
ˉ Describe the objective.
ˉ Describe each constraint.
ˉ Define the decision variables.
ˉ Write the objective in terms of the decision variables.
ˉ Write the constraints in terms of the decision
variables.
Linear Equations and Inequalities
• This is a linear equation:
2A + 5B = 10
• This equation is not linear:
2A2 + 5B3 + 3AB = 10
• LP uses, in many cases, inequalities like:
A+BC or A + B  C
Basic Assumptions of a LP Model
1. Conditions of certainty exist.
2. Proportionality in objective function and
constraints (1 unit – 3 hours, 3 units- 9 hours).
3. Additivity – total of all activities equals sum of
individual activities.
4. Divisibility – solutions need not necessarily be in
whole numbers (integers); ie.decision variables can
take on any fractional value.
Example: Maximizing Profit
• How many bowls and mugs should be produced to
maximize profits given labor and materials
constraints?
• Product resource requirements and unit profit:

Resource Requirements
Labor Clay Profit
Product
(hr/unit) (lb/unit) ($/unit)
Bowl 1 4 40
Mug 2 3 50
Problem Definition
Resource Availability:
40 hrs of labor per day, 120 lbs of clay
Decision Variables:
x1 = number of bowls to produce per day
x2 = number of mugs to produce per day
Objective Function: Maximize Z = $40x1 + $50x2,
where Z = profit per day
Resource Constraints: 1x1 + 2x2  40 hours of labor
4x1 + 3x2  120 pounds of clay
Non-Negativity Constraints: x1  0; x2  0
Problem Definition (cont’d)
Complete Linear Programming Model:

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0
Feasible and Infeasible Solutions
• The set of all points that satisfy all the constraints of
the model is called feasible region.
• A feasible solution does not violate any of the
constraints:
– Example x1 = 5 bowls, x2 = 10 mugs
Labor constraint check: 1(5) + 2(10) = 25 < 40
Clay constraint check: 4(5) + 3(10) = 50 < 120
• An infeasible solution violates at least one of the
constraints:
– Example x1 = 10 bowls, x2 = 20 mugs
Labor constraint check: (10) + 2(20) = 50 > 40, violates the
constraint.
Graphical Solution of LP Models
• Graphical solution is limited to linear programming
models containing only two decision variables (can be
used with three variables but only with great difficulty).
• Graphical methods provide visualization of how a
solution for a linear programming problem is obtained.
• Primary advantage of two-variable LP models is their
solution can be graphically illustrated using two-
dimensional graph.
• Allows one to provide an intuitive explanation of how
more complex solution procedures work for larger LP
models.
Graphical Solution of LP Models cont’d)
Maximize Z = $40x1 + $50x2
subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0

Labor Constraint Area


Graphical Solution of LP Models
Maximize Z = $40x1 + $50x2
subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0

Clay Constraint Area


Graphical Solution of LP Models (cont’d)
Maximize Z = $40x1 + $50x2
subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0

Graph of Both Model Constraints


Graphical Solution: Isoprofit Line Solution
Method
• Optimal solution is the point in feasible region that
produces highest profit.
• There are many possible solution points in region.
• How do we go about selecting the best one, one yielding
highest profit?
• Let objective function (that is, $$40x1 + $50x2) guide one
towards optimal point in feasible region.
• Plot line representing objective function on graph as a
straight line.
Isoprofit Line Method

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0

Set Objective Function = 800


Objective Function Line for Z = $800
Isoprofit Line Method: Alternative Objective function Lines

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0

Alternative Objective Function Lines


Isoprofit Line Method: Optimal Solution

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0

Identification of the Optimal Solution


Isoprofit Line Method: Optimal Solution Coordinates

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0

Optimal Solution Coordinates


Graphical Solution: Corner Point Solution Method
• Corner point property states optimal solution to LP
problem will always occur at a corner point.

Maximize Z = $40x1 + $50x2


subject to: 1x1 + 2x2  40
4x1 + 3x2  120
x1, x2  0

Solution at All Corner Points


Slack Variables
• Standard form requires that all constraints be in
the form of equations.
• A slack variable is added to a  constraint to
convert it to an equation (=).
• A slack variable represents unused resources.
• A slack variable contributes nothing to the
objective function value.
Standard Form of LP Model

Max Z = 40x1 + 50x2 + s1 +s2


subject to:1x1 + 2x2 + s1 = 40
4x1 + 3x2 + s2 = 120
x1, x2, s1, s2  0
Where:
x1 = number of bowls
x2 = number of mugs
s1, s2 are slack variables

Solution Points A, B, and C with Slack


Minimization LP Problem
• Many LP problems involve minimizing objective such as cost instead
of maximizing profit function.
Examples:
– Restaurant may wish to develop work schedule to meet staffing
needs while minimizing total number of employees.
– Manufacturer may seek to distribute its products from several
factories to its many regional warehouses in such a way as to
minimize total shipping costs.
– Hospital may want to provide its patients with a daily meal plan
that meets certain nutritional standards while minimizing food
purchase costs.
Problem Definition: Holiday Meal Chicken Ranch
(HMCR) Example
• Buy two brands of feed for good, low-cost diet for chickens.
• Each feed may contain three nutritional ingredients (protein,
vitamin, and iron).
• One pound of Brand A contains:
– 5 units of protein,
– 4 units of vitamin, and
– 0.5 units of iron.
• One pound of Brand B contains:
– 10 units of protein,
– 3 units of vitamin, and
– 0 units of iron.
Problem Definition: HMCR Example (cont’d)

• Brand A feed costs ranch $0.02 per pound, while


Brand B feed costs $0.03 per pound.
• Ranch owner would like lowest-cost diet that
meets minimum monthly intake requirements for
each nutritional ingredient.
Composition of each Pound of Min. Monthly
Ingredient Feed (Oz) Requirement per
Brand A Feed Brand B Feed Turkey (Oz)
Protein 5 10 90
Vitamin 4 3 48
Iron ½ 0 1½
Cost Per Pound 2 Cents 3 Cents
The Mathematical Model: HMCR Example
Minimize cost (in cents) = 2A + 3B
Subject to:
5A + 10B  90 (protein constraint)
4A + 3B  48 (vitamin constraint)
½A  1½ (iron constraint)
A  0, B  0 (nonnegativity constraint)
The Standard LP Model: HMCR Example

Minimize cost (in cents)=2A+3B+0s1+0s2+0s3

subject to constraints:
5A + 10B - s1 = 90 (protein constraint)
4A + 3B - s2 = 48 (vitamin constraint)
½A - s3 = 1½ (iron constraint)
A, B, s1,s2 s3  0 (nonnegativity)
Graphical Representation of Constraints: HMCR
Example

Drawing
Constraints:

Nonnegativity Constraint
A  0, B  0
Graphical Solution – Isocost line Method: HMCR
Example

• Isocost line is moved parallel to 54-cent solution line toward lower left origin.
• Last point to touch the isocost line while still in contact with the feasible region, is
corner point 2.
• Solving for corner point 2 with two equations produces values 8.4 for A and 4.8
for B, minimum optimal cost solution is:
2A + 3B = (2)(8.4) + (3)(4.8) = 31.2
Graphical Solution – Isocost line Method: HMCR Example

• Point 1 - coordinates (A = 3, B = 12)


– cost of 2(3) + 3(12) = 42 cents.
• Point 2 - coordinates (A = 8.4, b = 4.8)
– cost of 2(8.4) + 3(4.8) = 31.2 cents
• Point 3 - coordinates (A = 18, B = 0)
– cost of (2)(18) + (3)(0) = 36 cents.

• Optimal minimal cost solution:


Corner Point 2, cost = 31.2 cents
Summary: Graphical Solution Method
1. Plot the model constraints accepting them as equalities,
2. Considering the inequalities of the constraints identify
the feasible solution region, that is, the area that
satisfies all constraints simultaneously.
3. Select one of two following graphical solution techniques
and proceed to solve problem.
- Isoprofit or Isocost Method.
- Corner Point Method
Summary: Graphical Solution Method
Corner Point Method
• Determine the coordinates of each of the corner
points of the feasible region by solving
simultaneous equations at each point.
• Compute the profit or cost at each point by
substituting the values of coordinates into the
objective function and solving for results.
• Identify the optimal solution as a corner point with
highest profit (maximization), or lowest cost
(minimization).
Summary: Graphical Solution Method

Isoprofit or Isocost Method

• Select an arbitrary value for profit or cost, and plot an


isoprofit / isocost line to reveal its slope.
• Maintain the same slope and move the line up or down until
it touches the feasible region at one point. While moving
the line up or down consider whether the problem is a
maximization or a minimization problem
• Identify the optimal solution as coordinates of the point that
is touched by the highest possible isoprofit line or lowest
possible isocost line (by solving the simultaneous equations)
• Read optimal coordinates and compute the optimal profit or
cost.
Special Situations in Solving LP Problems
• Special types of problems include those with:
– Redundancy
– Infeasible solutions
– Unbounded solutions
– Multiple optimal solutions

Redundancy: A redundant constraint is a constraint


that does not affect the feasible region in any
way.
Maximize Profit = 2X + 3Y
subject to:
X + Y  20
2X + Y  30
X  25
X, Y  0
Infeasibility: A condition that arises when an LP problem
has no solution that satisfies all of its constraints.

X + 2Y  6
2X + Y  8
X  7
Unboundedness: Sometimes an LP model will
not have a finite solution
Maximize profit
= $3X + $5Y
subject to:
X  5
Y  10
X + 2Y  10
X, Y  0
Multiple Optimal Solutions
• An LP problem may have more than one optimal solution.

– Graphically, when the isoprofit (or isocost) line runs


parallel to a constraint in the problem which lies in
the direction in which isoprofit (or isocost) line is
located.

– In other words, when they have the same slope.


Example: Multiple Optimal olutions

Maximize
Profit = $3x + $2y
Subject to:
6X + 4Y  24
X  3
X, Y  0
Solving LP Problems Using Excel’s Solver
• Consider the following problem:
– A Furniture Company produces tables and chairs.
– Each table requires: 4 hours of carpentry and 2 hours of painting.
– Each chair requires: 3 hours of carpentry and 1 hour of painting.
– Available production capacity: 240 hours of carpentry time and
100 hours of painting time.
– Due to existing inventory of chairs, no more than 60 new chairs
will be made.
– Each table sold results in $7 profit, while each chair produced
yields $5 profit.
– The problem: Determine the best possible combination of tables
and chairs to manufacture in order to attain maximum profit.
Solving LP Problems Using Excel’s Solver
• Now, suppose T tables and C chairs are manufactured
• The LP problem now becomes:
Maximize profit = $7T + $5C
Subject to constraints
4T + 3C  240 (carpentry constraint)
2T + 1C  100 (painting constraint)
C  60 (chairs limit constraint)
T, C  0 (non-negativity)
Solver Spreadsheet Setup
• Now Enter the following into Excel worksheet
LP Excel and Solver Parts
Changing cells
• Solver refers to decision variables as changing cells.
• In the example, there are two decision variables cells B5 and C5 to represent
number of tables to make (T) and number of chairs to make (C), respectively.
Target Cell
• Objective function, referred to as target cell by solver,
= SUMPRODUCT(B6:C6,$B$5:$C$5)
This is equivalent to =B6*B5+C6*C5
Each constraint has three parts -
1. A left hand side (LHS) part consisting of every term to the left of the
equality or inequality sign.
2. A right hand side (RHS) part consisting of all terms to the right of the
equality or inequality sign.
3. An equality or inequality sign.
Entering Information into Solver
Invoke Solver by clicking Data|Solver
• Specify Target Cell (D6)
• Specify Changing Cells (highlight B5, C5)

Flair Furniture
T C
Tables Chairs

Constraints:

LHS Sign RHS


Add Constraints into Solver
Specifying Constraints
• Use "Add" constraints to enter relevant cell references for
LHS and RHS.
• Either add constraints one at a time or add blocks of
constraints having same sign (<=, >=, or =) at the same
time.
• Since all constraints have same <= sign one chose to
highlight all LHS D8:D10 on left and F8:F10 on right with
<= sign.
Specify Constraints
Solution
• When Solve button is clicked, Solver executes model and
results appear as shown below.
• Optimal solution indicated that one should make 30 Tables
and 40 chairs with an optimal profit of $ 410.
Flair Furniture
T C
Tables Chairs

Constraints:

LHS Sign RHS


Possible Messages in Solver Results Window

Вам также может понравиться