Sei sulla pagina 1di 305

Operations Research

Dr. Sarat K Jena


Tour decision
Imagine that you have a 5 week business commitment between Goa and
Mumbai. You will fly out of Goa on Mondays and return on
Wednesdays. A regular round-trip ticket cost Rs.8000, but a 20%
discount is granted if the round-trip dates span weekend. A one way
ticket in either direction costs 75% of the regular price. How should you
buy the tickets for the 5-week period?
We look at the situation

• What are the decision alternatives?

• Under what restrictions is the decision made?

• What is an appropriate objective criterion for evaluating the

alternatives?
Three plausible alternatives
• Buy five regular Goa-Mum-Goa for departure on Monday and return
on Wednesday of the same week.
cost=5*8000=40,000
• Buy one Goa-Mumbai, four Mum-Goa-Mub that span weekends, and
one Mum-Goa.
Cost = .75*8000 + 4(.8*8000)+.75*8000=37,600
• Buy one Goa-Mum-Goa to cover Monday of the first week and
Wednesday of the last week and four Mum-Goa-Mum to cover the
remaining legs. All tickets in this alternative span at least one
weekend.
Cost=5*(.8*8000)=32,000
Question arises
• How each component is developed?
• How the resulting model is solved?

Consider forming a maximum-area rectangle out of piece of wire length


L inches. What should be the best width and height of the rectangle?

Here, the number of alternatives are not finite. Because the width and
height of the rectangular can assume an infinite number of values.

w = Width of the rectangular


h = height of the rectangular in inches
• Restriction: 1. Width of the rectangular+ height of the rectangle=Half
the length of the wire. 2. Width and height cannot be negative.
Algebraically, we can define
• 2(w+h)=L
• w ≥0, h ≥ 0
Our question is to maximize the are(z)
Maximize z= wh
subject to
2(w+h)=L
w, h ≥ 0
Nurse allocation
• Nurse scheduling is multi-objective problem. Systematic approach for
nurse allocation is needed to ensure continuous and adequate level of
patient care services while maintaining the legislative requirements as
well as internal policies. This problem becomes complex when
addition factors such as patient admission, nurse qualification or
license to practice, type of disease as well unforeseen accidents.
The personal needs of the nurses such as vacation or work shift
preferences add a new dimension to the scheduling problem. The need
to balance all the various dimension of the problem makes nurse
scheduling a particularly daunting manual task.
There are various grades of nurses ranging from registered nurse to junior
nurse. Some the nurses might be trained to manage certain medical
conditions or skilled in certain area such as intensive care. Due to the
varied trainings and specializations, certain type of nurses has to be staffed
for wards requiring those skills. These varied conditions cause manual
nurse scheduling to consume a significant amount of time. Even when the
schedule has been planned manually, it does not necessarily guarantee the
fairness of distribution of work such as the number of night shifts or
weekend shifts. While the nurses might have indicated their preferences,
the planner might not have taken all these into consideration resulting in
poorly designed schedules which has to be modified by the nurses
swapping duties or working under undesired conditions. Occasionally, the
plans did not attempt to efficiently utilize the manpower properly.
What is operations research?
• Operations research is a scientific approach to decision making, which seeks to
determine how best to design and operate a system, under the condition requiring
the allocation of scarce resources.
• Extensive applications in Engineering, business and public system
• It was invented/originated during world war II, when British military asked
scientists and mathematicians to analyse the military problems and also to
optimize the loading of cargo on ships and planes and to manage other critical
resources.
• Today it is called Management Science
Solving the model
The most prominent OR techniques are
• Linear programming
• Integer programming
• Dynamic programming
• Network programming
• Nonlinear programming
Linear programming
• Linear Programming consists of the two words
• Linear : it is used to describe the relationships between variables
which are directly proportional
• Programming: It means planning of activities in a manner that
achieves some optimal result with available resources.
• Linear programming indicates the planning of decision variables which
are directly proportional to achieve the optimal result considering the
limitations within which the problem to be sold.
• Decision variable: It refers to the economic or physical quantities which are
competing with one another for sharing the given limited resources.
• The linear model consists of the following components:
• A set of decision variables.
• An objective function.
• A set of constraints.
• The Importance of Linear Programming
• Many real world problems lend themselves to linear programming modeling.
• Many real world problems can be approximated by linear models.
• There are well-known successful applications in:
• Manufacturing
• Marketing
• Finance (investment)
• Advertising
• Agriculture
Assumptions of linear programming
• Non-negativity restriction: All decision variables must take on
values equal or greater than zero
• Divisibility: The numerical values are continuous
• Proportionality: The effect of a decision variable in any one
equation is proportional to a constant quantity.
• Certainty: All models are known constant
• Additivity: The combined effect of the decision variables in any
one equation is the algebraic sum of their individual
weighted effects
The Linear Programming Model
Let: X1, X2, X3, ………, Xn = decision variables
Z = Objective function or linear function
Requirement: Maximization of the linear function Z.
Z = c1X1 + c2X2 + c3X3 + ………+ cnXn …..Eq (1)
subject to the following constraints:

where aij, bi, and cj are given constants.


.
Contd.
The linear programming model can be written in more efficient notation as:

The decision variables, xI, x2, ..., xn, represent levels of n competing activities.
Examples of LP Problems

1. A Product Mix Problem


• A manufacturer has fixed amounts of different resources such as raw
material, labor, and equipment.

• These resources can be combined to produce any one of several different


products.

• The quantity of the ith resource required to produce one unit of the jth
product is known.

• The decision maker wishes to produce the combination of products that


will maximize total income.
2. A Blending Problem
• Blending problems refer to situations in which a number of components (or
commodities) are mixed together to yield one or more products.
• Typically, different commodities are to be purchased. Each commodity has
known characteristics and costs.
• The problem is to determine how much of each commodity should be
purchased and blended with the rest so that the characteristics of the mixture
lie within specified bounds and the total cost is minimized.
3. A Production Scheduling Problem

• A manufacturer knows that he must supply a given number of items of a


certain product each month for the next n months.
• They can be produced either in regular time, subject to a maximum each
month, or in overtime. The cost of producing an item during overtime is
greater than during regular time. A storage cost is associated with each item
not sold at the end of the month.
• The problem is to determine the production schedule that minimizes the sum
of production and storage costs.
4. A Transportation Problem

• A product is to be shipped in the amounts al, a2, ..., am from m shipping


origins and received in amounts bl, b2, ..., bn at each of n shipping
destinations.
• The cost of shipping a unit from the ith origin to the jth destination is
known for all combinations of origins and destinations.
• The problem is to determine the amount to be shipped from each origin
to each destination such that the total cost of transportation is a
minimum.
Developing LP Model
• The variety of situations to which linear programming has been
applied ranges from agriculture to zinc smelting.

• Steps Involved:
• Determine the objective of the problem and describe it by a
criterion function in terms of the decision variables.
• Find out the constraints.
• Do the analysis which should lead to the selection of values for the
decision variables that optimize the criterion function while
satisfying all the constraints imposed on the problem.
Example: Product Mix Problem
The N. Dustrious Company produces two products: I and II. The raw
material requirements, space needed for storage, production rates, and
selling prices for these products are given in Table 1.

The total amount of raw material available per day for both products is 15751b. The
total storage space for all products is 1500 ft2, and a maximum of 7 hours per day can
be used for production.
Example Problem
All products manufactured are shipped out of the storage area at the end of the day.
Therefore, the two products must share the total raw material, storage space, and production
time. The company wants to determine how many units of each product to produce per
day to maximize its total income.

Solution

• The company has decided that it wants to maximize its sale income, which depends on
the number of units of product I and II that it produces.
• Therefore, the decision variables, x1 and x2 can be the number of units of products I and
II, respectively, produced per day.
• The object is to maximize the equation:
Z = 13x1 + 11x2
subject to the constraints on storage space, raw materials, and production time.
• Each unit of product I requires 4 ft2 of storage space and each unit of product II requires 5 ft2. Thus a
total of 4x1 + 5x2 ft2 of storage space is needed each day. This space must be less than or equal to the
available storage space, which is 1500 ft2. Therefore,
4X1 + 5X2  1500
• Similarly, each unit of product I and II produced requires 5 and 3 1bs, respectively, of raw material.
Hence a total of 5xl + 3x2 Ib of raw material is used.
• This must be less than or equal to the total amount of raw material available, which is 1575 Ib.
Therefore,
5x1 + 3x2  1575
• Product A can be produced at the rate of 60 units per hour. Therefore, it must take1
minute or 1/60 of an hour to produce I unit. Similarly, it requires 1/30 of an hour to
produce 1 unit of product B. Hence a total of x1/60 + x2/30 hours is required for the daily
production. This quantity must be less than or equal to the total production time
available each day. Therefore,
x1 / 60 + x2 / 30  7
or x1 + 2x2  420

• Finally, the company cannot produce a negative quantity of any product, therefore x1 and
x2 must each be greater than or equal to zero.
• The linear programming model for this example can be summarized as:
Graphical Solution to LP Problems
Question
A company makes two kinds of leather belts. Belt A is a high quality belt,
and belt B is of lower quality. The respective profits are Re. 0.40 and Re.
0.30 per belt. Each belt of type A requires twice as much time as a belt of
type B, and if all belts were of type B, the company could make 1,000 per
day. The supply of leather is sufficient for only 800 belts per day (both A
and B combined). Belt A requires a fancy buckle, and only 400 per day are
available. There are only 700 buckles a day available for belt B.

What should be the daily production of each type of belt? Formulate the
linear programming problem.
• Let x1 = Number of Belt A to be produced
• x2 = Number of Belt B to be produced Since the objective is to
maximize the profit,
• the objective function is given by —
Maximize Z = .40x1 + .30x2
Subject to constraints:
2x1 + x2 ≤ 1000 (Total availability of time)
x1 + x2 ≤ 800 (Total availability of leather)
x1 ≤ 400 (Availability of buckles for belt A)
x2 ≤ 700 (Availability of buckles for belt B)
x1, x2 ≥ 0 (Non-negativity constraint)
Question
A publisher of textbooks is in the process of presenting a new book to the
market. The book may be bound by either cloth or hard paper. Each cloth
bound book sold contributes Rs. 24, and each paper-bound book contributes
Rs. 23. It takes 10 minutes to bind a cloth cover, and 9 minutes to bind a
paperback. The total available time for binding is 800 hours. After
considerable market survey, it is predicted that the cloth-cover sales will
exceed at least 10,000 copies, but the paperback sales will be not more than
6,000 copies. Formulate the problem as a LP problem.
Solution
• Let x1 = Number of books bound by cloth
• x2 = Number of books bound by hard paper
• Since the objective is to maximize the profit, the objective function is
given by —
Maximize Z = 24x1 + 23x2
Subject to constraints:
10x1 + 9x2 ≤ 48,000 (Total time available in minutes)
x1 ≥ 10,000 (Minimum sales of cloth-cover books)
x2 ≤ 6,000 (Maximum sales of hard paper books)
x2 ≥ 0 (Non-negativity constraint)
Question
A manufacture produces three models, I, II, and III, of a certain product
using raw materials A and B. The following tables gives the data for the
problem:
Requirements per unit
R/M I II III Availability
A 2 3 5 4000
B 4 2 7 6000
Minimum demand 200 200 150
Price per unit($) 30 20 50

The labour time per unit of model I is twice that of II and three times of III.
The entire labour force of the factory can produce the equivalent of 1500
units I. Market requirements specify the ratios 3:2:5 for the production of
the three respective models. Formulate the problems as a linear program.
Answer
X1, x2 and X3 are the number of units of product for I,II and III.
Maximize z=30x1+20x2+50x3
Subject to
2 x1+3x2+5x3 ≤ 4000
4x1+2x2+7x3 ≤ 6000
x1+.5x2+.33x3 ≤ 1500
2 x1-3 x2 =0
5x2-2x3=0
x1 ≥ 200, x2 ≥200, x1 ≥150
x1, x2, x3 ≥0
Contd…
A farmer has 100 acre farm. He can sell all the tomatoes, drumstick or radishes he can rise.
The price he can obtain is ₹ 1 per kg for tomatoes, ₹ 0.75 for a head of drumstick and ₹ 2
per kg for radishes. The average yield per acre is 2,000 kg of tomatoes, 3,000 heads of
drumstick, and 1,000 kgs of radishes. Fertilizer is available at ₹ 0.50 per kg and the amount
required per acre is 100 kg each for tomatoes and drumstick, and 50 kg for radishes.
Labour required for showing cultivating and harvesting per acre is 5 man-days for
tomatoes and radishes and 6 man-days for drumstick. A total of 400 man-days of labour are
available at ₹ 20 per man-day. Formulate this problem as a linear programming model.

