2. ResearchContributions
The two independent edges in the diagram will be
called OR connectors.
3. Job H can be completed seven days after Job Fand
five days after Job G are completed becomes
Two or more edges that are linked together are called
ANDconnectors.
In general, a project is represented as a directed
acyclic network with OR connectors and AND connec-
tors in which each edge has a given duration. There is
assumed to be a unique Startvertex and Finishvertex.
For example,
Start ~ Finish
The following notation is used: Let T(vertex) be the
shortest time in which the job represented by the ver-
tex can be completed. In the example, T(Start)=O,
T(A)=3,T(B)= 4, T(Q = 8, T(Finish)= 10.
Given an edge e from Parent A to Child B as pictured,
let DUR(e)= the time to go from A to B along e. Define
T(B,e) = the time to complete B through e=T(A)+
DUR(e).
Given an AND connector (el, e2) from A and B to C as
pictured,
define T(C,(el,e2)) = the time to complete C through
the connector (el, e2) = max(T(C, e~), T(C, e21).This is
the natural definition since both A and B must be com-
pleted for the connector to be traversed. In general,
T(job, connector} = max (T(job, edge)} over all the edges
in the connector.
Finally, the shortest time in which a job can be com-
pleted T(job) is equal to the min(T(job, connector}) over
all the connectors terminating at a job. The critical path
scheduling problem is to find T(Finish)assuming T(Start)
~0.
A minimal collection of vertices and edges that must
be reached and traversed for the Finishvertex to be
completed in time equal to T(Finish)is called an optimal
plan. In example (1),
Start~ / ~ Finish
is an optimal plan.
A critical path is a path of edges from Startto Finish
with length equal to T(Finish)contained in an optimal
plan. In example (1),
Start~ Finish
is a critical path.
When applying results, an increase in the duration of
an edge can have three possible consequences:
1. If the edge is not in the optimal plan, then T(Finish)
is not affected at all no matter how large the dura-
tion becomes.
2. If the edge is in the optimal plan but not on the
critical path, then T(Finish)is not affected when the
increase is below a certain slack value.
3. If the edge is on the critical path, then any increase
in its duration will result in an increase of T(Finish).
Note that, if each vertex can only be reached by way
of a unique AND connector, the problem reduces to
classical critical path scheduling and the optimal plan
is the entire network. If all connectors are OR connec-
tors, then the problem reduces to a shortest path prob-
lem and an optimal plan reduces to a critical path.
SOLUTION METHODS
In this section, three different methods of solution are
discussed. Each method uses a similar strategy based on
dividing the vertices of the network into two sets,
Reachedand Unreached.An outline of the general algo-
rithm is
1. Place Startin Reached and set T(Start)=O.
2. Choose a suitable element of Unreached, and trans-
fer it to Reached calculating its time of completion
October1984 Volume27 Number10 CommunicationsoftheACM 1045
3. Research Contributions
and labeling the connector through which it has
been reached.
3. If Finish is in Reached, then trace back from Finish
using labels to find the optimal plan and critical
path, and then stop, else return to Step 2.
The differences in the methods presented are in Step
2 when a suitable vertex is chosen from Unreached.
The algorithms are extensions of the classic critical
path, shortest path, and heuristic search algorithms.
Method 1: Extended Critical Path
In this method, a vertex is transferred from Unreached
to Reached only if all of its parents are already in
Reached. The time to complete the vertex's job can be
calculated using a maximization within AND connec-
tors followed by a minimization over all connectors.
There will always be a vertex in Unreached whose
parents are all in Reached. A suitable vertex can be
found by tracing backward as far as possible from any
Unreached vertex through its Unreached ancestors
since the network is finite and acyclic.
The problem with this method is that it may examine
far too many vertices. For example,
Start Finish
Nodes A, B, and C must be reached before node D even
though they are not part of the optimal plan.
Method 2: Extended Shortest Path
In this method, an estimate of the shortest time to
reach each vertex in Unreached is maintained. This
estimated time is denoted by g(vertex). Initially
g(vertex) = oofor all vertices except Start. Then
g(vertex) is updated whenever any parent of the vertex
is added to Reached. The new value is calculated by
maximizing within AND connectors to the vertex and
then minimizing the time to the completion of the ver-
tex over all connectors. For example,
If A is in Unreached, T(B) = 1, and T(Q = 4, then g(D) =
9. However, if T(A) = 5, T(B) = 1, and T(Q = 4, then
g(O) -- 7.
In summary, the vertex chosen in Step 2 of the gen-
eral algorithm is the one with the smallest estimated
time to completion. The advantage of this approach
over Method 1 is that, often, Finish may be placed in
Reached while other vertices are still in Unreached. In
particular, for example {2), using Method 2, only Start,
D, and Finish will be reached saving unnecessary work.
However, Method 2 may still explore extra vertices
due to a lack of foresight. For example,
Start
Method 2 will place A, B, and C in Reached even
though they are not part of the optimal plan.
Method 3: Heuristic Search
This method is similar to the shortest path algorithm in
that it keeps track of g(vertex), the estimated time to
each vertex in Unreached. In addition, an estimated
time from the vertex to Finish denoted by h(vertex) is
calculated at the beginning of the algorithm. Then, the
vertex chosen to be transferred from Unreached to
Reached is the one with the smallest value of g(vertex)
+ h(vertex). Note, when h = 0 for all vertices, then
Method 3 reduces to Method 2.
The purpose of h is to allow knowledge of future
delays to influence the planning of the project. An ex-
ample of a heuristic search using h(vertex) = (Duration
of the smallest edge leading out of the vertex (one step
look-ahead)) follows:
Finish
h(A) =10, h(B) = 2, h(Q=2, h(D) = l
Step 1. Start added to Reached T(Start) = O, g(A} -- 1,
g(B) = 5, others g = ~. g(A) + h{A) = 11,
g(B) + h(B) = 7.
Step 2. B added to Reached T(B) = 5, g(A) = 1, g(D) =
7, g(C} = oo.g(D) + h(D) = 8, g(C) + h(C} = oo.
Step 3. D added to Reached T(D) = 7, g(Finish) = 10,
g(Q = 9. g(Q + h(Q = 11, g(Finish) + h(Finish)
=10.
Step 4. Finish added to Reached and stop.
In example (4), vertices A and C are never added to
Reached. In general, using heuristic search will reduce
the number of vertices in Reached.
The following results in Nilsson [5] hold true for
Method 3:
1046 Communications of the ACM October 1984 Volume 27 Number 10
4. Research Contributions
1. In order to use the general algorithm, the difference
between the h values of any two vertices connected
by a path must not he greater than the difference
between their completion times. If this condition is
not satisfied, a slightly modified algorithm must be
used that updates g for Reached vertices if neces-
sary.
2. If h(vertex) underestimates the actual time from the
vertex to Finishfor all vertices, then heuristic
search will not reach any vertex whose completion
time is greater than T(Finish}.
3. If hi(vertex) and h2(vertex} are underestimates as in
(2) with hi(vertex) _<h2(vertex} for all vertices, then
the heuristic search based on h2 will add no more
vertices to Reached than the heuristic search based
on h~. In particular, if h2 equals the actual time to
4.
Finish at every vertex, then the heuristic search
based on h2 will add no unnecessary vertices to
Reached.
If h(vertex} is an overestimate by no more than E at
every vertex, then heuristic search based on h will
not add to Reached any vertex whose time of com-
pletion is greater than T(Finish}+ E.
CONCLUSION
For a complicated project with a large number of alter-
natives, heuristic search may he used to reduce the
amount of time needed to compute the critical path and
the optimal plan. If an accurate estimate can be made
of the time from the completion of individual jobs to
the completion of the project, then a drastic reduction
in computation time is possible.
APPENDIX: The following is a larger problem
illustrating the three methods.
12
Start Finish
Method 1
Vertices can be reached in the order Start,A, C, B, E, D,
F,Finishwith T(A}= 8, T(Q = 3, T(B}= 7, T(E}= 6,
T(D}= 20, T(F}= 9, T(Finish}= 11. The optimal plan is
Start
The critical path is
Finish
Start ~ 3 3 6 ~ 2 7( ~ Finish
Method 2
Vertices are reached in the order Start, C, E, B, A, F,
Finish, skipping D.
Method 3
Using a one-step look-ahead gives
h(A) = 7, h(B}= 9, h(C}=3,
h(D}= 5, h(E}= l, h(F}= 2
Vertices are reached in the order Start, C, E, F,Finish,
skipping A, B, D.
REFERENCES
1. Hart, P.E., Nilsson, N.J., and Raphael, B. A formal basis for the
heuristic determination of minimum cost path, IEEETrans. Syst. Man
Cybern. SMC-4(2)(1968), 100-107.
2. Kelley, J.E. Critical path planning and scheduling: Mathematical
basis. Oper. Res. 9 (1969},296-320.
3. Martelli, A., and Montanari, U. Additive AND/OR graphs. IJCAI-4,
(1975), 345-350.
4. Moder, l., and Phillips, C. ProjectManagement with CPMand PERT.
Van Nostrand Reinhold, New York, 1970.
5. Nilsson, N.J. Principles ofArtificial Intelligence. Tioga Publishing, Pale
Alto, Calif., 1080.
CR Categories and Subject Descriptors: G.2.2 [Discrete Mathemat-
ics]: Graph Theory; 1.2.8 ]Artificial Intelligence]: Problem Solving, Con-
trol Methods and Search; K.6.1 [Management of Computing and Infor-
mation]: Project and People Management
General Terms: Algorithms
Additional Key Words and Phrases: AND-OR network, critical path,
optimal plan
Received 2/84; accepted 5/84
Author's Present Address: Robert Marcus, Mathematics Dept., Western
Washington University, Bellingham, WA 98225.
Permission to copy without fee all or part of this material is granted
provided that the copies are not made or distributed for direct commer-
cial advantage, the ACM copyright notice and the title of the publication
and its date appear, and notice is given that copying is by permission of
the Association for Computing Machinery. To copy otherwise, or to
republish, requires a fee and/or specific permission.
October 1984 Volume 27 Number 10 Communications of the ACM 1047