- Describe concepts like inventory management, production scheduling, and optimization
Critical Path Algorithm
The critical path algorithm allows you to create a priority list based on idea of critical paths.
How To: Critical Path Algorithm (version 1)
- Find the critical path.
- The first task in the critical path gets added to the priority list.
- Remove that task from the digraph.
- Repeat, finding the new critical path with the revised digraph.
Consider the scheduling problem represented by the digraph below.
The original digraph from Example 3 has critical path [latex]T2,T6,T5,T8,T10[/latex], so [latex]T2[/latex] gets added first to the priority list. Removing [latex]T_2[/latex] from the digraph, it now looks like:
Solution
The critical path (longest path) in the remaining digraph is now [latex]T_6,T_5,T_8,T_{10},[/latex] so [latex]T_6[/latex] is added to the priority list and removed.
Now there are two paths with the same longest length: [latex]T_1,T_5,T_8,T_{10}[/latex] and [latex]T_3,T_7,T_8,T_{10}[/latex]. We can add [latex]T_1[/latex] to the priority list (or [latex]T_3[/latex] – we usually add the one with smaller item number) and remove it, and continue the process.
How To: Backflow Algorithm
- Introduce an “end” vertex, and assign it a time of [latex]0[/latex], shown in [brackets].
- Move backwards to every vertex that has an arrow to the end and assign it a critical time.
- From each of those vertices, move backwards and assign those vertices critical times. Notice that the critical time for the earlier vertex will be that task’s time plus the critical time for the later vertex.
Consider this segment of digraph.
In this case, if [latex]T_2[/latex] has already been determined to have a critical time of [latex]10[/latex], then [latex]T_1[/latex] will have a critical time of [latex]5+10 = 15[/latex].
If you have already assigned a critical time to a vertex, replace it only if the new time is larger.
In the digraph below, [latex]T_1[/latex] should be labeled with a critical time of [latex]16[/latex], since it is the longer of [latex]5+10[/latex] and [latex]5+11[/latex].
Repeat until all vertices are labeled with their critical times.
One you have completed the backflow algorithm, you can easily create the critical path priority list by using the critical times you just found.