Formulate the problem as a standard LPP to maximize the farmer’s total profit
Some Examples
• A garment manufacturer has a production line making two styles of shirts, Style I
requires 200 grams of cotton thread, 300 grams of Dacron thread, and 300 grams of
linen thread. Style II requires 200grams of cotton thread, 200 grams of Dacron thread
and 100 grams of linen thread. The manufacturer makes a net profit of Rs.19.50 on
style I, Rs.15.90 on Style II. He has in hand an inventory of 24 kg of cotton thread, 26
kg of Dacron thread and 22 kg of linen thread. His immediate problem is to determine a
production schedule, given the current inventory to make maximum profit. Formulate
the LPP model
• A person requires 10,12,& 12 units chemicals A, B,& C respectively for his garden. A
liquid product contains 5, 2 and 4 units of A, B & C respectively per jar. A dry products
contains 1, 2 & 4 units of A, B and C per carton. If the liquid product sells for Rs.3 per
jar and the dry product sells for Rs.2 per carton. How many should be purchased in
order to minimize the cost and meet the requirements. Formulate the LPP model
The Galaxy Industries Production Problem : A Prototype Example
• Galaxy manufactures two toy doll models:
• Space Ray.
• Zapper.
• Resources are limited to
• 1000 pounds of special plastic.
• 40 hours of production time per week.
• Marketing requirement
• Total production cannot exceed 700 dozens.
• Number of dozens of Space Rays cannot exceed number of
dozens of Zappers by more than 350.
• Technological input
– Space Rays requires 2 pounds of plastic and
3 minutes of labor per dozen.
– Zappers requires 1 pound of plastic and
4 minutes of labor per dozen.
• The current production plan calls for:
• Producing as much as possible of the more profitable product, Space Ray ($8
profit per dozen).
• Use resources left over to produce Zappers ($5 profit per dozen), while
remaining within the marketing guidelines.

• The current production plan consists of:


8(450) + 5(100)
Space Rays = 450 dozen
Zapper = 100 dozen
Profit = $4100 per week

Management is seeking a
production schedule that will
increase the company’s profit.
The Galaxy Linear Programming Model
• Decisions variables:
• X1 = Weekly production level of Space Rays (in dozens)
• X2 = Weekly production level of Zappers (in dozens).

• Objective Function: Max 8X1 + 5X2 (Weekly profit)


• Weekly profit, to be maximized subject to
2X1 + 1X2 1000 (Plastic)
3X1 + 4X2 2400 (Production Time)
X1 + X2 700 (Total production)
X1 - X2 350 (Mix)
Xj> = 0, j = 1,2 (Non negativity)
The Graphical Analysis of Linear Programming

The set of all points that satisfy all the


constraints of the model is called
a

FEASIBLE REGION
Using a graphical presentation
we can represent all the constraints,
the objective function, and the three
types of feasible points.
Steps
• Consider any type of inequality constraint(≥ & ≤) as = one.
• Now, draw the line corresponding to equality constraint and
corresponding to x ≥ 0, y≥0 and shade the region corresponding to the
segment in he first quadrant.
• Repeat the steps(1), (2),and(3) above for all the constraints given in the
problem.
• Find the region( in the first quadrant) which is the most common to all
the constraints. The region, if it exists, is the feasible region.
• If either the feasible region is convex and bounded or has a lower
bound(bounded below) then the optimal solution to the problem exists on
at least of the vertices.(Practically, we find all the vertices of the convex
region, evaluate the objective function at these vertices, and pick up the
optimum value and corresponding vertex/vertices).
Graphical Analysis – the Feasible Region

X2

The non-negativity constraints

X1
Graphical Analysis – the Feasible Region

X2

1000 The Plastic constraint


2X1+X2  1000
700 Total production constraint:
X1+X2  700 (redundant)
500

Infeasible
Production Feasible
Time
3X1+4X2  2400 X1
500 700 800
Graphical Analysis – the Feasible Region
X2
1000 The Plastic constraint
2X1+X2 1000
700 Total production constraint:
X1+X2 700 (redundant)
500
Infeasible
Production mix
constraint:
Production Feasible X1-X2  350
Time
3X1+4X22400
X1
500 700
Interior points. Boundary points. Extreme points.
• There are three types of feasible points 42
Solving Graphically for an Optimal Solution
The search for an optimal solution

X2 Start at some arbitrary profit, say profit = $2,000...


1000 Then increase the profit, if possible...
...and continue until it becomes infeasible

700 Profit=$4360
500

X1
44
500
Summary of the optimal solution

Space Rays = 320 dozen


Zappers = 360 dozen
Profit = $4360
• This solution utilizes all the plastic and all the production
hours.

• Total production is only 680 (not 700).

• Space Rays production exceeds Zappers production by only


40 dozens.
Question from Graphical method
A company produces two products, A and B. The sales volume for A is at
least 80% of the total sales of both A and B. However, the company cannot
sell more than 100 units of A per day. Both products use one raw material,
of which the maximum daily availability is 240 lb. The usage rate of the
raw material are 2 lb per unit off A and 4 lb per unit of B. The profit units
for A and B are $20 and $50, respectively. Determine the optimal product
mix for the company.
Answer
X1= number of units of A
X2=Number of units of B
Maximize z=20x1+50x2
Subject to (x1,x2)=(80,20), z=2,600
(x1+x2).8 ≤ x1
x1 ≤ 100
2x1+4x2 ≤ 240
x1, x2 ≥ 0
Question
1. Determine the feasible space for each of the following independent
constrains, given that x1, x2 ≥0
a. -3x1 + x2 ≥ 6
b. -x1 + x2 ≥ 0

2. Identify the direction of increase in z in each of the following cases:


a. maximize z= x1-x2
b. maximize z= -3x1+x2
Question
Consider the following LP:
Maximize z = 2x1+3x2
Subject to
x1+3x2 ≤ 6
3x1+2x2 ≤ 6
x1, x2 ≥ 0
a. Use direct substitution in the objective function to determine the
optimum basic feasible solution. x1=6/7, x2=12/7, z=48/7

b. Show how the infeasible basic solutions are represented on the


graphical solution space (0,3) and (6,0)
Question
• A company is planning to determine its product mix out of three different products: P1, P2 and P3. The

monthly sales of the product P1 is limited to a maximum of 500 units. For every 2 units of product P2 there

will be one unit of by-product which can be sold at the rate of Rs. 20 per unit. The highest monthly demand for

this by-product is 200 units. The contributions per unit of the product P1, P2 and P3 are Rs. 50, Rs. 70 and Rs.

60 respectively. The processing requirements of these products are as below-

Process Hours per Unit Available Hours

P1 P2 P3

I 3 5 2 1000

II 4 - 3 700

III 4 3 2 1300

Formulate a LPP model with the objective to maximize the total contribution.
Max z=50x1+70x2+60x3+x2/2*20
Subject to
3x1+5x2+2x3 <=1000
4x1+3x3<=700
4x1+3x2+2x3<=1300
x1<=500
x2<=400
x1, x2 >=0
Question

X1 X2 Z
2 3 -4
3 4 -5
2.666667 2 -1.333333
5 2 1
5 4 -3

Maximize z=x1-2x2
Subject to
-x1 + x2 <= 1
6x1 + 4x2 >= 24
0 ≤ x1 ≤ 5, 2 ≤ x2 ≤ 4,
Models Without Unique Optimal Solutions

• Infeasibility: Occurs when a model has no feasible


point.
• Unboundness: Occurs when the objective can become
infinitely large (max), or infinitely small (min).
• Alternate solution: Occurs when more than one point
optimizes the objective function
Infeasible Model

No point, simultaneously,
lies both above line 1 and
below lines 2 and 3
2 .

3 1
Solver – Infeasible Model
Unbounded solution

Solver – Unbounded solution
Solver – An Alternate Optimal Solution

• Solver does not alert the user to the existence of alternate optimal
solutions.
• Many times alternate optimal solutions exist when the allowable increase
or allowable decrease is equal to zero.
• In these cases, we can find alternate optimal solutions using Solver by the
following procedure:
Shadow Prices

Assuming there are no other changes to the input


parameters, the change to the objective function value
per unit increase to a right hand side of a constraint is
called the “Shadow Price”
Shadow Price – graphical demonstration
The Plastic
constraint X2
When more plastic becomes available (the
plastic constraint is relaxed), the right hand
side of the plastic constraint increases.
1000

Maximum profit = $4360

Maximum profit = $4363.4


500
Shadow price =
4363.40 – 4360.00 = 3.40

Production time X1
constraint
500
Range of Feasibility

• Assuming there are no other changes to the input


parameters, the range of feasibility is
• The range of values for a right hand side of a constraint,
in which the shadow prices for the constraints remain
unchanged.
• In the range of feasibility the objective function value
changes as follows:
Change in objective value =
[Shadow price][Change in the right hand side value]
The Plastic
Range of Feasibility
constraint
X2

Increasing the amount of


plastic is only effective until a
1000
new constraint becomes active.
Production mix A new active
constraint constraint
X1 + X2  700
500
This is an infeasible solution
Production time
constraint

X1
500
Range of Feasibility
The Plastic
constraint
X2

Note how the profit


1000 increases as the amount of
plastic increases.

500

Production time
constraint
X1
500
Range of Feasibility
X2

Less plastic becomes available (the


1000 plastic constraint is more restrictive).
Infeasible
solution The profit decreases

500

A new active
constraint
X1

500
The correct interpretation of shadow price

• Sunk costs: The shadow price is the value of an extra


unit of the resource, since the cost of the resource is not
included in the calculation of the objective function
coefficient.

• Included costs: The shadow price is the premium value


above the existing unit value for the resource, since the
cost of the resource is included in the calculation of the
objective function coefficient.
Simplex Method
The geometric method of solving linear programming problems
presented before. The graphical method is useful only for problems
involving two/three decision variables and relatively few problem
constraints.

What happens when we need more decision variables and more


problem constraints?

We use an algebraic method called the simplex method, which was


developed by George B. DANTZIG (1914-2005) in 1947 while on
assignment with the U.S. Department of the air force.
The simplex technique involves generating a series of solutions in
tabular form, called tableaus. By inspecting the bottom row of each
tableau, one can immediately tell if it represents the optimal solution.
Each tableau corresponds to a corner point of the feasible solution
space. The first tableau corresponds to the origin. Subsequent tableaus
are developed by shifting to an adjacent corner point in the direction
that yields the highest (smallest) rate of profit (cost). This process
continues as long as a positive (negative) rate of profit (cost) exists.
The key solution concepts
Solution Concept 1: the simplex method focuses on CPF
solutions.
Solution concept 2: the simplex method is an iterative
algorithm (a systematic solution procedure that keeps
repeating a fixed series of steps, called, an iteration, until a
desired result has been obtained) with the following
structure:
Simplex algorithm
Initialization: setup to start iterations, including
finding an initial CPF solution

Optimality test: is the current CPF solution


optimal?

if no if yes stop

Iteration: Perform an iteration to find a


better CFP solution
Simplex method in tabular form
2. Test for optimality:
Case 1: Maximization problem
the current BF solution is optimal if every coefficient in
the objective function row is nonnegative
Case 2: Minimization problem
the current BF solution is optimal if every coefficient in
the objective function row is nonpositive
Slack Variables and Surplus Variable
“A mathematical representation of surplus resources.” In real life
problems, it’s unlikely that all resources will be used completely, so there
usually are unused resources.
 Slack variables represent the unused resources between the left-hand
side and right-hand side of each inequality.
 Constraints of type (≤) : for each constraint i of this type, we add a
slack variable si, such that si is nonnegative.
Example: x1 + 2x2 ≤ 10 translates into x1 + 2x2 + s1=10
 Constraints of type (≥) : for each constraint i of this type, we add a
Surplus variable si, such that si is nonnegative.
Example: x1 + 2x2 ≥ 10 translates into x1 + 2x2 - s1=10
Basic and Nonbasic Variables
Basic variables are selected arbitrarily with the restriction that there be as
many basic variables as there are equations. The remaining variables are
non-basic variables.
x1  2 x2  s1  32
3x1  4 x2  s2  84

