business optimization and simulation - uc3m · 2015-01-26 · linear models: properties •in a...
TRANSCRIPT
BUSINESS OPTIMIZATION
AND SIMULATION Module 2
Linear Programming
STRUCTURE OF THE
MODULE
• Sessions:
• Introduction, definition and examples
• Properties and solution procedures
• Economic interpretation
THE ORIGINS OF LP
• George Dantzig was the founding father of LP
• He developed the Simplex method in 1947
• An intelligent algorithm that searches for the optimal
solution among a very reduced set of feasible
solutions
• Coinciding with the introduction of computers
• For some time, it constituted the bulk of all scientific
computation
THE ORIGINS OF LP
• The first LP problem solved was a diet problem (with 9 constraints
and 77 variables)
• 9 people worked during approximately 15 days to complete the
calculations required to solve the problem
• The first computer implementation of the Simplex method was
completed in 1952
• They solved a LP with 48 constraints and 71 variables in 18
hours
• Nowadays, it is possible to solve LP's with millions of variables and
constraints in hours or even minutes
LINEAR MODELS:
PROPERTIES • In a linear model, both the objective function and the constraints are linear
functions of the variables x, a + bTx
• The basic Linear Programming model can be written as:
where c is a vector of n components, x is the vector of decision variables,
A is an m x n matrix and b is a vector of m components
• A vector x satisfying the constraints is known as a feasible solution (even if
it is not a solution) or a feasible point
• The set of all feasible solutions is known as the feasible region
LINEAR MODELS:
PROPERTIES • LP's can be studied algebraically or geometrically
• Both approaches are equivalent
• Algebraic approach: write down the mathematical representation of the LP, for example,
• Analyze the matrix properties of its coefficients, in our case
LINEAR MODELS:
PROPERTIES • Geometric approach:
• study the geometry of the feasible region
EXAMPLE 1:
NUTRITIONAL DIET • A classic problem
• Description:
• Prepare a daily diet for a group of persons ensuring for each
individual minimum amounts of several nutritional components
(vitamins, proteins, calcium, fats, carbohydrates, etc)
• You have available n different basic foods (eggs, milk, bread,
chicken, etc.)
• To plan a diet providing a minimum amount of m nutritional
components
EXAMPLE 1:
NUTRITIONAL DIET • Data for the problem:
• Basic foods:
• With unit costs c1,...,cn
• Nutritional components:
• We need to provide at least b1,...,bm units of each component
• Relationship between foods and components:
• Each unit of food j contains aij units of component i
EXAMPLE 1:
NUTRITIONAL DIET
• The model:
• Variables: Find a diet vector x = (x1,...,xn) that specifies the quantities
of each food to purchase every day
• Objective function: Minimize the total cost
• Constraints: Satisfy the nutritional requirements
EXAMPLE 1:
NUTRITIONAL DIET • The data:
• Solution: x1 = 3.7209, x2 = 2.0930, cost = 22.7907
• Multipliers: 0.0930 (Carbohydrates), 0 (Proteins), 0.3023
(Fats)
Food
Beef Potatoes Daily
req.
Carbohydrates 5 15 50
Proteins 20 5 40
Fats 15 2 60
Cost per serving 5 2
EXAMPLE 1:
NUTRITIONAL DIET • Problem formulation:
• Variables:
• Amounts of basic foods in the diet
• Objective function:
• Total cost
• Constraints:
• Meet diet requirements
• Nonnegative variables
LINEAR MODELS:
PROPERTIES • The diet problem:
• Feasible region
• Objective fn
EXAMPLE 2:
MARKETING CAMPAIGN • Description:
• To sell a new product, a firm has a marketing budget of 100000 euros/week
• The product can be advertised in four media:
TV, Newspapers, Radio and Internet
• The potential clients during a week reached by each ad in each media are:
5000, 8500, 2400 and 2800, respectively
• The weekly cost of an ad in each media is:
600, 925, 290 and 380, respectively
• Each media imposes a limit on the maximum number of weekly ads that the
company can purchase:
30, 60, 60 and 80, respectively
• How can the company assign the marketing budget to reach the largest
audience (potential clients)?
EXAMPLE 2:
MARKETING CAMPAIGN • The model:
• Variables: Find, for each media, the number of ads to purchase in
each of the media, x = (x1,x2,x3,x4)
• Objective function: Reach the largest possible audience
• Constraints:
• Budget limits
• Maximum number of ads per media
• Non negativity
EXAMPLE 2:
MARKETING CAMPAIGN • The model:
• Solution:
• Purchase each week 30 TV ads, 60
Newspaper ads, 60 Radio ads and 24 Internet
ads
LINEAR MODELS:
SOLUTION • Possible solutions of an LP:
• There exists a unique optimal solution (in a vertex)
• There exist infinite optimal solutions (corresponding to
edges, facets, of the feasible region)
• The optimal solution is unbounded
• The feasible region is empty (infeasible problem)
LINEAR MODELS:
SOLUTION • If a LP is feasible and bounded, it has at least one optimal solution, and
at least one of these solutions corresponds to a vertex of the feasible
region
• As the number of vertices is finite, it is enough to find a solution by
looking at the finite number of vertices in the feasible region
• This is the basis of the Simplex algorithm:
• Computational algorithm based on an iterative procedure (as all
algorithms in Mathematical Programming) to compute a solution for
LPs
• Developed by G.B. Dantzig in 1947, it marks the beginning of modern
optimization
LINEAR MODELS:
SOLUTION • How does the Simplex algorithm work?
1. Find an initial feasible vertex
• It can be obtained by solving an auxiliary (linear) problem
2. Check if the vertex is optimal
• By looking at the change in the objective function along the edges leaving the vertex
3. If it is not optimal, select the edge giving the best improvement
4. Move to the vertex at the other end of the selected edge
5. Repeat until a solution is reached (in a finite number of steps)
• How to represent these operations in linear algebra terms?
ECONOMIC INTERPRETATION
OF THE SOLUTION • To obtain other useful information from the solution of a linear (or nonlinear)
problem we need to understand not only the values of the variables, but
also those of some parameters related to this solution
• Lagrange multipliers
• From these values we can assign prices to the resources and requirements
for the solution
• And also understand why a certain set of values is optimal
• We may also conduct a robustness analysis:
• What happens to the solution if the value of a parameter changes?
SOLUTION: ECONOMIC
INTERPRETATION • Shadow prices provide relevant information for the economic analysis of the
solution of an LP
• Each constraint has a shadow price
• It represents the change in the value of the objective function for a unit change
in the right-hand side of the constraint
• This value can be understood as the value of one additional resource unit:
• If you pay the shadow price for this unit, your total profit does not change
• The Simplex algorithm computes these shadow prices as part of the solution
process
SOLUTION: ECONOMIC
INTERPRETATION • To understand the meaning of these shadow prices, consider again the
diet example:
• Whose optimal solution is:
x1 = 3.7209, x2 = 2.0930, cost = 22.7907
• With multipliers:
0.0930 (Carbohydrates), 0 (Proteins), 0.3023 (Fats)
ECONOMIC INTERPRETATION
OF THE SOLUTION • Assume that we are required to supply 51 grams of carbohydrates, instead of
50
• The new problem to solve is:
• The new optimal solution is:
x1 = 3.7116, x2 = 2.1628, cost = 22.8837
• The cost has increased by 0.093 euros, that is, by the value of the
multiplier (shadow price) associated with the first constraint
ECONOMIC INTERPRETATION
OF THE SOLUTION • We also have values for the shadow prices corresponding to the
protein and fat requirements:
• The optimal diet provides 84.8837 grams of proteins, more than
twice the minimum required amount (40)
• The solution does not change if we increase the requirement, and
its shadow price is 0
• If the minimum requirement for fat is increased to 61 grams, the
cost goes up to 23.093 euros
• The increase in cost is 0.3023 euros (its shadow price)
ECONOMIC INTERPRETATION
OF THE SOLUTION
• To obtain these values in Excel, you first invoke the Solver
• Once you get a solution, highlight ”Sensitivity” in the dialog window
• You get another sheet with the contents shown below
ECONOMIC INTERPRETATION
OF THE SOLUTION • Additional relevant information in the solution of a linear program is given by the
reduced costs
• A reduced cost is associated to a variable with a value equal to 0 or at its lower
bound
• It represents the change in the objective function when the variable takes the value
1 (or one more than the lower bound)
• An interpretation of the reduced cost:
• The cost of starting a new activity (that was not being carried out)
• If the variables have upper bounds ub, then the reduced costs associated to these
upper bounds:
• Represent change in the objective function if the variable takes the value ub + 1,
• Represent the profit associated to a unit increase in the value of that variable,
already at its highest value
ECONOMIC INTERPRETATION
OF THE SOLUTION • For the marketing campaign problem:
• Find number of ads in each media to reach the largest
audience
• The report obtained by selecting “Sensitivity” is:
ECONOMIC INTERPRETATION
OF THE SOLUTION
• From the preceding values you have:
• The shadow price of the budget constraint is 7.3684
• Each additional euro in the budget would increase the audience by 7.3684 potential
clients
• The optimal number of Internet ads is 0 < 23,9474 < 80
• Its reduced cost is 0
• The optimal number of TV ads is at its upper bound (=30) and its reduced cost is 578.9474
• Each additional ad would increase the audience by 578.9474 viewers
• The optimal number of Newspaper ads is at its upper bound (=60) and its reduced cost is
1684.2105
• Each additional ad would increase the audience by 1684.2105 readers
• The optimal number of Radio ads is at its upper bound (=60) and its reduced cost is
263.1579
• Each additional ad would increase the audience by 263.1579 listeners
ECONOMIC INTERPRETATION
OF THE SOLUTION • Finally, we can also obtain information on the maximum
changes in the parameters of the problem that do not
affect the solution
• For the diet problem we select the “Sensitivity” option,
and obtain
ECONOMIC INTERPRETATION
OF THE SOLUTION • Note the values in the columns “Allowable increase” and “Allowable
decrease”
• For changes in the coefficients in the objective function we have
that:
• The value of the cost of beef can increase up to 5 + 10 and the
solution will not change
• It can also decrease to 5 - 4.33 and the solution will not change
• The same solution is also preserved for any values of the cost of
potatoes in the interval [0.67,15]
ECONOMIC INTERPRETATION
OF THE SOLUTION • For the right-hand side of the constraints we have:
• The value of the fat requirement can increase up to 60 + 90 and decrease to 60 - 35.09
without affecting the solution
• But consider for example the case when the fat requirement is 61. The new solution is:
• In these cases the values of the variables at the solution are affected. What is not
affected?
• The constraints that are active at the solution
• The values of the Lagrange multipliers