Hello! Welcome back to our course on scheduling.
In our last lesson, we focused on visualizing flow shop schedules using Gantt charts. We saw how the chart visually represents the flow of jobs and allows us to identify the makespan. The key takeaway was the rule for starting any operation: it can only begin when both the job is ready (finished its previous operation) and the machine is available (finished the previous job).
Today, we will formalize this rule into a mathematical procedure. This lesson directly addresses the learning outcome: Calculate makespan for a given job sequence in a flow shop. We will move from the visual drawing of a chart to a faster, more systematic algorithmic approach. For your thesis work involving complex optimization algorithms, being able to efficiently calculate the makespan of thousands or millions of potential sequences is not just a convenience—it's a necessity.
1. From Visual Logic to a Mathematical Formula
The logic we used to build Gantt charts can be captured in a set of equations. This is crucial because a computer algorithm can't "see" a chart; it operates on data and formulas. Let's define our terms:
- Let be the number of jobs and be the number of machines.
- Let a job sequence be a permutation , where is the job in the -th position of the sequence.
- Let be the processing time of job on machine .
- Let be the completion time of the job on machine .
The rule from our last lesson was that an operation starts at .
- The job is ready for machine when it finishes on machine . This time is .
- Machine is available for job when it finishes the previous job in the sequence, . This time is .
Therefore, the start time for job on machine is . The completion time is this start time plus the processing time. This gives us a powerful recursive formula.
The following research paper provides a concise and formal definition of this calculation. Since your goal is to write a thesis, engaging with this kind of formal academic notation is excellent practice.
Exactly Solving Hard Permutation Flowshop Scheduling ...
This paper, 'Exactly Solving Hard Permutation Flowshop Scheduling...', presents the standard mathematical formulation for the permutation flow shop problem. It's a great example of the rigorous notation used in scheduling research.
Please read Section 2.1, 'Problem formulation'. Focus on Equation (1), which is the recursive formula for calculating completion times CÏ€(j),k. Also, note the definition of makespan, Cmax(Ï€), and the boundary conditions mentioned (e.g., CÏ€(j),0 = 0).
The core of the calculation is the formula:
This single equation, along with the boundary conditions for the first job and first machine, is all an algorithm needs to determine the makespan for any given sequence.
To reinforce this concept, let's watch a short video that explains this exact logic verbally.
The scheduling problem (7/7). Computation of makespan in a permutation flow shop
This video by Luis R. Izquierdo, which we touched upon in the last lesson, also contains a perfect explanation of the general algorithm for calculating completion times. It directly translates the 'max' rule into a computational procedure.
Please watch from 06:11 to 08:16. The narrator breaks down the start time of an operation into the 'maximum' of two conditions, which corresponds exactly to the two terms inside the max() function in the formula we just saw.
2. A Step-by-Step Worked Example
Now, let's apply this formula to a problem. We will use a tabular method, which is how you would likely implement this in code or a spreadsheet.
Consider the following 4-job, 3-machine problem from the resource "Flow Shop", with the job sequence .
Processing Times ():
| Job (j) | Machine 1 (i=1) | Machine 2 (i=2) | Machine 3 (i=3) |
|---|---|---|---|
| 1 | 4 | 2 | 1 |
| 2 | 3 | 6 | 2 |
| 3 | 7 | 2 | 3 |
| 4 | 1 | 5 | 8 |
We want to calculate the completion time matrix, . We'll build it row by row (job by job) and column by column (machine by machine).
Completion Time Matrix ():
| Job (k) | C(k,1) | C(k,2) | C(k,3) |
|---|---|---|---|
| 1 | 4 | 6 | 7 |
| 2 | 7 | 13 | 15 |
| 3 | 14 | 16 | 19 |
| 4 | 15 | 21 | 29 |
Let's walk through the calculations:
Job 1 (first in sequence):
- (Boundary case: no previous job)
- (Boundary case: no previous job)
- (Boundary case: no previous job)
Job 2 (second in sequence):
- (Boundary case: first machine)
Job 3 (third in sequence):
Job 4 (last in sequence):
The makespan, , is the completion time of the last job on the last machine: .
Test your understanding!
Now it's your turn. Consider a new 3-job, 3-machine problem.
Processing Times ():
| Job (j) | Machine 1 | Machine 2 | Machine 3 |
|---|---|---|---|
| 1 | 5 | 2 | 4 |
| 2 | 3 | 6 | 3 |
| 3 | 2 | 4 | 5 |
Calculate the makespan for the sequence . Fill out the completion time matrix.
Show answer
Completion Time Matrix ():
| Job (k) | C(k,1) | C(k,2) | C(k,3) |
|---|---|---|---|
| 1 | 5 | 7 | 11 |
| 2 | 8 | 14 | 17 |
| 3 | 10 | 18 | 23 |
Calculations:
- Job 1: ; ; .
- Job 2: ; ; .
- Job 3: ; ; .
The makespan is 23.
3. Application in Heuristics
The calculation you've just mastered is the core engine for evaluating solutions in almost any makespan-minimization algorithm. For example, when we discuss heuristics like the famous NEH algorithm in a future lesson, you'll see that it works by iteratively building a sequence and calculating the makespan at each step to make its decisions. The video below shows several such calculations for different sequences while demonstrating various heuristics. You don't need to understand the heuristics themselves yet, but notice how frequently the makespan calculation is performed.
Mod-07 Lec-27 Flow shop scheduling -- heuristics -- Palmer, Campbell Dudek Smith algorithm
The video 'Flow shop scheduling -- heuristics...' from nptelhrd repeatedly calculates the makespan for different sequences. This highlights how this calculation is a fundamental building block for more advanced algorithms.
Watch the two segments from 15:54-18:59 and 34:17-37:18. Observe how the narrator methodically fills out the completion time table for two different job sequences. This demonstrates the practical application of the formula we've learned today.
Conclusion
In this lesson, we transitioned from a visual understanding of schedules to a formal, mathematical procedure for calculating the makespan. This is a critical step towards building and analyzing sophisticated scheduling algorithms.
Key Takeaways:
- The makespan for any permutation flow shop schedule can be found using the recursive formula: .
- This calculation can be performed systematically using a tabular approach, which is easily translated into a computer program.
- Calculating the makespan is the fundamental step for evaluating the quality of a schedule and is used extensively by optimization algorithms.
Preview of the Next Lesson:
So far, we have only focused on how to evaluate a given sequence. The real challenge is finding the best sequence. For a small number of machines, there are efficient ways to do this. In our next lesson, we will explore Johnson's algorithm, a classic and elegant method that guarantees the optimal solution for any two-machine flow shop problem (). This will be our first step into the world of optimization algorithms for scheduling.