This system has two equations, we can select any two of the four variables
as basic variables. The remaining two variables are then non-basic
variables. A solution found by setting the two non-basic variables equal to 0
and solving for the two basic variables is a basic solution. If a basic
solution has no negative values, it is a basic feasible solution.
To solve a linear programming problem in standard form, use
the following steps.
Step I: Check whether the objective function of the given LPP is to maximized or
minimized. If it is to
be minimized then we convert it into a problem of Maximization
Min Z= -max(-Z)
Step II: Check whether all bi (i= 1, 2, 3,…m) are posistive. If any one of 𝑏𝑖 is negative
then multiply the in equation of the constraint by -1 so as to get all 𝑏𝑖 to be
positive
Step III: Express the problem in standard form by introducing slack/surplus variables, to
convert the inequality constraints into equation.
Step IV: Create the initial simplex tableau.
Step V: Select the pivot column(entering variable) :The column with the “most negative
value” element in the last row.
Step VI: Select the pivot row(leaving variable): The row with the smallest non-negative result when the
last element in the row is divided by the corresponding in the pivot column.)
Step VII: Use elementary row operations calculate new values for the pivot row so that the pivot is 1
(Divide every number in the row by the pivot number.) ( Pivot number: the number in the
intersection of the pivot row and pivot column)
Step VIII: Form a new basis by dropping in the leaving variable and introducing the entering variable
along with the associate value.
𝑒𝑙𝑒𝑚𝑒𝑛𝑡 𝑜𝑛 𝑡ℎ𝑒 𝑙𝑖𝑛𝑒 𝑜𝑓 𝑡ℎ𝑒 𝑝𝑖𝑣𝑜𝑡∗𝑒𝑙𝑒𝑚𝑒𝑛𝑡 𝑖𝑛 𝑡ℎ𝑒 𝑐𝑜𝑙𝑢𝑚𝑛 𝑜𝑓 𝑡ℎ𝑒 𝑝𝑖𝑣𝑜𝑡
So new element= old element−
𝑝𝑖𝑣𝑜𝑡
Step X: Stopping the iteration
We stop when we reach the optimality criterion. The simplex algorithm stops when:
there is no negative solution in the last row: basic variables for maximization and there is no
positive in the last row for minimization.
Simplex method
• Example (All constraints are )
Solve the following problem using the simplex method
• Maximize
Z = 3X1+ 5X2
Subject to
X1  4
2 X2  12
3X1 +2X2  18
X1 , X2  0
Simplex method
• Solution
• Initialization
1. Standard form
Maximize Z, Sometimes it is called the augmented form of
the problem because the original form has been
Subject to augmented by some supplementary variables
needed to apply the simplex method
Z - 3X1- 5X2 =0

X1 + S1 = 4
2 X2 + S2 = 12
3X1 +2X2 + S3 = 18
X1 , X2, S1, S2, S3  0
Definitions
• A basic solution is an augmented corner point solution.
• A basic solution has the following properties:
1. Each variable is designated as either a nonbasic variable or a basic variable.
2. The number of basic variables equals the number of functional constraints.
Therefore, the number of nonbasic variables equals the total number of variables
minus the number of functional constraints.
3. The nonbasic variables are set equal to zero.
4. The values of the basic variables are obtained as simultaneous solution of the system
of equations (functional constraints in augmented form). The set of basic variables
are called “basis”
5. If the basic variables satisfy the nonnegativity constraints, the basic solution is a
Basic Feasible (BF) solution.
Initial tableau
Entering
2. Initial tableau variable

Basic X1 X2 S1 S2 S3 RHS
variable
S1 1 0 1 0 0 4
S2 0 2 0 1 0 12
S3 3 2 0 0 1 18
Z -3 -5 0 0 0 0

Leaving Pivot row


Pivot column
variable Pivot
number
Simplex tableau
Notes:
• The basic feasible solution at the initial tableau is (0, 0,
4, 12, 18) where:
X1 = 0, X2 = 0, S1 = 4, S2 = 12, S3 = 18, and Z = 0
Where S1, S2, and S3 are basic variables
X1 and X2 are nonbasic variables
• The solution at the initial tableau is associated to the
origin point at which all the decision variables are zero.
Optimality test
• By investigating the last row of the initial tableau, we find that there are
some negative numbers. Therefore, the current solution is not optimal
Iteration
• Step 1: Determine the entering variable by selecting the variable with the most
negative in the last row.
• From the initial tableau, in the last row (Z row), the coefficient of X1 is -3 and the
coefficient of X2 is -5; therefore, the most negative is -5. consequently, X2 is the
entering variable.
• X2 is surrounded by a box and it is called the pivot column
• Step 2: Determining the leaving variable by using the minimum ratio test as following:
Basic Entering RHS Ratio
variable variable X2
(1) (2) (2)(1)
S1 0 4 None
S2 2 12 6
Leaving Smallest ratio
S3 2 18 9
Iteration
• Step 3: solving for the new BF solution by using the
eliminatory row operations as following:
1. New pivot row = old pivot row  pivot number

Basic X1 X2 S1 S2 S3 RHS
variable
S1
X2 0 1 0 1/2 0 6
S3
Z
Note that X2 becomes in the basic
variables list instead of S2
Iteration
2. For the other row apply this rule:
New row = old row – the coefficient of this row in the pivot column × (new pivot row).
For S1 Row
X1 X2 S1 S2 S3 RHS
1 0 1 0 0 4
̶
0 ×(0 1 0 1/2 0 6)
1 0 1 0 0 4
For S3 Row
3 2 0 0 1 18
̶
2 ×(0 1 0 1/2 0 6)
3 0 0 -1 1 6 Substitute this
for Z Row values in the
-3 -5 0 0 0 0
table
̶
-5× (0 1 0 1/2 0 6)
-3 0 0 5/2 0 30
Iteration
This solution is not optimal, since there is a negative numbers in the last row

Basic X1 X2 S1 S2 S3 RHS
variable
S1 1 0 1 0 0 4
X2 0 1 0 1/2 0 6
S3 3 0 0 -1 1 6
Z -3 0 0 5/2 0 30

The smallest ratio is


The most negative
6/3 =2; therefore, S3 is
value; therefore, X1
the leaving variable
is the entering
variable
Iteration
• Apply the same rules we will obtain this solution:

Basic X1 X2 S1 S2 S3 RHS
variable
S1 0 0 1 1/3 -1/3 2
X2 0 1 0 1/2 0 6
X1 1 0 0 -1/3 1/3 2
Z 0 0 0 3/2 1 36

This solution is optimal; since there is no negative solution in the last row: basic
variables are X1 = 2, X2 = 6 and S1 = 2; the nonbasic variables are S2 = S3 = 0
Z = 36
Problem 1
The Cannon Hill furniture Company produces tables and chairs.
Each table takes four hours of labor from the carpentry
department and two hours of labor from the finishing department.
Each chair requires three hours of carpentry and one hour of
finishing. During the current week, 240 hours of carpentry time
are available and 100 hours of finishing time. Each table produced
gives a profit of $70 and each chair a profit of $50. How many
chairs and tables should be made?
STEP 1
All information about example
Resource Table s ( x1 ) Chairs (x2 ) Constraints
Carpentry (hr) 4 3 240
Finishing (hr) 2 1 100
Unit Profit $70 $50

Objective Function Z  70 x1  50 x2

Carpentry Constraint 4 x1  3x2  240

Finishing Constraint 2 x1  1x2  100

Non-negativity conditions x1 , x2  0
The first step of the simplex method requires that each inequality be converted into an
equation. ”less than or equal to” inequalities are converted to equations by including
slack variables.
Suppose s1 carpentry hours and s 2 finishing hours remain unused in a week. The
constraints become;
or

4 x1  3 x2  s1  240 4 x1  3 x2  s1  0 s2  240
2 x1  x2  s2  100 2 x1  x2  0 s1  s2  100

As unused hours result in no profit, the slack variables can be included in the objective
function with zero coefficients:
Z  70 x1  50 x2  0 s1  0 s2
Z  70 x1  50 x2  0s1  0s2  0
STEP 2
Basic
x1 x2 S1 S2 RHS
Variables

S1 4 3 1 0 240
S2 2 1 0 1 100
Z -70 -50 0 0 0

The tableau represents the initial solution;

x1  0, x2  0, s1  240, s2  100, Z  0

The slack variables S1 and S2 form the initial solution mix. The initial solution
assumes that all avaliable hours are unused. i.e. The slack variables take the largest
possible values.
STEP 3
Select the pivot column (determine which variable to enter into the
solution mix). Choose the column with the “most negative”
element in the objective function row.

Right
Basic
x1 x2 S1 S2 hand
Variables
side
S1 4 3 1 0 240
S2 2 1 0 1 100
Z -70 -50 0 0 0

Pivot column
x1 should enter into the solution mix because each unit of x1 (a table) contributes a
profit of $70 compared with only $50 for each unit of x1 (a chair)
STEP 5
Select the pivot row (determine which variable to replace in the solution mix).
Divide the last element in each row by the corresponding element in the
pivot column. The pivot row is the row with the smallest non-negative
result.
Enter

Basic
x1 x2 S1 S2 RHS
Variables

S1 4 3 1 0 240 240/ 4  60
Leaving S2 2 1 0 1 100 100 / 2  50
Z -70 -50 0 0 0
Pivot row
Pivot
column
Pivot number
Should be replaced by x1 in the solution mix. 60 tables can be
made with 240 unused carpentry hours but only 50 tables can
be made with 100 finishing hours. Therefore we decide to make
50 tables.
Now calculate new values for the pivot row. Divide every number
in the row by the pivot number.

Basic Right hand


x1 x2 S1 S2
Variables side

S1
x1 1 1/2 0 1/2 50 R2
2
Z
Use row operations to make all numbers in the pivot column
equal to 0 except for the pivot number which remains as 1.

Right
Basic
x1 x2 S1 S2 hand
Variables
side
S1 0 1 1 -2 40
x1 1 1/2 0 1/2 50
Z 0 -15 0 35 3500

If 50 tables are made, then the unused carpentry hours are reduced
by 200 hours (4 h/table multiplied by 50 tables); the value changes
from 240 hours to 40 hours. Making 50 tables results in the profit
being increased by $3500; the value changes from $0 to $3500.
In this case, x1  50, x2  0, s1  40, s2  0, Z  3500
Now repeat the steps until there are no negative numbers in the last row.

Select the new pivot column. x2 should enter into the solution mix.
Select the new pivot row. S1 should be replaced by x2 in the solution mix.
Enter

Right
Basic
x1 x2 S1 S2 hand
Variables
side
Exit S1 0 1 1 -2 40 40 /1  40
x1 1 1/2 0 1/2 50 50/ 0,5  100

P 0 -15 0 35 3500
New pivot
New pivot row
column
Calculate new values for the pivot row. As the pivot number is already 1,
there is no need to calculate new values for the pivot row.

Use row operations to make all numbers in the pivot column equal to
except for the pivot number.

Right
Basic
x1 x2 S1 S2 hand
Variables
side
x2 0 1 1 -2 40
x1 1 0 -1/2 3/2 30
Z 0 0 15 5 4100
If 40 chairs are made, then the number of tables are reduced by 20 tables (1/2
table/chair multiplied by 40 chairs); the value changes from 50 tables to 30 tables.
The replacement of 20 tables by 40 chairs results in the profit being increased by
$600; the value changes from $3500 to $4100.

As the last row contains no negative numbers, this solution gives the maximum value
of P.
Result

This simplex tableau represents the optimal solution to the LP problem and
is interpreted as:
and profit or Z=$4100
x1  30, x2  40, s1  0, s2  0
The optimal solution (maximum profit to be made) is to company 30 tables
and 40 chairs for a profit of $4100.
Special cases of linear programming
• Infeasible solution
• Multiple solution (infinitely many solution)
• Unbounded solution
• Degenerated solution
Notes on the Simplex tableau
1. In any Simplex tableau, the intersection of any basic variable with itself is always one and the
rest of the column is zeroes.
2. In any simplex tableau, the objective function row (Z row) is always in terms of the nonbasic
variables. This means that under any basic variable (in any tableau) there is a zero in the Z row.
For the non basic there is no condition ( it can take any value in this row).
3. If there is a zero under one or more nonbasic variables in the last tableau (optimal solution
tableau), then there is a multiple optimal solution.
4. When determining the leaving variable of any tableau, if there is no positive ratio (all the
entries in the pivot column are negative and zeroes), then the solution is unbounded.
5. If there is a tie (more than one variables have the same most negative or positive) in
determining the entering variable, choose any variable to be the entering one.
6. If there is a tie in determining the leaving variable, choose any one to be the leaving variable.
In this case a zero will appear in RHS column; therefore, a “cycle” will occur, this means that
the value of the objective function will be the same for several iterations.
7. A Solution that has a basic variable with zero value is called a “degenerate solution”.
8. If there is no Artificial variables in the problem, there is no room for “infeasible solution”
Simplex method incase of Artificial variables
“Big M method”
• Solve the following linear programming problem by using
the simplex method:
• Min Z =2 X1 + 3 X2
S.t.
½ X1 + ¼ X2 ≤ 4
X1 + 3X2  20
X1 + X2 = 10
X1, X2  0
Big M method
• Notes
M, a very large number, is used to ensure that the values of A1 and A2, …, and An will be zero in the final
(optimal) tableau as follows:
1. If the objective function is Minimization, then A1, A2, …, and An must be added to the RHS of the objective
function multiplied by a very large number (M).
Example: if the objective function is Min Z = X1+2X2, then the obj. function should be Min Z = X1 + X2+ MA1 +
MA2+ …+ MAn
OR

