8/10/2019 Chapter 6 - Scheduling Algorithm
1/42
Chapter VI
Scheduling ModelsPrepared by:
Engr. Romano A. GabrilloMEngg-MEM
8/10/2019 Chapter 6 - Scheduling Algorithm
2/42
Scheduling Problems
Scheduling problem is a special type of integer
programming problem where assignees are
being assigned to perform tasks.
It involves the following problems:
Production Problems
Transshipment Problems
2
8/10/2019 Chapter 6 - Scheduling Algorithm
3/42
3RAG 2007
Production Problems
Production problems involve a single productwhich is to be manufactured over a number ofsuccessive time periods to meet prespecified
demands.
The objective is to determine a production
schedule which will meet all future demands atminimum total cost (which is total productioncost plus total storage cost, as total shipping costis presumed fixed).
8/10/2019 Chapter 6 - Scheduling Algorithm
4/42
4RAG 2007
Solution to Production Problems
Production problems may be converted intotransportation problems by considering the timeperiods during which production can take place assources, and the time periods in which units will be
shipped as destinations.
The production capacities are taken to be the supplies.Therefore, xijdenotes the number of units to be
produced. cijis the unit production cost during timeperiod i plus the cost of storing a unit of product fromtime period i until time period j. Since units cannot beshipped prior to being produced, cijis madeprohibitively largefor i > j to force the corresponding
xijto be zero.
8/10/2019 Chapter 6 - Scheduling Algorithm
5/42
5RAG 2007
Example No. 1
An industrial firm must plan for each of the four
seasons over the next year. The companys production
capacities and the expected demands (all in units) are as
follows:
Spring Summer Fall Winter
Demand 250 100 400 500
Regular
Capacity
200 300 350
Overtime
Capacity
100 50 100 150
8/10/2019 Chapter 6 - Scheduling Algorithm
6/42
6RAG 2007
Regular production costs for the firm are P7.00 perunit; the unit cost of overtime varies seasonally, being
P8.00 in spring and fall, P9.00 in summer, and P10.00in winter.
The company has 200 units of inventory on January 1,
but as it plans to discontinue the product at the end ofthe year, it wants no inventory after the winter season.Units produced on regular shifts are not available forshipment during the season of production; generally,they are sold during the following season. Those that
are not added to inventory are carried forward at a costof P0.70 per unit per season. In contrast, unitsproduced on overtime shifts must be shipped in the
same season as produced. Determine a productionschedule that meets all demands at minimum total cost.
8/10/2019 Chapter 6 - Scheduling Algorithm
7/42
7RAG 2007
Input the Supply and Demand
Supply ui
Demand
vj
150
Overtime
(Spring) 100
Overtime
(Summer)
50
Overtime
(Fall) 100
Initial
Inventory 200
250 100 400 500 200
Overtime
(Winter)
Sources
Regular
(Spring) 200
Regular
(Summer) 300
Regular
(Fall) 350
DestinationSpring Summer Fall Winter Dummy
8/10/2019 Chapter 6 - Scheduling Algorithm
8/42
8/10/2019 Chapter 6 - Scheduling Algorithm
9/42
9RAG 2007
Input the Cost for Overtime Capacity
Supply ui
10000 7.00 7.70 8.40
10000 10000 7.00 7.70
10000 10000 10000 7.00
8.00 10000 10000 10000
10000 9.00 10000 10000
10000 10000 8.00 10000
10000 10000 10000 10.00
Demand
vj
150
Overtime
(Spring) 100
Overtime
(Summer) 50
Overtime
(Fall) 100
Initial
Inventory 200
250 100 400 500 200
Overtime
(Winter)
Sources
Regular
(Spring) 200
Regular
(Summer) 300
Regular
(Fall) 350
Destination
Spring Summer Fall Winter Dummy
8/10/2019 Chapter 6 - Scheduling Algorithm
10/42
10RAG 2007
Input the Cost for Initial Inventory
Supply ui
10000 7.00 7.70 8.40
10000 10000 7.00 7.70
10000 10000 10000 7.00
0.00 0.70 1.40 2.10
8.00 10000 10000 10000
10000 9.00 10000 10000
10000 10000 8.00 10000
10000 10000 10000 10.00
Demand
vj
150
Overtime
(Spring) 100
Overtime
(Summer) 50
Overtime
(Fall) 100
Initial
Inventory 200
250 100 400 500 200
Overtime
(Winter)
Sources
Regular
(Spring) 200
Regular
(Summer) 300
Regular
(Fall) 350
Destination
Spring Summer Fall Winter Dummy
8/10/2019 Chapter 6 - Scheduling Algorithm
11/42
11RAG 2007
Input the Cost for the Dummy
Supply
Since all units in initial inventory already have been produced, a positiveallocation from initial inventory to the dummy must be avoided. This is doneby assigning a prohibitively large number 10000 as the associated unit cost.
Supply ui
10000 7.00 7.70 8.40 0
10000 10000 7.00 7.70 0
10000 10000 10000 7.00 0
0.00 0.70 1.40 2.10 10000
8.00 10000 10000 10000 0
10000 9.00 10000 10000 0
10000 10000 8.00 10000 0
10000 10000 10000 10.00 0
Demand
vj
150
Overtime
(Spring) 100
Overtime
(Summer) 50
Overtime
(Fall) 100
InitialInventory
200
250 100 400 500 200
Overtime
(Winter)
Sources
Regular
(Spring) 200
Regular
(Summer) 300
Regular
(Fall) 350
Destination
Spring Summer Fall Winter Dummy
8/10/2019 Chapter 6 - Scheduling Algorithm
12/42
Excel Solver Installation
The Excel Solver is part of the Solver Add-in of
Microsoft Excel which you can find in the Data Menu.
It is first being installed in the computer by clicking theOffice Toolbar (for Office 2007) and click Excel
Options.
On the left side of the Options Dialog-Box, select Add-
Ins. On the Add-Ins name, search for Solver Add-in
and click Go. The Excel Solver will now be installed
on your computer. 12
8/10/2019 Chapter 6 - Scheduling Algorithm
13/42
13RAG 2007
Solve Using Excel Solver
Input the Transportation Tableau on the
Spreadsheet.
Spring Summer Fall Winter Dummy Supply
R-Spring 10000 7 7.7 8.4 0 200
R-Summer 10000 10000 7 7.7 0 300
R-Fall 10000 10000 10000 7 0 350
Initial Inventory 0 0.7 1.4 2.1 10000 200
O-Spring 8 10000 10000 10000 0 100
O-Summer 10000 9 10000 10000 0 50
O-Fall 10000 10000 8 10000 0 100
O-Winter 10000 10000 10000 10 0 150
Demand 250 100 400 500 200
8/10/2019 Chapter 6 - Scheduling Algorithm
14/42
14RAG 2007
Input Another Cell Range Just Below It
The Row and Column Total must have the
formula for the sum of the respective row and
column.
Spring Summer Fall Winter Dummy TotalR-Spring 0 0 0 0 0 0
R-Summer 0 0 0 0 0 0
R-Fall 0 0 0 0 0 0
Initial Inventory 0 0 0 0 0 0
O-Spring 0 0 0 0 0 0
O-Summer 0 0 0 0 0 0
O-Fall 0 0 0 0 0 0
O-Winter 0 0 0 0 0 0
Total 0 0 0 0 0
8/10/2019 Chapter 6 - Scheduling Algorithm
15/42
15RAG 2007
Create the Cell for the Costs (z)
Create a cell just below the new range of cells
with the formula as the sumproduct of range of
cells above with the range of cells below
excluding the row and column for the row total,column total, demand and supply.
Example:
=SUMPRODUCT(B2:F9,B14:F21)
8/10/2019 Chapter 6 - Scheduling Algorithm
16/42
16RAG 2007
The Excel Solver
On the Data Menu, Choose Solver and the
Solver Parameters Dialog Box will appear:
8/10/2019 Chapter 6 - Scheduling Algorithm
17/42
17RAG 2007
Input Parameters on the Solver
Dialog Box
Set the Target Cell as the Cell corresponding for thecost (z).
Set the Equal to Option to Minimum, as with theminimization program of the transportation tableau.
Set the Range of cells that you have created below thetransportation tableau as the range of cells in the ByChanging Cells Option.
Add the Constraints on the Subject by the Constraints
Option by setting the Row Total equal to total Supplyand the Column Total equal to the Demand Supply.Click Ok if done.
8/10/2019 Chapter 6 - Scheduling Algorithm
18/42
18RAG 2007
Getting the Optimal Solution
Click the Options Button and the SolverOptions Dialog Box will appear.
On the Solver Options Dialog Box, select
Assume Linear and Assume NonnegativeCheckboxes. Click Ok and you will be movedback the Solver Dialog Box.
Click Solve to get the optimal solution.The values in the Range of Cells below are the
optimal values of the variables and costs z is theoptimal solution to the problem.
8/10/2019 Chapter 6 - Scheduling Algorithm
19/42
19RAG 2007
Final Answer
Spring Summer Fall Winter Dummy Total
R-Spring 0 100 0 100 0 200
R-Summer 0 0 300 0 0 300
R-Fall 0 0 0 350 0 350
Initial Inventory 200 0 0 0 0 200O-Spring 50 0 0 0 50 100
O-Summer 0 0 0 0 50 50
O-Fall 0 0 100 0 0 100
O-Winter 0 0 0 50 100 150Total 250 100 400 500 200
costs 7790
8/10/2019 Chapter 6 - Scheduling Algorithm
20/42
20RAG 2007
Transshipment Problems
A transshipment problem, like a transportationproblem, involves sources, having supplies, anddestinations, having demands. In addition, it alsoinvolves junctions, through which goods can beshipped.
Unit shipping costs are given between all directly
accessible locations, and the objective is to develop atransportation schedule that will meet all demands atminimum total cost.
8/10/2019 Chapter 6 - Scheduling Algorithm
21/42
21RAG 2007
Solution to Transshipment Problems Transshipmet problems may be converted into
transportation problems by making every junctionbotha source and a destination. Each junction is assigned asupply equal to its original supply (or zero, if thejunction did not originally coincide with a source) plus
the total number of units in the system, same thing withthe demand. These assignments allow for thepossibility that all units may pass through a givenjunction.
The cost of transporting 1 unit from a junction(considered as a source) to itself (considered as adestination) is zero. Those units that do not passthrough a junction under the optimal schedule will
appear as allocations from the junction to itself.
8/10/2019 Chapter 6 - Scheduling Algorithm
22/42
22RAG 2007
Example No. 2
A corporation must transport 70 units of a product
from location 1 to locations 2 and 3, in the amounts of
45 and 25 units, respectively. Air freight charges cij(in
dollars per unit) between locations served by the aircarrier are given below where dotted lines signify that
service is not available. Determine a shipping schedule
that allocates the required number of goods to each
destination at a minimum total freight cost. Noshipment need be flown directly; shipments through
intermediate points are allowed.
8/10/2019 Chapter 6 - Scheduling Algorithm
23/42
23RAG 2007
i j 1 2 3 4
1 38 56 34
2 38
27
3 56 27 19
4 34 19
Table 2
1 3
4
2
$27
$27$38
$38
$56
$56
$19
$19
$34$34Figure 2
-45
+70 -25
8/10/2019 Chapter 6 - Scheduling Algorithm
24/42
24RAG 2007
Create the Transportation Tableau
Location 4 is a pure junction.
Locations 2 and 3 serve as both destinations andjunctions.
Location 1 serves both as a source and a junction. Therefore, we have 1, 2, 3, and 4 as the sources and 1,
2, 3, and 4 as destinations but we delete 1 as adestination since it could never be optimal to ship
goods from location 1 and have them return as somelater time, only to be shipped out again, the problemcan be simplified by not allowing shipments to location1, thereby restricting it to being solely a source.
8/10/2019 Chapter 6 - Scheduling Algorithm
25/42
25RAG 2007
Solution Using Excel Solver
2 3 4 Supply1 38 56 34 70
2 0 27 10000 70
3 27 0 19 70
4 10000 19 0 70
Demand 115 95 70
2 3 4 Total
1 45 0 25 70
2 70 0 0 703 0 70 0 70
4 0 25 45 70
Total 115 95 70
Costs 3035
8/10/2019 Chapter 6 - Scheduling Algorithm
26/42
26RAG 2007
Assignment Problems
Assignment problems involve schedulingworkers to jobs on one-to-one basis (moregenerally, they involve permutations of a set of
objects).
The objective is to schedule every worker to a
job so that all jobs are completed in theminimum total time (or, to find the permutationthat has the greatest total value).
8/10/2019 Chapter 6 - Scheduling Algorithm
27/42
27RAG 2007
Solution to Assignment Problems
Assignment problems can be converted into
transportation problems by considering the
workers as sources and the jobs as destinations,
where all supplies and demands are equal to 1.
A solution procedure more efficient than the
general transportation algorithm is the
Hungarian Method (which will be discussed
later).
8/10/2019 Chapter 6 - Scheduling Algorithm
28/42
28RAG 2007
Example No. 3
For the Figure below, determine a shipping
schedule that meets all demands at a minimum
total cost.
1
2 4 6
53
+70
+95
+15
-30
-30
-45
$3
$4
$2
$3
$7
$2
$4
$8
8/10/2019 Chapter 6 - Scheduling Algorithm
29/42
29RAG 2007
Solution
Locations 1 and 2 are sources.
Locations 5 and 6 are destinations
Location is both a source and a junction. Location 4 serves both as a destination and a
junction.
Because the total supply is 180 units but totaldemand is only 105, location 7 is created as a
dummy destination.
8/10/2019 Chapter 6 - Scheduling Algorithm
30/42
30RAG 2007
Set up the Transportation Tableau
3 4 5 6 dummy 7 supply
1 3 10000 8 10000 0 95
2 2 7 10000 10000 0 70
3 0 3 4 4 0 195
4 10000 0 10000 2 0 180
demand 180 210 30 45 75
3 4 5 6 dummy 7 total
1 0
2 0
3 04 0
total 0 0 0 0 0
costs 0
8/10/2019 Chapter 6 - Scheduling Algorithm
31/42
31RAG 2007
Solve Using Excel Solver
3 4 5 6 dummy 7 supply
1 3 10000 8 10000 0 95
2 2 7 10000 10000 0 70
3 0 3 4 4 0 195
4 10000 0 10000 2 0 180
demand 180 210 30 45 75
3 4 5 6 dummy 7 total
1 20 0 0 0 75 95
2 70 0 0 0 0 70
3 90 30 30 45 0 1954 0 180 0 0 0 180
total 180 210 30 45 75
costs 590
8/10/2019 Chapter 6 - Scheduling Algorithm
32/42
32RAG 2007
Hungarian Method
Step 1
In each row of the Hungarian Tableau, locate the smallestelement and subtract it from every element in that row. Repeatthis of each column (the column minimum is determined after
the row subtractions). The revised cost matrix will have at leastone zero in every row and column.
Step 2
Determine whether there exists feasible assignment involvingonly zero costs in the revised cost matrix. In other words, find ifthe revised matrix has n zero entries no two of which are in thesame row or column. If such an assignment exists, it is optimal.If no such exists, go to Step 3.
8/10/2019 Chapter 6 - Scheduling Algorithm
33/42
33RAG 2007
Hungarian Method
Step 3
Cover all zeroes in the revised cost matrix with as fewhorizontal and vertical lines as possible. Eachhorizontal line must pass through an entire row, each
vertical line must pass through an entire column; thetotal number of lines in this minimal covering will besmaller than n. Locate the smallest number in the costmatrix not covered by a line. Subtract this numberfrom every element not covered by a line and add it toevery element covered by two lines.
Step 4
Return to Step 2
8/10/2019 Chapter 6 - Scheduling Algorithm
34/42
34RAG 2007
Hungarian Tableau
The Hungarian method, uses only the cost matrix,
as input:
Jobs
Workers
cnncncncnn
ncccc
ncccc
ncccc
n
...321
..................
3...3332313
2...2322212
1...1312111
...321
8/10/2019 Chapter 6 - Scheduling Algorithm
35/42
35RAG 2007
Example No. 4
A 400-meter medley relay involves four differentswims, who successively swim 100 meters of the
backstroke, breaststroke, butterfly, and freestyle. A
coach has six very fast swimmers whose expected time
(in seconds) in the individual events are given below:
Event 1
(Backstroke0
Event 2
(breaststroke)
Event 3
(butterfly)
Event 4
(freestyle)
Swimmer 1 65 73 63 57
Swimmer 2 67 70 65 58
Swimmer 3 68 72 69 55
Swimmer 4 67 75 70 59
Swimmer 5 71 69 75 57
Swimmer 6 69 71 66 59
8/10/2019 Chapter 6 - Scheduling Algorithm
36/42
36RAG 2007
Solution Using the Hungarian
Method
How should the coach assign swimmers to the
relay so as to minimize the sum of their times?
Solution: Set the Hungarian Tableau
1 2 3 4 5 6
Swimmer 1 65 73 63 57 0 0Swimmer 2 67 70 65 58 0 0
Swimmer 3 68 72 69 55 0 0
Swimmer 4 67 75 70 59 0 0
Swimmer 5 71 69 75 57 0 0
Swimmer 6 69 71 66 59 0 0
Events
Tableau 4A
8/10/2019 Chapter 6 - Scheduling Algorithm
37/42
37RAG 2007
Step 1 of the Hungarian Method
Subtracting 0 from every row of Tableau 4a and
then subtracting 65, 69, 55, 0, and 0 from the
columns 1 through 6, respectively generates
tableau 4b below:
1 2 3 4 5 6
Swimmer 1 0 4 0 2 0 0
Swimmer 2 2 1 2 3 0 0Swimmer 3 3 3 6 0 0 0
Swimmer 4 2 6 7 4 0 0
Swimmer 5 6 0 12 2 0 0
Swimmer 6 4 2 3 4 0 0
Events
Tableau 4B
8/10/2019 Chapter 6 - Scheduling Algorithm
38/42
38RAG 2007
Step 2 of the Hungarian Method
The smallest uncovered element is 1, subtract 1
from every uncovered element and add 1 to
every element covered by 2 lines.
1 2 3 4 5 6
Swimmer 1 0 4 0 2 1 1
Swimmer 2 1 0 1 2 0 0
Swimmer 3 3 3 6 0 1 1
Swimmer 4 1 5 6 3 0 0
Swimmer 5 6 0 12 2 1 1
Swimmer 6 3 1 2 3 0 0
Events
Tableau 4C
8/10/2019 Chapter 6 - Scheduling Algorithm
39/42
39RAG 2007
Step 3 and 4 of the Hungarian
Method
Tableau 4c also does not contain a feasible zero-
cost assignment. Repeating step 3 of the
Hungarian method, we determine 1 is again the
smallest uncovered element as in Tableau 4d:
1 2 3 4 5 6
Swimmer 1 0 5 0 2 2 2
Swimmer 2 0 0 0 1 0 0
Swimmer 3 3 4 6 0 2 2
Swimmer 4 0 5 5 2 0 0
Swimmer 5 5 0 11 1 1 1
Swimmer 6 2 1 1 2 0 0
Events
Tableau 4D
8/10/2019 Chapter 6 - Scheduling Algorithm
40/42
40RAG 2007
Optimal Value
Tableau 4d which does contain a feasible zero-costassignment, as indicated thus, the optimal allocation isswimmer 1 to event 1 (backstroke), swimmer 2 to event3 (butterfly), swimmer 3 to event 4 (freestyle), and
swimmer 5 to event 2 (breaststroke); swimmers 4 and 6are not entered in the medley.
The minimum total time (in seconds) is calculated from
Tableau 4a.
z = c11 + c23 + c34 + c52 = 65+65+55+69= 254s
8/10/2019 Chapter 6 - Scheduling Algorithm
41/42
Schedule of Final Exam
December 6, 2013
Coverage: Chapters 5-6
Friday, 3-5pm
Bring your own laptop with Excel Solver!
41
8/10/2019 Chapter 6 - Scheduling Algorithm
42/42
End of Module
Thank you very much for listening!