The transitive closure of (V,E) is the graph Clos(V,E) = (V,C) where (x,y) £C iff there is a path p:x-~y in (V,E) with ILpil>0. The transitive reduct Red(V,E) of an acyclic graph (V,E) is the least graph (V,R) with Clos(V,R) = Clos(V,E) . The number o f e l emen t s o f a f i n i t e s e t X w i l l be denoted t h r o u ghout by IX1 . If Alg is an algorithm processing graphs, Time (Alg(V,E)) denotes the number of steps taken by Alg to process (V,E) . We write Time(Alg(V,E)) ~ 0(f(V,E)) , for a function f:K -~ N from some class of graphs to the non-negative integers N , if there exists ceN such that the inequality Time(Alg(V,E)) ~ c.f(V,E) holds for all (V,E)~ K . We then also say that Alg needs O(f(V,E)) time to process a member (V,E) of K , or that Alg has the time complexity O(f) on K . The main objective of the present note is to describe an algorithm Recl computing simultaneously both Red(V,E) and Clos(V,E) , for (V,E) acyclic, with the time complexity Time(Recl(V,E)) ~ O(IV I .~R~+ +lE l ) comparing f a v o r a b l y wi th the a l g o r i t h m s d e s c r i b e d i n [1~ , [2J , [ 5S , [6]. We also describe some useful modifications of this basic algorithm.
[1]
Harry B. Hunt,et al.
Operations on sparse relations
,
1977,
CACM.
[2]
Alfred V. Aho,et al.
The Design and Analysis of Computer Algorithms
,
1974
.
[3]
Michael J. Fischer,et al.
Boolean Matrix Multiplication and Transitive Closure
,
1971,
SWAT.
[4]
Václav Koubek,et al.
Several algorithms for finite algebras
,
1979,
FCT.
[5]
Robert E. Tarjan,et al.
Depth-First Search and Linear Graph Algorithms
,
1972,
SIAM J. Comput..
[6]
Alfred V. Aho,et al.
The Transitive Reduction of a Directed Graph
,
1972,
SIAM J. Comput..