Z – X1 - X2- MA1 - MA2- …- MAn = 0


2. If the objective function is Maximization, then A1, A2, …, and An must be subtracted from the RHS of the
objective function multiplied by a very large number (M).
Example: if the objective function is Max Z = X1+2X2, then the obj. function should be Max Z = X1 + X2- MA1 -
MA2- …- MAn
OR
Z - X1 - X2+ MA1 + MA2+ …+ MAn = 0
N.B.: When the Z is transformed to a zero equation, the signs are changed
Big M method
• Solution
Step 1: standard form
Min Z,
s.t.
Z – 2 X1 – 3 X2 - M A1 -M A2 =0
½ X1 + ¼ X2 + S1 =4
X1 + 3X2 - S2 + A1 = 20
X1 + X2 + A2 = 10
X1, X2 ,S1, S2, A1, A2  0
Where: M is a very large number
Big M method
• Step 2: Initial tableau

Basic X1 X2 S1 S2 A1 A2 RHS
variables 2 3 0 0 M M

S1 ½ ¼ 1 0 0 0 4
A1 1 3 0 -1 1 0 20
A2 1 1 0 0 0 1 10
Z -2 -3 0 0 -M -M 0

Not Zero
Note that one of the simplex rules is violated, which is the basic variables A1, and A2 have a
non zero value in the z row; therefore, this violation must be corrected before proceeding in
the simplex algorithm as follows.
Big M method
• To correct this violation before starting the simplex algorithm, the
elementary row operations are used as follows:
New (Z row) = old (z row) ± M (A1 row) ± M (A2 row)
In our case, it will be positive since M is negative in the Z row, as
following:
Old (Z row): -2 -3 0 0 -M -M 0
M * (A1 row): M 3M 0 -M M 0 20M
M* (A2 row): M M 0 0 0 M 10M
New (Z row):2M-2 4M-3 0 -M 0 0 30M

It becomes zero
Big M method
• The initial tableau will be:
Basic X1 X2 S1 S2 A1 A2 RHS
variables 2 3 0 0 M M

S1 1/2 1/4 1 0 0 0 4
A1 1 3 0 -1 1 0 20
A2 1 1 0 0 0 1 10
Z 2M-2 4M-3 0 -M 0 0 30M

• Since there is a positive value in the last row, this solution is not optimal
• The entering variable is X2 (it has the most positive value in the last row)
• The leaving variable is A1 (it has the smallest ratio)
Big M method
• First iteration

Basic X1 X2 S1 S2 A1 A2 RHS
variables 2 3 0 0 M M

S1 5/12 0 1 1/12 -1/12 0 7/3

X2 1/3 1 0 -1/3 1/3 0 20/3

A2 2/3 0 0 1/3 -1/3 1 10/3

Z 2/3M-1 0 0 1/3M-1 1-4/3M 0 20+10/3M

• Since there is a positive value in the last row, this solution is not optimal
• The entering variable is X1 (it has the most positive value in the last row)
• The leaving variable is A2 (it has the smallest ratio)
Big M method
• Second iteration
Basic X1 X2 S1 S2 A1 A2 RHS
variables
S1 0 0 1 -1/8 1/8 -5/8 1/4

X2 0 1 0 -1/2 1/2 -1/2 5

X1 1 0 0 1/2 -1/2 3/2 5

Z 0 0 0 -1/2 ½-M 3/2-M 25

This solution is optimal, since there is no positive value in the last row. The
optimal solution is:
X1 = 5, X2 = 5, S1 = ¼
A1 = A2 = 0 and Z = 25
Note for the Big M method

• In the final tableau, if one or more artificial variables (A1, A2,


…) still basic and has a nonzero value, then the problem has an
infeasible solution.
• All other notes are still valid in the Big M method.
Special cases
• In the final tableau, if one or more artificial variables (A1, A2, …) still basic
and has a nonzero value, then the problem has an infeasible solution
• If there is a zero under one or more nonbasic variables in the last tableau
(optimal solution tableau), then there is a multiple optimal solution.
• When determining the leaving variable of any tableau, if there is no positive
ratio (all the entries in the pivot column are negative and zeroes), then the
solution is unbounded.
• In simplex table more than one variable is eligible to leave the basis, and
hence the next simplex iteration produces a degenerate solution in which at
least one basic variable is zero. Then solution in a LPP is known as
degeneracy.
• In degeneracy case, it may not produce improvements in the value of the
objective function, as a result, it is possible to repeat the same sequence of
simplex iteration endlessly without improvement of the solution. This
concept is known as cycling.
1. Max Z =3 X1 + 9 X2
S.t. 3. Max Z =2 X1 + 2 X2
X1 + 4 X2 ≤ 8 S.t.
Degeneracy 2X1 + X2 ≤ 100
X1 + 2X2 ≤ 4
X1 + X2 ≤ 80 Multiple solution
X1, X2  0
X1 ≤ 40
X1, X2  0
2. Max Z =2 X1 + X2
S.t. Unbounded solution 4. Max Z = 2X1 + 5 X2
X1 - X2 ≤ 10 S.t. Infeasible solution
2X1 - X2 ≤ 40 X1 + 2X2 ≤ 2
X1, X2  0 2X1 + 6X2  12
X1, X2  0
The two-phase simplex method
• Step 1
Modify the constraints so that the right-hand side of each constraint is nonnegative. This
requires that each constraint with a negative right-hand side be multiplied through by -
1.
• Step 1’
Identify each constraint that is now an = or ≥ constraint. In step 3, we will add an the
artificial variable to each of these constraints.
• Step 2
Convert each inequality constraint to standard form.
For ≤ constraint i, we add a slack variable si;
For ≥ constraint i, we add an excess variable ei;
The two-phase simplex method

• Step 4
For now, ignore the original LP’s objective function. Instead solve an LP
whose objective function is min w’=(sum of all the artificial variables).
This is called the Phase I LP. The act of solving the phase I LP will
force the artificial variables to be zero.
The two-phase simplex method

Since each ai≥0, solving the Phase I LP will result in one of the following
three cases:
• Case 1
The optimal value of w’ is greater than zero. In this case, the original LP
has no feasible solution.
• Case 2
The optimal value of w’ is equal to zero, and no artificial variables are in
the optimal Phase I basis. In this case, we drop all columns in the optimal
Phase I tableau that correspond to the artificial variables. We now
combine the original objective function with the constraints from the
optimal Phase I tableau. This yields the Phase II LP. The optimal solution
to the Phase II LP is the optimal solution to the original LP.
The two-phase simplex method

• Case 3
The optimal value of w’ is equal to zero and at least one artificial variable
is in the optimal Phase I basis. In this case, we can find the optimal
solution to the original LP if at the end of Phase I we drop from the
optimal Phase I tableau all nonbasic artificial variables and any variable
from the original problem that has a negative coefficient in row 0 of the
optimal Phase I tableau.
Phase I and II feasible solutions
• Suppose the original LP is infeasible. Then the only way to
obtain a feasible solution to the Phase I LP is to let at least
one artificial variable be positive. In this situation, w’>0
will result.
• On the other hand, if the original LP has a feasible solution,
this feasible solution is feasible in the Phase I LP and
yields w’=0. This means that if the original LP has a
feasible solution, the optimal Phase I solution will have
w’=0.
Phase I
Consists of finding an initial basic feasible solution to the original
problem. For this purpose, an artificial objective function is created
which is the sum of all the artificial variables. The artificial objective is
then minimized using the Simplex Method. If the minimum value of the
artificial problem is zero, then it follows that all of the artificial variables
are zero, and an initial basic feasible solution for the original problem has
been obtained. Otherwise, a basic feasible solution for the original
problem does not exist (the problem has no feasible solutions- referred to
as Inconsistent).
 Phase II
The basic feasible solution found at the end of Phase I is optimized with
respect to the original objective function, i.e., the final tableau of Phase I
becomes the first tableau for Phase II (the objective row is changed).
Example
 Example:
Minimize z = -3x1+ x2 + x3
Subject to:
x1 - 2x2 + x3  11
-4x1 + x2 + 2x3 3
2x1 - x3 = -1
x1, x2 , x3  0
 The first phase of the two-phase method is given by the problem:
Minimize w = A1 + A2
Subject to:
x1 - 2x2 + x3 + S1 = 11 (1)
-4x1 + x2 +2x3 - S2+A1 = 3 (2)
-2x1 + x3 + A2 = 1 (3)
x1, x2 , x3, S1, S2, A1, A2 0
(Note A1 , A2 are solely for the purpose of developing a basic solution)
Example (cont.)
Objective function in standard Form is
Maximize -w + A1 + A2 =0 (0)
x1 - 2x2 + x3 + S1 = 11 (1)
-4x1 + x2 + 2x3 - S2+A1 =3 (2) A1= 3+4x1 - x2 -
2x3 + S2
-2x1 + x3 + A2 =1 (3) A2= 1+2x1 - x3
x1, x2 , x3, S1, S2, A1, A2 0
Substituting A1, A2 into (0) we get:
-w + (3+4x1 - x2 - 2x3) + (S2 + 1+2x1 - x3) =0
-w + 6 x1- x2 -3x3 + S2 = -4 (0)
x1- 2x2 +x3 + S1 = 11 (1)
-4x1 + x2 + 2x3 - S2+A1 =3 (2)
-2x1 + x3 + A2= 1 (3)
x1, x2 , x3, S1, S2, A1, A2 0
First Phase Solution
Iter Basic Eq. w X1 X2 X3 S1 S2 A1 A2 Rt Sd
Var. (Sol)
0 w 0 -1 6 -1 -3 0 1 0 0 -4
S1 1 0 1 -2 1 1 0 0 0 11
A1 2 0 -4 1 2 0 1 1 0 3
A2 3 0 -2 0 1 0 0 0 1 1
1 w 0 -1 0 -1 0 0 1 0 3 -1
S1 1 0 3 -2 0 1 0 0 -1 10
A1 2 0 0 1 0 0 -1 1 -2 1
X3 3 0 -2 0 1 0 0 0 1 1
2 w 0 -1 0 0 0 0 0 1 1 0
S1 1 0 3 0 0 1 -2 2 -5 12
X2 2 0 0 1 0 0 -1 1 -2 1
X3 3 0 -2 0 1 0 0 0 1 1

At this point, we have found a feasible solution (w = 0): X2=1, X3=1. Now we
need to solve the original problem (Second Phase)
Second Phase Solution
 Now we need to solve the original (real) problem; so the Phase I w row
is discarded and the actual objective is restored.
• Max -z -3x1 + x2 + x3 = 0
 Note that x2 , x3 are basic variables (their coefficient in the objective
function must be zero), so they must be removed (“priced out”) using the
other equations (solving or using row operations).
 First, we illustrate with equations (from the last tableau of the first phase)
3x1- + S1- 2S2 = 12 (1)
x2 - S2 =1 (2) x2= 1 + S2
-2x1 + x3 =1 (3) x3 = 1 + 2x1
Thus the objective function becomes:
-z -3x1 + (1 + S2) + (1 + 2x1) = 0
-z - x1+ S2 = -2 (0)
 If we use row operations, we can accomplish the same result.
Second Phase Solution
It Basic Eq z X1 X2 X3 S1 S2 Rt Sd
Var. . (Sol)
0 z 0 -1 -1 0 0 0 1 -2
S1 1 0 3 0 0 1 -2 12
X2 2 0 0 1 0 0 -1 1
X3 3 0 -2 0 1 0 0 1
1 z 0 -1 0 0 0 1/3 1/3 2
X1 1 0 1 0 0 1/3 -2/3 4
X2 2 0 0 1 0 0 -1 1
X3 3 0 0 0 1 2/3 -4/3 9

This is the solution to the original problem


Duality Theory

The theory of duality is a very elegant and important


concept within the field of operations research. This
theory was first developed in relation to linear
programming, but it has many applications, and perhaps
even a more natural and intuitive interpretation, in several
related areas such as nonlinear programming, networks
and game theory.
 The notion of duality within linear programming
