Ticket Purchase Optimization Strategies
Ticket Purchase Optimization Strategies
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?
Here, the number of alternatives are not finite. Because the width and
height of the rectangular can assume an infinite number of values.
• 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.
The decision variables, xI, x2, ..., xn, represent levels of n competing activities.
Examples of LP Problems
• 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
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.
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).
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
X1
Graphical Analysis – the Feasible Region
X2
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 40
Solving Graphically for an Optimal Solution
The search for an optimal solution
700 Profit=$4360
500
X1
42
500
Summary of the optimal solution
if no if yes stop
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.
• I: Check whether the objective function of the given LPP is to maximized or
Step
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
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)
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
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
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 s2 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 0 s1 0 s2 0
STEP 2
Basic x1 x2 S1 S2
Variables RHS
S1 4 3 1 0 240
S2 2 1 0 1 100
Z -70 -50 0 0 0
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
Variables RHS
S1 4 3 1 0 240 240 / 4 60
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.
Basic Right
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
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
Note that one of the simplex rules is violated, which is the basic variables A 1, 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 o 20M
M (A2 row): M M 0 0 0 M 10M
New (Z row):2M-2 4M-3 0 -M 0 0 30M
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
• 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
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
• 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
x , x2 , x3 0
1