asserts that every linear program has associated with it
a related linear program called its dual. The original
problem in relation to its dual is termed the primal.
 It is the relationship between the primal and its dual,
both on a mathematical and economic level, that is
truly the essence of duality theory.
Examples
There is a small company in Melbourne which has recently
become engaged in the production of office furniture. The
company manufactures tables, desks and chairs. The
production of a table requires 8 kgs of wood and 5 kgs of
metal and is sold for $80; a desk uses 6 kgs of wood and 4
kgs of metal and is sold for $60; and a chair requires 4 kgs of
both metal and wood and is sold for $50. We would like to
determine the revenue maximizing strategy for this
company, given that their resources are limited to 100 kgs of
wood and 60 kgs of metal.
Problem

max Z  80 x1  60 x 2  50 x 3
x
8 x1  6 x 2  4 x3  100
5x1  4 x2  4 x 3  60
x1 , x 2 , x3  0
Now consider that there is a much bigger company in
Melbourne which has been the lone producer of this type of
furniture for many years. They don't appreciate the
competition from this new company; so they have decided to
tender an offer to buy all of their competitor's resources and
therefore put them out of business.
The challenge for this large company then is to develop a
linear program which will determine the appropriate amount
of money that should be offered for a unit of each type of
resource, such that the offer will be acceptable to the smaller
company while minimizing the expenditures of the larger
company.
Relationships between Primal and Dual Problems

One Problem Other Problem


Constraint i i
Variable
Objective function Right sides

Minimization Maximization
0 
Variables
0  Constraints
Unrestricted 
 0
Constraints
 0 Variables
 Unrestricted
min w  100 y1  60 y2
y
8 y1  5 y2  80
6 y1  4 y2  60
4 y1  4 y2  50
y1, y2  0
Example
• Write the dual problem associated with this problem:
Minimize C  6x  8 y
subject to 40 x  10 y  2400
10 x  15 y  2100 Primal
Problem
5 x  15 y  1500
x, y  0
• We first write down a tableau for the primal problem:
x y Constant
40 10 2400
10 15 2100
5 15 1500
6 8
Example
x y Constant
40 10 2400
10 15 2100
5 15 1500
6 8

• Next, we interchange the columns and rows of the tableau and head the
three columns of the resulting array with the three variables u, v, and w,
obtaining
u v w Constant
40 10 5 6
10 15 15 8
2400 2100 1500
Example
u v w Constant
40 10 5 6
10 15 15 8
2400 2100 1500

• Consider the resulting tableau as if it were the initial


simplex tableau for a standard maximization problem.
• From it we can reconstruct the required dual problem:
Maximize P  2400u  2100v  1500w
subject to 40u  10v  5w  6 Dual
10u  15v  15w  8 Problem

u, v , w  0
The Transportation Model
Characteristics
• A product is transported from a number of sources to a number of
destinations at the minimum possible cost.
• Each source is able to supply a fixed number of units of the product,
and each destination has a fixed demand for the product.
• The linear programming model has constraints for supply at each source
and demand at each destination.
• All constraints are equalities in a balanced transportation model where
supply equals demand.
• Constraints contain inequalities in unbalanced models where supply
does not equal demand.
• Distributing any commodity from any group of supply
centers, called sources, to any group of receiving centers,
called destinations, in such a way as to minimize the total
distribution cost (shipping cost).
Transportation Problem (TP)
Total supply must equal total demand.
If total supply exceeds total demand, a dummy destination, whose demand
equals the difference between the total supply and total demand is
created. Similarly if total supply is less than total demand, a dummy
source is created, whose supply equals the difference.
All unit shipping costs into a dummy destination or out of a dummy
source are 0.
Example 1:
Example 2:

Destination Supply

D1 D2 D3 D4
S1 50 75 35 75 12
Source S2 65 80 60 65 17

S3 40 70 45 55 11
(D) 0 0 0 0 10
Demand 15 10 15 10
Transportation Tableau:
Initial Solution Procedure:
Northwest Corner Starting Procedure

1. Select the remaining variable in the upper left (northwest) corner and note
the supply remaining in the row, s, and the demand remaining in the column, d.

2. Allocate the minimum of s or d to this variable. If this minimum is s,


eliminate all variables in its row from future consideration and reduce the
demand in its column by s; if the minimum is d, eliminate all variables in the
column from future consideration and reduce the supply in its row by d.

REPEAT THESE STEPS UNTIL ALL SUPPLIES HAVE BEEN


ALLOCATED.
Total shipping cost = 2250
2. Least Cost Starting Procedure
1. For the remaining variable with the lowest unit cost, determine the
remaining supply left in its row, s, and the remaining demand left in its
column, d (break ties arbitrarily).
2. Allocate the minimum of s or d to this variable. If this minimum is s,
eliminate all variables in its row from future consideration and reduce the
demand in its column by s; if the minimum is d, eliminate all variables in
the column from future consideration and reduce the supply in its row by
d.
REPEAT THESE STEPS UNTIL ALL SUPPLIES HAVE BEEN
ALLOCATED.
Total sipping cost = 2065
Example1

D1 D2 D3 D4 Supply

O1 11 13 17 14 250

O2 16 18 14 10 300

O3 21 24 13 10 400

Demand 200 225 275 250


Example 2
A product is produced by 4 factories F1, F2, F3 & F4. The unit
production cost are Rs.2, Rs.3 Rs.1 & Rs. 5 respectively. Production
capacity of the factories are 50, 70, 40 & 50 units respectively. The
production is supplied to four stores S1, S2, S3 & S4. The requirements
of which are 25, 35,105, and 20 respectively. The unit cost of the
transpiration are given below.
S1 S2 S3 S4
F1 2 4 6 11
F2 10 8 7 5
F3 13 3 9 12
F4 4 6 8 3
Question
There are three factories A, B, and C which supply goods to four dealers D1,
D2, D3 &D4. The production capacities of these factories are 1000,700, and
900 units per month respectively. The requirements from the dealers are 900,
800,500 and 400 units per month respectively. The per unit return(excluding
transpiration cost ) are Rs. 8, Rs. 7 and Rs.9 at three factories. The following
table gives the unit transpiration costs from the factories to the dealers.
D1 D2 D3 D4
A 2 2 2 4
B 3 5 3 2
C 4 3 2 1

Determine the optimum solution to maximize the total return.


3. Vogel’s Approximation Method Starting Procedure
1. For each remaining row and column, determine the difference between the
lowest two remaining costs; these are called the row and column penalties.
2. Select the row or column with the largest penalty found in step 1 and note
the supply remaining for its row, s, and the demand remaining in its column,
d.
3. Allocate the minimum of s or d to the variable in the selected row or
column with the lowest remaining unit cost. If this minimum is s, eliminate
all variables in its row from future consideration and reduce the demand in
its column by s; if the minimum is d, eliminate all variables in the column
from future consideration and reduce the supply in its row by d.
REPEAT THESE STEPS UNTIL ALL SUPPLIES HAVE BEEN
ALLOCATED.
Total sipping cost = 2030
Solving TP – Transportation Simplex Method

1. Find the current Cij–Zij values for each nonbasic variable and
select the one with the most negative Cij–Zij value as the entering
variable; if all Cij–Zij values are nonnegative, the current solution is
optimal.
2. Determine which basic variable reaches 0 first when the entering
variable is increased.
3. Determine a new basic solution and repeat the steps.
Transportation Algorithm
• MODI Method (for obtaining reduced costs)
Associate a number, ui, with each row and vj with each column.
• Step 1: Set u1 = 0. (To start with we assign a number “0” to any
row of column having maximum number of allocations. If
maximum number of allocation is more than one, choose any one
arbitrarily.
• Step 2: Calculate the remaining ui's and vj's by solving the
relationship cij = ui + vj for occupied cells.
• Step 3: For unoccupied cells (i,j), the reduced cost = cij - ui - vj.
• Step 4: find out for each empty cell the net evaluation value ∆𝑖𝑗 =
cij - ui – vj and which is written at the bottom right corner of that
cell.
Contd…..
If all ∆𝑖𝑗 >0 (i.e., all the net evaluation value) the solution is optimum.
If ∆𝑖𝑗 >= 0 then the solution is optimum, but an alternate solution exists
If at least one ∆𝑖𝑗 <0, the solution is not optimum. In this case we go to the next step,
to improve the total transpiration cost.
Step 5: Select the empty cell having the most –ve value of ∆𝑖𝑗 . From this
cell we draw a closed path by drawing horizontal and vertical lines with
the corner cells occupied. Assign sign + and – alternatively and find the
minimum allocation from the cell having –ve sign. This allocation
should be added to the allocation having +ve sign and subtracted from
the allocation having –ve sign.
Step 6: Check the optimality, otherwise repeat the step2 till an optimum
basic feasible solution exit.
Non-basic cells:

Note: X13 is the entering variable.


Step 2: Determine Which Current Basic Variable Reaches 0 First

Note: 1. Cycle property


2. X12 is the leaving variable
Step 3: Determine the Next Transportation
Tableau

Total shipping cost = 2020


{Improvement = 2 (-5) = 10 }
Another example

Northwood Westwood Eastwood Dummy Supply


24 30 40 0
Plant 1 50

30 40 42 0
Plant 2 50

Demand 25 45 10 20
Through Least cost

Northwood Westwood Eastwood Dummy Supply


24 30 40 0
Plant 1 25 5 20 50

30 40 42 0
Plant 2 40 10 50

Demand 25 45 10 20

Total transportation cost is $2770


 Iteration 1
• MODI Method (continued)
Calculate the reduced costs (circled numbers on the
next slide) by cij - ui + vj.

Unoccupied Cell Reduced Cost


(1,3) 40 - 0 - 32 = 8
(2,1) 30 - 24 -10 = -4
(2,4) 0 - 10 - 0 = -10
•Since some of the reduced cost are negative, the current
solution is not optimal.
• Cell (2,4) has the most negative; therefore, it will be the
basic variable that must be occupied in the next iteration.
• Iteration 1 Tableau

Northwood Westwood Eastwood Dummy ui


24 30 40 0
Plant 1 25 5 +8 20 0

30 40 42 0
Plant 2 -4 40 10 -10 10

vj 24 30 32 0
Example: BBC
• Iteration 1
• Stepping Stone Method
The stepping stone path for cell (2,4) is (2,4), (1,4), (1,2), (2,2). The
allocations in the subtraction cells are 20 and 40, respectively. The minimum
is 20, and hence reallocate 20 along this path. Thus for the next tableau:
x24 = 0 + 20 = 20 (0 is its current allocation)
x14 = 20 - 20 = 0 (blank for the next tableau)
x12 = 5 + 20 = 25
x22 = 40 - 20 = 20
The other occupied cells remain the same.
Northwood Westwood Eastwood Dummy Supply
24 30 40 0
Plant 1 25 25 50

30 40 42 0
Plant 2 20 10 20 50

Demand 25 45 10 20
New
Total quantity
Totaltransportation
transportationcost
costisis$2570
$2570==2770
2770––1010(20)
(20)
Reduced cost of
• Iteration 2
• MODI Method (continued)
Calculate the reduced costs (circled numbers on the next
slide) by cij - ui + vj.

Unoccupied Cell Reduced Cost


(1,3) 40 - 0 - 32 = 8
(1,4) 0 - 0 - (-10) = 10
(2,1) 30 - 10 - 24 = -4

Since there is still negative reduced cost for cell (2,1), the solution is not optimal.
Cell (2,1) must be occupied
 Iteration 2 Tableau

Northwood Westwood Eastwood Dummy ui


24 30 40 0
Plant 1 25 25 +8 +10 0

30 40 42 0
Plant 2 -4 20 10 20 10

vj 24 30 36 -6
 Iteration 2
• Stepping Stone Method
The most negative reduced cost is = -4 determined by x21. The
stepping stone path for this cell is (2,1),(1,1),(1,2),(2,2). The allocations in
the subtraction cells are 25 and 20 respectively. Thus the new solution is
obtained by reallocating 20 on the stepping stone path. Thus for the next
tableau:
x21 = 0 + 20 = 20 (0 is its current allocation)
x11 = 25 - 20 = 5
x12 = 25 + 20 = 45
x22 = 20 - 20 = 0 (blank for the next tableau)
The other occupied cells remain the same.
Northwood Westwood Eastwood Dummy Supply
24 30 40 0
Plant 1 5 45 50

30 40 42 0
Plant 2 20 10 20 50

Demand 25 45 10 20

Total cost is $2490 = 2570 - 4(20)


 Iteration 3
• MODI Method (continued)
Calculate the reduced costs (circled numbers on the
next slide) by cij - ui + vj.

Unoccupied Cell Reduced Cost


(1,3) 40 - 0 - 36 = 4
(1,4) 0 - 0 - (-6) = 6
(2,2) 40 - 6 - 30 = 4

Since all the reduced cost are nonnegative, the current


solution is optimal
• Optimal Solution

From To Amount Cost


Plant 1 Northwood 5 120
Plant 1 Westwood 45 1,350
Plant 2 Northwood 20 600
Plant 2 Eastwood 10 420
Total Cost = $2,490
The Assignment Problem (AP)

A special case of TP with m=n and si=dj for all i, and j.


The Hungarian Algorithm
=> Solving the assignment problem of a least cost assignment of m
workers to m jobs
Assumptions:
1. There is a cost assignment matrix for the m “people” to be assigned to m
“tasks.” (If necessary dummy rows or columns consisting of all 0’s are
added so that the numbers of people and tasks are the same.)
2. All costs are nonnegative.
3. The problem is a minimization problem.
The Hungarian Algorithm
Initialization
1. For each row, subtract the minimum number from all numbers in that
row.
2. In the resulting matrix, subtract the minimum number in each column
from all numbers in the column.
Iterative Steps
1. Make as many 0 cost assignments as possible. If all workers are assigned, STOP; this
is the minimum cost assignment. Otherwise draw the minimum number of horizontal and
vertical lines necessary to cover all 0’s in the matrix. (A method for making the maximum
number of 0 cost assignments and drawing the minimum number of lines to cover all 0’s
follows.)
2. Find the smallest value not covered by the lines; this number is the reduction value.
3. Subtract the reduction value from all numbers not covered by any lines. Add the
reduction value to any number covered by both a horizontal and vertical line.
GO TO STEP 1.
For small problems, one can usually determine the maximum number of zero
cost assignments by observation. For larger problems, the following procedure
can be used:
Determining the Maximum Number of Zero-Cost Assignments
1. For each row, if only one 0 remains in the row, make that assignment and
eliminate the row and column from consideration in the steps below.
2. For each column, if only one 0 remains, make that assignment and eliminate
that row and column from consideration.
3. Repeat steps 1 and 2 until no more assignments can be made. (If 0’s remain,
this means that there are at least two 0’s in each remaining row and column.
Make an arbitrary assignment to one of these 0’s and repeat steps 1 and 2.)
Again, for small problems, the minimum number of lines required to cover all
the 0’s can usually be determined by observation. The following procedure,
based on network flow arguments, can be used for larger problems:
Drawing the Minimum Number of Lines to Cover All 0’s
1. Mark all rows with no assignments (with a “‧”).
2. For each row just marked, mark each column that has a 0 in that row (with a
“‧”).
3. For each column just marked, mark each row that has an assignment in that
column (with a “‧”).
4. Repeat steps 2 and 3 until no more marks can be made.
5. Draw lines through unmarked rows and marked columns.
Example:
Minimum uncovered
number
Minimum uncovered
number
• Five wagons are available at stations 1,2,3,4 and 5. These are required
at five stations I, II, III, IV and V. The mileages between various
stations are given by the table below. How should the wagons be
transported so as to minimize the total mileage covered?

I II III IV V

1 10 5 9 18 11
2 13 9 6 12 14
3 3 2 4 4 5
4 18 9 12 17 15
5 11 6 14 19 10
• A small garment making unit has five tailors stitching five different
types of garments. All the five tailors are capable of stitching all the
fives types of garments. The output per day per tailor and the profit
(rs) for each types of garment are given below
Tailors 1 2 3 4 5
A 7 9 4 8 6
B 4 9 5 7 8
C 8 5 2 9 8
D 6 5 8 10 10
E 7 8 10 9 9
Profit per 2 3 2 3 4
garment

Which type of garment should be assigned to which tailor in order to maximize


profit
CONVERSION OF A MAXIMIZATION PROBLEM TO A
MINIMIZATION PROBLEM

The Hungarian algorithm works only if the matrix is a cost matrix.


A maximization assignment problem can be converted to a
minimization problem by creating a lost opportunity matrix. The
problem then is to minimize the total lost opportunity.
Profit Matrix:
J1 J2 J3 J4
W1 67 58 90 55
W2 58 88 89 56
W3 74 99 80 22
(D) 0 0 0 0
The lost opportunity matrix given below is derived by subtracting each number in the J1
column from 74, each number in the J2 column from 99, each number in the J3 column
from 90, and each number in the J4 from 56.

J1 J2 J3 J4
W1 7 41 0 1
W2 16 11 1 0
W3 0 0 10 34
(D) 74 99 90 56

The Hungarian algorithm can now be applied to this lost opportunity matrix to
determine the maximum profit set of assignments.
Queuing Theory

 The study of waiting lines, called the queuing theory, is one of the
oldest and most widely used quantitative analysis techniques.

 Waiting lines are an everyday occurrence, affecting people shopping


for groceries, buying petrol, making a bank deposit, or waiting on the
telephone for the first available airline reservationist to answer.
Queuing or Waiting Line Analysis
• Queues (waiting lines) affect people
everyday
• A primary goal is finding the best level of
service
• Analytical modeling (using formulas) can
be used for many queues
• For more complex situations, computer
simulation is needed
The three basic components of a queuing process are arrivals, service
facilities, and the actual waiting line.

Queuing theory discusses how analytical models of waiting lines can:


• Help managers evaluate the cost and effectiveness of service systems.

• Describe the characteristics of waiting lines and the underlying mathematical


assumptions used to develop queuing models.

• Provide the equations needed to compute the operating characteristics of a service


system and show examples of how they are used.
Waiting Line Costs
Most waiting line problems are centred on the question of finding the
ideal level of services that a firm should provide.
• Supermarkets must decide how many cash register checkout positions
should be opened.
• Gasoline stations must decide how many pumps should be opened and
how many attendants should be on duty.
• Manufacturing plants must determine the optimal number of
mechanics to have on duty each shift to repair machines that break
down.
• Banks must decide how many teller windows to keep open to serve
customers during various hours of the day.
Three Rivers Shipping Company

• As an illustration, let’s look at the case of the Three Rivers Shipping Company.

Three Rivers runs a huge docking facility located on the Ganga River near Haldia.

Approximately five ships arrive to unload their cargoes of steel and ore during

every 12-hour work shift. Each hour that a ship sits idle in line waiting to be

unloaded costs the firm a great deal of money, about Rs 1,000 per hour. From

experience, management estimates that if one team of stevedores is on duty to

handle the unloading work, each ship will wait an average of 7 hours to be

unloaded. If two teams are working, the average waiting time drops to 4 hours; for

three teams, it’s 3 hours; and for four teams of stevedores, only 2 hours. But each

additional team of stevedores is also an expensive proposition, due to union


• Three Rivers’s superintendent would like to determine the optimal number of
teams of stevedores to have on duty each shift. The objective is to minimise
total expected costs. To minimise the sum of service costs and waiting costs,
the firm makes the decision to employ two teams of stevedores each shift.
The Basic Elements of the Queuing Model

The queuing system is determined by:

• Arrival characteristics

• Queue characteristics

• Service facility characteristics


The arrivals
The input source that generates the arrivals or the customers for the
service system has three major characteristics.
• Size of the calling population: Population sizes are considered to be either
unlimited (essentially infinite) or limited (finite)

• Patterns of the arrivals or the customers at the system: Customers either


arrive at a service facility according to some known schedule (e.g., one
patient every 15 minutes or one student for advising every half hour) or
else they arrive randomly.

• Behaviour of the arrivals or the customers: Most queuing models assume


that an arriving customer is a patient customer
Arrival Characteristics
• Size of the arrival population – either
infinite or limited
• Arrival distribution:
– Either fixed or random
– Either measured by time between
consecutive arrivals, or arrival rate
– The Poisson distribution is often used
for random arrivals
The waiting line
The waiting line itself is the second component of a queuing system. Its
characteristics are:
• The length of a line can be either limited or unlimited.
• A second waiting line characteristic deals with queue discipline.

The service facility


The third part of any queuing system is the service facility. It is important to
examine its two basic properties: the configuration of the service system and the
pattern of service time.
Basic queuing system configurations: Service systems are usually classified in
terms of their number of channels or the number of servers, and the number of
phases or the number of service stops that must be made.
 A single-channel system
 A single-phase system
Service time distribution: Service patterns are like arrival patterns in that
they can be either constant or random.

The exponential distribution is important to the process of building


mathematical queuing models because many of the models’ theoretical
underpinnings are based on the assumption of Poisson arrivals and
exponential services.

http://curriculum.media.pearsoncmg.com/curriculum/intl/Indi
a/QuantitativeTechniques_imL_June2013/STU/Articulate/Four
BasicQueuingSystemConfigurations/story.html
Poisson Distribution
• Average arrival rate is known
• Average arrival rate is constant for some number of time
periods
• Number of arrivals in each time period is independent
• As the time interval approaches 0, the average number of
arrivals approaches 0
Poisson Distribution
λ = the average arrival rate per time unit

P(x) = the probability of exactly x arrivals occurring during


one time period

P(x) = e-λ λx
x!
Behavior of Arrivals
• Most queuing formulas assume that all
arrivals stay until service is completed
• Balking refers to customers who do not
join the queue
• Reneging refers to customers who join
the queue but give up and leave before
completing service
Queue Characteristics
• Queue length (max possible queue length)
– either limited or unlimited

• Service discipline – usually FIFO (First In


First Out)
Service Facility Characteristics
1. Configuration of service facility
• Number of servers (or channels)
• Number of phases (or service stops)
2. Service distribution
• The time it takes to serve 1 arrival
• Can be fixed or random
• Exponential distribution is often used
Exponential Distribution
μ = average service time
t = the length of service time (t > 0)
P(t) = probability that service time will be greater than t

P(t) = e- μt
Measuring Queue Performance
• ρ = utilization factor (probability of all
servers being busy)
• Lq = average number in the queue
• L = average number in the system
• Wq = average waiting time
• W = average time in the system
• P0 = probability of 0 customers in system
• Pn = probability of exactly n customers in
system
Kendall’s Notation
A/B/s
A = Arrival distribution
(M for Poisson, D for deterministic, and
G for general)
B = Service time distribution
(M for exponential, D for deterministic,
and G for general)
S = number of servers
The Queuing Models
Covered Here All Assume
1. Arrivals follow the Poisson distribution
2. FIFO service
3. Single phase
4. Unlimited queue length
5. Steady state conditions

We will look at 5 of the most commonly used queuing


systems.
Name Models Covered
(Kendall Notation) Example
Simple system Customer service desk in a
(M / M / 1) store
Multiple server Airline ticket counter
(M / M / s)
Constant service Automated car wash
(M / D / 1)
General service Auto repair shop
(M / G / 1)
Limited population An operation with only 12
(M / M / s / ∞ / N) machines that might break
Single Server Queuing System (M/M/1)
• Poisson arrivals
• Arrival population is unlimited
• Exponential service times
• All arrivals wait to be served
• λ is constant
• μ > λ (average service rate > average
arrival rate)
Operating Characteristics for M/M/1 Queue
1. Average server utilization
ρ=λ/μ

2. Average number of customers waiting


Lq = λ2
μ(μ – λ)
3. Average number in system
L = Lq + λ / μ
4. Average waiting time
Wq = Lq = λ
λ μ(μ – λ)
5. Average time in the system
W = Wq + 1/ μ

6. Probability of 0 customers in system


P0 = 1 – λ/μ
7. Probability of exactly n customers in
system
Pn = (λ/μ )n P0
Arnold’s Muffler Shop Example
• Customers arrive on average 2 per hour
(λ = 2 per hour)
• Average service time is 20 minutes
(μ = 3 per hour)
Total Cost of Queuing System
Total Cost = Cw x L + Cs x s

Cw = cost of customer waiting time per time


period
L = average number customers in system
Cs = cost of servers per time period
s = number of servers
Multiple Server System (M / M / s)
• Poisson arrivals
• Exponential service times
• s servers
• Total service rate must exceed arrival rate
( sμ > λ)
• Many of the operating characteristic
formulas are more complicated
Arnold’s Muffler Shop
With Multiple Servers
Two options have already been considered:
System
Cost
• Keep the current system (s=1) $32/hr
• Get a faster mechanic (s=1) $25/hr
Multi-server option
3. Have 2 mechanics (s=2) ?
Single Server System With Constant Service
Time (M/D/1)
• Poisson arrivals
• Constant service times (not random)
• Has shorter queues than M/M/1 system
- Lq and Wq are one-half as large
Garcia-Golding Recycling Example
• λ = 8 trucks per hour (random)
• μ = 12 trucks per hour (fixed)
• Truck & driver waiting cost is $60/hour
• New compactor will be amortized at
$3/unload
• Total cost per unload = ?
Single Server System With
General Service Time (M/G/1)
• Poisson arrivals
• General service time distribution with known
mean (μ) and standard deviation (σ)
• μ>λ
Professor Crino Office Hours
• Students arrive randomly at an average
rate of, λ = 5 per hour
• Service (advising) time is random at an
average rate of, μ = 6 per hour
• The service time standard deviation is,
σ = 0.0833 hours

Go to file 9-5.xls
Muti-Server System With
Finite Population (M/M/s/∞/N)
• Poisson arrivals
• Exponential service times
• s servers with identical service time distributions
• Limited population of size N
• Arrival rate decreases as queue lengthens
Department of Commerce Example
• Uses 5 printers (N=5)
• Printers breakdown on average every 20
hours
λ = 1 printer = 0.05 printers per hour
20 hours
• Average service time is 2 hours
μ = 1 printer = 0.5 printers per hour
2 hours
Go to file 9-6.xls
The Single-Channel Queuing Model with Infinite
Population
Assumptions of the Model
• The single-channel, single-phase model (or the M/M/1 model) considered here is one of the most
widely used and simplest queuing models. It involves assuming that seven conditions exist:
• Arrivals are served on a FCFS basis.
• Every arrival waits to be served regardless of the length of the line; that is, there is no balking or
reneging.
• Arrivals are independent of preceding arrivals, but the average number of arrivals (the arrival
rate) does not change over time.
• Arrivals are described by a Poisson probability distribution and come from an infinite or very
large population.
• Service times also vary from one customer to the next and are independent of one another, but
their average rate is known.
• Service times occur according to the negative exponential probability distribution.
• The average service rate is greater than the average arrival rate. When these seven conditions are
met, we can develop a series of equations that define the queue’s operating characteristics.
Queuing Equations
• Let λ = mean number of arrivals per time period (for example, per hour)
and µ = mean number of people or items served per time period.

• When determining the arrival rate (λ) and the service rate (µ), the same time
period must be used. For example, if the λ is the average number of arrivals
per hour, then µ must indicate the average number that could be served per
hour.
• The seven queuing equations follow. These seven queuing equations for the
single-channel, single-phase model describe the important operating
characteristics of the service system.
• The average number of customers or units in the system, L, that is, the
number in line plus the number being served:
L= λ μ−λ
• The average time a customer spends in the system, W, that is, the time spent
in line plus the time spent being served:
W= 1 μ−λ
• The average number of customers in the queue, Lq:
L q = λ 2 μ( μ−λ )
• The average time a customer spends waiting in the queue, Wq:
W q = λ μ( μ−λ )
• The utilisation factor for the system, ρ, that is, the probability that the
service facility is being used:
ρ= λ μ
• The percentage of idle time, P0, that is, the probability that no one is in
the system:
P 0 =1− λ μ
• The probability that the number of customers in the system is greater
than k, Pn>k:
P n>k = λ μ k+1
We now apply these formulas to the case of Sri Guru Garage in Hyderabad.
Sri Guru’s mechanic, Raju, is able to install new mufflers at an average rate of
three per hour, or about one every 20 minutes. Customers who need this service
arrive at the shop on the average of two per hour.
Sri Guru, the shop owner, studied queuing models in an MBA program and feels
that all seven of the conditions for a single-channel model are met. He proceeds to
calculate the numerical values of the preceding operating characteristics.
λ = 2 cars arriving per hour
µ = 3 cars serviced per hour
• L= λ /μ−λ = 2 /3−2 = 2 1 = 2 cars in the system on the average
• W= 1 /μ−λ = 1 /3−2 = 1 hour that an average car spends in the system
• L q = λ 2/ μ( μ−λ ) = 2 2 3( 3−2 ) = 4 3( 1 ) = 4 3 = 1.33 cars waiting in line on
the average
• W q = λ μ /μ - λ = 2 3 3 - 2 = 2 3 hour = 4 0 minutes = average waiting time per
car
• Note that W and Wq are in hours, since λ was defined as the number
of arrivals per hour.
• ρ= λ/ μ = 2 /3 = 0.67 = percentage of time mechanic is busy, or the
probability that the server is busy
• P0 =1− λ /μ =1− 2 /3 = 0.33 = probability that there are 0 cars in the
system
Question 2
For a queuing system with single server and having Poisson distribution for
arrival and service time following exponential distribution, we have arrival
rate is 15 and service rate is 20.

Q1: Find average queue length formed from time to time/

Q2: If the customer are ready to remain in the queue for not more than 6
minutes, do you suggest to increase the service facilities.
Question 3
• Customer arrives at a one window drive in bank according to Poisson distribution
with mean 10 per hour, service time per customer is exponential distribution with
mean 5 minutes. The space in front of the window including that for the serviced
car can accommodate a maximum of 3 cars. Others can wait outside this space.

• What is the probability that an arriving customer can drive directly to the space
in front of the window?

• What is the probability that an arriving customer will have to wait outside the
indicated space?

• How long is an arriving customer expected to wait before starting service?


Decision Analysis
• For evaluating and choosing among alternatives

• Considers all the possible alternatives and possible


outcomes
Five Steps in Decision Making
1. Clearly define the problem
2. List all possible alternatives
3. Identify all possible outcomes for each alternative
4. Identify the payoff for each alternative & outcome
combination
5. Use a decision modeling technique to choose an
alternative
Thompson Lumber Co. Example
1. Decision: Whether or not to make and sell storage
sheds
2. Alternatives:
• Build a large plant
• Build a small plant
• Do nothing
3. Outcomes: Demand for sheds will be high,
moderate, or low
4. Payoffs
Outcomes (Demand)
Alternatives High Moderate Low
Large plant 200,000 100,000 -120,000
Small plant 90,000 50,000 -20,000
No plant 0 0 0

5. Apply a decision modeling method


Types of Decision
Modeling Environments
Type 1: Decision making under certainty

Type 2: Decision making under uncertainty

Type 3: Decision making under risk


Decision Making Under Certainty
• The consequence of every alternative is known
• Usually there is only one outcome for each alternative
• This seldom occurs in reality
Decision Making Under Uncertainty
• Probabilities of the possible outcomes are not
known
• Decision making methods:
1. Maximax
2. Maximin
3. Criterion of realism
4. Equally likely
5. Minimax regret
Maximax Criterion
• The optimistic approach
• Assume the best payoff will occur for each alternative

Outcomes (Demand)
Alternatives High Moderate Low
Large plant 200,000 100,000 -120,000
Small plant 90,000 50,000 -20,000
No plant 0 0 0

Choose the large plant (best payoff)


Maximin Criterion
• The pessimistic approach
• Assume the worst payoff will occur for each
alternative
Outcomes (Demand)
Alternatives High Moderate Low
Large plant 200,000 100,000 -120,000
Small plant 90,000 50,000 -20,000
No plant 0 0 0

Choose no plant (best payoff)


Criterion of Realism
• Uses the coefficient of realism (α) to estimate the decision maker’s
optimism
•0<α<1

α x (max payoff for alternative)


+ (1- α) x (min payoff for alternative)
= Realism payoff for alternative
Suppose α = 0.45

Realism
Alternatives Payoff
Large plant 24,000
Small plant 29,500
No plant 0

Choose small plant


Equally Likely Criterion
Assumes all outcomes equally likely and uses the average
payoff

Average
Alternatives Payoff
Large plant 60,000
Small plant 40,000
No plant 0
Chose the large plant
Minimax Regret Criterion
• Regret or opportunity loss measures much better we could have
done
Regret = (best payoff) – (actual payoff)

Outcomes (Demand)
Alternatives High Moderate Low
Large plant 200,000 100,000 -120,000
Small plant 90,000 50,000 -20,000
No plant 0 0 0
The best payoff for each outcome is highlighted
Regret Values
Outcomes (Demand) Max
Alternatives High Moderate Low Regret
Large plant 0 0 120,000 120,000
Small plant 110,000 50,000 20,000 110,000
No plant 200,000 100,000 0 200,000

We want to minimize the amount of regret we


might experience, so chose small plant
Decision Making Under Risk
• Where probabilities of outcomes are available

• Expected Monetary Value (EMV) uses the probabilities to


calculate the average payoff for each alternative

EMV (for alternative i) =


∑(probability of outcome) x (payoff of outcome)
Expected Monetary Value (EMV) Method
Outcomes (Demand)
Alternatives High Moderate Low EMV
Large plant 200,000 100,000 -120,000 86,000
Small plant 90,000 50,000 -20,000 48,000
No plant 0 0 0 0

Probability
0.3 0.5 0.2
of outcome

Chose the large plant


Expected Opportunity Loss (EOL)
• How much regret do we expect based on the probabilities?

EOL (for alternative i) =


∑(probability of outcome) x (regret of outcome)
Regret (Opportunity Loss) Values
Outcomes (Demand)
Alternatives High Moderate Low EOL
Large plant 0 0 120,000 24,000
Small plant 110,000 50,000 20,000 62,000
No plant 200,000 100,000 0 110,000

Probability
0.3 0.5 0.2
of outcome

Chose the large plant


Perfect Information
• Perfect Information would tell us with certainty which outcome is
going to occur
• Having perfect information before making a decision would allow
choosing the best payoff for the outcome
Expected Value With
Perfect Information (EVwPI)
The expected payoff of having perfect information
before making a decision

EVwPI = ∑ (probability of outcome)


x ( best payoff of outcome)
Expected Value of
Perfect Information (EVPI)
• The amount by which perfect information would increase
our expected payoff
• Provides an upper bound on what to pay for additional
information

EVPI = EVwPI – EMV


EVwPI = Expected value with perfect information
EMV = the best EMV without perfect information
Payoffs in blue would be chosen based on perfect
information (knowing demand level)
Demand
Alternatives High Moderate Low
Large plant 200,000 100,000 -120,000
Small plant 90,000 50,000 -20,000
No plant 0 0 0

Probability 0.3 0.5 0.2

EVwPI = $110,000
Expected Value of Perfect Information

EVPI = EVwPI – EMV


= $110,000 - $86,000 = $24,000

• The “perfect information” increases the expected value by $24,000


• Would it be worth $30,000 to obtain this perfect information for
demand?
Decision Trees
• Can be used instead of a table to show alternatives, outcomes, and
payofffs
• Consists of nodes and arcs
• Shows the order of decisions and outcomes
Decision Tree for Thompson Lumber
Folding Back a Decision Tree
• For identifying the best decision in the tree
• Work from right to left
• Calculate the expected payoff at each outcome node
• Choose the best alternative at each decision node (based on expected
payoff)
Thompson Lumber Tree with EMV’s
Decision Trees for Multistage Decision-Making
Problems
• Multistage problems involve a sequence of several decisions and
outcomes
• It is possible for a decision to be immediately followed by another
decision
• Decision trees are best for showing the sequential arrangement
Expanded Thompson
Lumber Example
• Suppose they will first decide whether to pay $4000 to conduct a
market survey
• Survey results will be imperfect
• Then they will decide whether to build a large plant, small plant, or no
plant
• Then they will find out what the outcome and payoff are
Thompson Lumber
Optimal Strategy
1. Conduct the survey

2. If the survey results are positive, then build the large plant (EMV =
$141,840)

If the survey results are negative, then build the small plant (EMV =
$16,540)
Expected Value of
Sample Information (EVSI)
• The Thompson Lumber survey provides sample information (not
perfect information)
• What is the value of this sample information?
EVSI = (EMV with free sample information)
- (EMV w/o any information)
EVSI for Thompson Lumber
If sample information had been free
EMV (with free SI) = 87,961 + 4000 =
$91,961

EVSI = 91,961 – 86,000 = $5,961


EVSI vs. EVPI
How close does the sample information come to perfect
information?

Efficiency of sample information = EVSI


EVPI

Thompson Lumber: 5961 / 24,000 = 0.248


Estimating Probability
Using Bayesian Analysis
• Allows probability values to be revised based on new information
(from a survey or test market)

• Prior probabilities are the probability values before new information

• Revised probabilities are obtained by combining the prior


probabilities with the new information
Known Prior Probabilities
P(HD) = 0.30
P(MD) = 0.50
P(LD) = 0.30

How do we find the revised probabilities where the


survey result is given?
For example: P(HD|PS) = ?
• It is necessary to understand the Conditional probability
formula:
P(A|B) = P(A and B)
P(B)
• P(A|B) is the probability of event A occurring, given that event B
has occurred
• When P(A|B) ≠ P(A), this means the probability of event A has
been revised based on the fact that event B has occurred
The marketing research firm provided the following probabilities
based on its track record of survey accuracy:

P(PS|HD) = 0.967 P(NS|HD) = 0.033


P(PS|MD) = 0.533 P(NS|MD) = 0.467
P(PS|LD) = 0.067 P(NS|LD) = 0.933

Here the demand is “given,” but we need to reverse the events so


the survey result is “given”
• Finding probability of the demand outcome given the survey
result:

P(HD|PS) = P(HD and PS) = P(PS|HD) x P(HD)


P(PS) P(PS)

• Known probability values are in blue, so need to find P(PS)

P(PS|HD) x P(HD) 0.967 x 0.30


+ P(PS|MD) x P(MD) + 0.533 x 0.50
+ P(PS|LD) x P(LD) + 0.067 x 0.20
= P(PS) = 0.57
• Now we can calculate P(HD|PS):

P(HD|PS) = P(PS|HD) x P(HD) = 0.967 x 0.30


P(PS) 0.57
= 0.509

• The other five conditional probabilities are found in the same manner
• Notice that the probability of HD increased from 0.30 to 0.509 given the positive
survey result
Utility Theory
• An alternative to EMV
• People view risk and money differently, so EMV is not
always the best criterion
• Utility theory incorporates a person’s attitude toward
risk
• A utility function converts a person’s attitude toward
money and risk into a number between 0 and 1
Jane’s Utility Assessment

Jane is asked: What is the minimum amount that


would cause you to choose alternative 2?
• Suppose Jane says $15,000
• Jane would rather have the certainty of getting
$15,000 rather the possibility of getting $50,000
• Utility calculation:
U($15,000) = U($0) x 0.5 + U($50,000) x 0.5
Where, U($0) = U(worst payoff) = 0
U($50,000) = U(best payoff) = 1

U($15,000) = 0 x 0.5 + 1 x 0.5 = 0.5 (for Jane)


• The same gamble is presented to Jane multiple times
with various values for the two payoffs

• Each time Jane chooses her minimum certainty


equivalent and her utility value is calculated

• A utility curve plots these values


Jane’s Utility Curve
• Different people will have different curves
• Jane’s curve is typical of a risk avoider
• Risk premium is the EMV a person is willing to willing
to give up to avoid the risk

Risk premium = (EMV of gamble)


– (Certainty equivalent)

Jane’s risk premium = $25,000 - $15,000


= $10,000
Types of Decision Makers
Risk Premium
• Risk avoiders: >0
• Risk neutral people: =0
• Risk seekers: <0
Utility Curves for Different Risk Preferences
Utility as a
Decision Making Criterion
• Construct the decision tree as usual with the same alternative,
outcomes, and probabilities
• Utility values replace monetary values
• Fold back as usual calculating expected utility values
Decision Tree Example for Mark
Utility Curve for Mark the Risk Seeker
Mark’s Decision Tree With Utility Values
Goal Programming

In many linear programming problems, the


objective function or goal extends beyond
just maximizing total profit or minimizing
total cost.
How do you find optimal solutions to the following?

• Multiple criterion for measuring performance (car with low


cost, good gas mileage, stylish, etc.. / attend school with
good reputation, low tuition, close to home, right program…)

• Multiple objectives / goals


(e.g. Minimize service cost, maximize customer satisfaction)

Answer: Use Goal Programming


Goal Programming
POSSIBLE ECONOMIC GOALS

 Maximizing market share

 Maintaining full employment

 Minimizing production idle time

 Restricting overtime labor

 Adhering to limited storage


space

Applied Management Science for Decision Making, 2e © 2014 Pearson Learning Solutions
Goal Programming
POSSIBLE NON-ECONOMIC GOALS

Maximizing land usage

Minimizing federal grant


overspending
Maximizing the number of
people reached by adverti-
sing

Minimizing noise levels in


the neighborhood

Minimizing staff shortages


Multiple Objectives
TWO APPROACHES

1st Approach

DEVELOP A SINGLE OBJECTIVE


FUNCTION THAT ADDRESSES
ALL GOALS SIMULTANEOUSLY

THIS IS ACCOMPLISHED
BY CONVERTING THE
VALUES OF ALL THE GOALS
TO A COMMON MEASURE OF
VALUE OR UTILITY
2nd Approach

ACKNOWLEDGE THE DIFFERENCES IN THE VARIOUS GOALS


AND USE A PROCEDURE, EITHER GRAPHICAL, COMPUTER-
BASED, OR SIMPLEX, TO ADDRESS THEM INDIVIDUALLY

THIS IS CALLED
GOAL PROGRAMMING
Goal Programming
THE PRIMARY PURPOSE

Not to develop an optimal solution as such,


but to ‘satisfice’, that is, meet the desired level
of achievement set for each goal, and if that is
not entirely possible, to minimize the actual
deviations from those desired levels.
Goal vs. Linear Programming
THE DIFFERENCES

 Goal programming attempts to minimize the deviations


between the various established goals and what can be
actually achieved, given the available resources.

 Variables called deviational variables are typically the


ONLY variables in the objective function.

 The objective function is formulated to MINIMIZE the sum


of the differences between the deviational variables.
Goal Programming

THERE MAY BE GOALS THAT


MUST BE MET , AS OPPOSED
TO GOALS THAT THE
DECISION MAKER ATTEMPTS
TO MEET

THE FORMER WILL ALWAYS BE


REPRESENTED BY REGULAR
LINEAR PROGRAMMING
CONSTRAINTS !
Goal Programming
• In goal programming, di+ and di- , deviation variables, are the amounts a
targeted goal i is overachieved or underachieved, respectively.
• The goals themselves are added to the constraint set with di+ and di-
acting as the surplus and slack variables.
• One approach to goal programming is to satisfy goals in a priority
sequence. Second-priority goals are pursued without reducing the first-
priority goals, etc.
• For each priority level, the objective function is to minimize the
(weighted) sum of the goal deviations.
• Previous "optimal" achievements of goals are added to the constraint set
so that they are not degraded while trying to achieve lesser priority
goals.
Goal Programming
OBJECTIVE FUNCTION FORMULATION

 If overachievement is undesired, the deviational variable d+ will be


placed in the objective function to be minimized.

 If underachievement is undesired, the deviational variable d- will be


placed in the objective function to be minimized.

 If both overachievement and underachievement are undesired, the


deviational variables d+ and d- will be placed in the objective
function to be minimized. *

THAT IS, THE GOAL IS TO BE MET EXACTLY


*
Goal Programming
THE OBJECTIVE FUNCTION

A function of the deviational variables, it represents


non-achievement of the various established goals,
and must always be minimized

-
d deviational variable that measures under achievement

+
d deviational variable that measures over achievement
• Conceptual Products is a computer company that produces the CP600
and the CP700 computers. The computers use different mother boards
produced in abundant supply by the company, but use the same cases
and disk drives. The CP600 models use two floppy disk drives and no
zip disk drives whereas the CP700 models use one floppy disk drive
and one zip disk drive.
The disk drives and cases are bought from vendors. There are 1000
floppy disk drives, 500 zip disk drives, and 600 cases available to
Conceptual Products on a weekly basis. It takes one hour to manufacture a
CP600 and its profit is Rs.200 and it takes one and one-half hours to
manufacture a CP700 and its profit is Rs500.
Example: Conceptual Products
The company has four goals which are given below:
Priority 1: Meet a state contract of 200 CP600
machines weekly. (Goal 1)
Priority 2: Make at least 500 total computers weekly.
(Goal 2)
Priority 3: Make at least Rs 250,000 weekly. (Goal 3)
Priority 4: Use no more than 400 man-hours per
week. (Goal 4)
Example: Conceptual Products
• Variables
x1 = number of CP600 computers produced weekly
x2 = number of CP700 computers produced weekly
di- = amount the right hand side of goal i is deficient
di+ = amount the right hand side of goal i is exceeded
• Functional Constraints
Availability of floppy disk drives: 2x1 + x2 < 1000
Availability of zip disk drives: x2 < 500
Availability of cases: x1 + x2 < 600
Example: Conceptual Products
• Goals
(1) 200 CP600 computers weekly:
x1 + d1- - d1+ = 200
(2) 500 total computers weekly:
x1 + x2 + d2- - d2+ = 500
(3) Rs. 250(in thousands) profit:
.2x1 + .5x2 + d3- - d3+ = 250
(4) 400 total man-hours weekly:
x1 + 1.5x2 + d4- - d4+ = 400
Non-negativity:
x1, x2, di-, di+ > 0 for all i
Example: Conceptual Products
• Objective Functions

Priority 1: Minimize the amount the state contract is


not met: Min d1-
Priority 2: Minimize the number under 500
computers produced weekly: Min d2-
Priority 3: Minimize the amount under Rs 250,000
earned weekly: Min d3-
Priority 4: Minimize the man-hours over 400 used
weekly: Min d4+
Example: Conceptual Products

• Formulation Summary
Min P1(d1-) + P2(d2-) + P3(d3-) + P4(d4+)

s.t. 2x1 +x2 < 1000


+x2 < 500
x1 +x2 < 600
x1 +d1- -d1+ = 200
x1 +x2 +d2- -d2+ = 500
.2x1+ .5x2 +d3- -d3+ = 250
x1+1.5x2 +d4- -d4+ = 400
x1, x2, d1-, d1+, d2-, d2+, d3-, d3+, d4-, d4+ > 0
Graphical Solution, Iteration 1
To solve graphically, first graph the functional constraints.
Then graph the first goal: x1 = 200. Note on the next slide that there
is a set of points that exceed x1 = 200 (where d1- = 0).
Example: Conceptual Products
• Functional Constraints and Goal 1 Graphed
x2

1000 2x1 + x2 < 1000

800 Goal 1: x1 > 200


x2 < 500
600 x1 + x2 < 600

400 Points Satisfying


Goal 1
200

x1
200 400 600 800 1000 1200
• Graphical Solution, Iteration 2
Now add Goal 1 as x1 > 200 and graph Goal 2:
x1 + x2 = 500. Note on the next slide that there is still a set of points
satisfying the first goal that also satisfies this second goal (where d2- = 0).
Example: Conceptual Products
• Goal 1 (Constraint) and Goal 2 Graphed
x2

1000 2x1 + x2 < 1000

800 Goal 1: x1 > 200


x2 < 500
600 x1 + x2 < 600

400 Points Satisfying Both


Goals 1 and 2
200
Goal 2: x1 + x2 > 500

x1
200 400 600 800 1000 1200
Example: Conceptual Products
• Graphical Solution, Iteration 3
Now add Goal 2 as x1 + x2 > 500 and Goal 3:
.2x1 + .5x2 = 250. Note on the next slide that no points satisfy the
previous functional constraints and goals and satisfy this constraint.
Thus, to Min d3-, this minimum value is achieved when we Max .2x1
+ .5x2. Note that this occurs at x1 = 200 and x2 = 400, so that .2x1 + .5x2 =
240 or d3- = 10.
Example: Conceptual Products
• Goal 2 (Constraint) and Goal 3 Graphed
x2

1000 2x1 + x2 < 1000

800 Goal 1: x1 > 200


x2 < 500
600 x1 + x2 < 600 (200,400)

400 Points Satisfying Both


Goals 1 and 2

200 Goal 2: x1 + x2 > 500

Goal 3: .2x1 + .5x2 = 250


x1
200 400 600 800 1000 1200
Goal Programming
A company has two machines for manufacturing a product.
Machine 1 make two units per hour, while machine 2 makes
three units per hour. The company has an order of 80 units.
Energy restrictions dictate that only one machine can operate
at one time. The company has 40 hours of regular machining
time, but overtime is available. It costs $4.00 to run machine
1 for one hour, while machine 2 costs $5.00 per hour. The
company has the following goals:
1) Meet the demand of 80 units exactly.
2) Limit machine overtime to 10 hours.
3) Use the 40 hours of normal machining time.
4) Minimize costs.
Goal Programming: Preemptive Goals

Letting Pi represent the relative weighting of each goal, the example


can be formulated as the following LP:
Min Z = P1(d1- + d1+) + P2 d3+ + P3(d2- + d2+) +P14d4+
s.t.
2 x1 + 3 x2 + d1- - d1+ = 80
x1 + x2 + d2- - d2+ = 40
d2+ + d3- - d3+ = 10
4 x1 + 5 x2 + d4 - - d4 + = 0

x1, x2, d1- , d1+ , d2- , d2+ , d3- , d3+ , d4- , d4+ > 0

Potrebbero piacerti anche