In the
mathematical
Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
field of
graph theory
In mathematics and computer science, graph theory is the study of ''graph (discrete mathematics), graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of ''Vertex (graph ...
, a transitive reduction of a
directed graph is another directed graph with the same
vertices and as few edges as possible, such that for all pairs of vertices , a (directed)
path from to in exists
if and only if
In logic and related fields such as mathematics and philosophy, "if and only if" (often shortened as "iff") is paraphrased by the biconditional, a logical connective between statements. The biconditional is true in two cases, where either bo ...
such a path exists in the reduction. Transitive reductions were introduced by , who provided tight bounds on the
computational complexity of constructing them.
More technically, the reduction is a directed graph that has the same
reachability relation as . Equivalently, and its transitive reduction should have the same
transitive closure
In mathematics, the transitive closure of a homogeneous binary relation on a set (mathematics), set is the smallest Relation (mathematics), relation on that contains and is Transitive relation, transitive. For finite sets, "smallest" can be ...
as each other, and the transitive reduction of should have as few edges as possible among all graphs with that property.
The transitive reduction of a finite
directed acyclic graph (a directed graph without
directed cycles) is unique and is a
subgraph of the given graph. However, uniqueness fails for graphs with (directed) cycles, and for infinite graphs not even existence is guaranteed.
The closely related concept of a minimum equivalent graph is a subgraph of that has the same reachability relation and as few edges as possible. The difference is that a transitive reduction does not have to be a subgraph of . For finite
directed acyclic graphs, the minimum equivalent graph is the same as the transitive reduction. However, for graphs that may contain cycles, minimum equivalent graphs are
NP-hard
In computational complexity theory, a computational problem ''H'' is called NP-hard if, for every problem ''L'' which can be solved in non-deterministic polynomial-time, there is a polynomial-time reduction from ''L'' to ''H''. That is, assumi ...
to construct, while transitive reductions can be constructed in
polynomial time.
Transitive reduction can be defined for an abstract
binary relation
In mathematics, a binary relation associates some elements of one Set (mathematics), set called the ''domain'' with some elements of another set called the ''codomain''. Precisely, a binary relation over sets X and Y is a set of ordered pairs ...
on a
set
Set, The Set, SET or SETS may refer to:
Science, technology, and mathematics Mathematics
*Set (mathematics), a collection of elements
*Category of sets, the category whose objects and morphisms are sets and total functions, respectively
Electro ...
, by interpreting the pairs of the relation as arcs in a directed graph.
Classes of graphs
In directed acyclic graphs
The transitive reduction of a finite
directed graph ''G'' is a graph with the fewest possible edges that has the same
reachability relation as the original graph. That is, if there is a path from a vertex ''x'' to a vertex ''y'' in graph ''G'', there must also be a path from ''x'' to ''y'' in the transitive reduction of ''G'', and vice versa. Specifically, if there is some path from x to y, and another from y to z, then there may be no path from x to z which does not include y.
Transitivity for x, y, and z means that if x < y and y < z, then x < z. If for any path from y to z there is a path x to y, then there is a path x to z; however, it is not true that for any paths x to y and x to z that there is a path y to z, and therefore any edge between vertices x and z are excluded under a transitive reduction, as they represent walks which are not transitive. The following image displays drawings of graphs corresponding to a non-transitive binary relation (on the left) and its transitive reduction (on the right).
The transitive reduction of a finite
directed acyclic graph ''G'' is unique, and consists of the edges of ''G'' that form the only path between their endpoints. In particular, it is always a
spanning subgraph of the given graph. For this reason, the transitive reduction coincides with the minimum equivalent graph in this case.
In the mathematical theory of
binary relation
In mathematics, a binary relation associates some elements of one Set (mathematics), set called the ''domain'' with some elements of another set called the ''codomain''. Precisely, a binary relation over sets X and Y is a set of ordered pairs ...
s, any relation ''R'' on a set ''X'' may be thought of as a
directed graph that has the set ''X'' as its vertex set and that has an arc ''xy'' for every
ordered pair
In mathematics, an ordered pair, denoted (''a'', ''b''), is a pair of objects in which their order is significant. The ordered pair (''a'', ''b'') is different from the ordered pair (''b'', ''a''), unless ''a'' = ''b''. In contrast, the '' unord ...
of elements that are related in ''R''. In particular, this method lets
partially ordered set
In mathematics, especially order theory, a partial order on a Set (mathematics), set is an arrangement such that, for certain pairs of elements, one precedes the other. The word ''partial'' is used to indicate that not every pair of elements need ...
s be reinterpreted as directed acyclic graphs, in which there is an arc ''xy'' in the graph whenever there is an order relation ''x'' < ''y'' between the given pair of elements of the partial order. When the transitive reduction operation is applied to a directed acyclic graph that has been constructed in this way, it generates the
covering relation of the partial order, which is frequently given visual expression by means of a
Hasse diagram.
Transitive reduction has been used on networks which can be represented as directed acyclic graphs (e.g.
citation graphs or
citation networks) to reveal structural differences between networks.
In graphs with cycles
In a finite graph that has cycles, the transitive reduction may not be unique: there may be more than one graph on the same vertex set that has a minimum number of edges and has the same reachability relation as the given graph. Additionally, it may be the case that none of these minimum graphs is a subgraph of the given graph. Nevertheless, it is straightforward to characterize the minimum graphs with the same reachability relation as the given graph ''G''.
If ''G'' is an arbitrary directed graph, and ''H'' is a graph with the minimum possible number of edges having the same reachability relation as ''G'', then ''H'' consists of
*A
directed cycle for each
strongly connected component
In the mathematics, mathematical theory of directed graphs, a graph is said to be strongly connected if every vertex is reachability, reachable from every other vertex. The strongly connected components of a directed graph form a partition of a s ...
of ''G'', connecting together the vertices in this component
*An edge ''xy'' for each edge ''XY'' of the transitive reduction of the
condensation
Condensation is the change of the state of matter from the gas phase into the liquid phase, and is the reverse of vaporization. The word most often refers to the water cycle. It can also be defined as the change in the state of water vapor ...
of ''G'', where ''X'' and ''Y'' are two strongly connected components of ''G'' that are connected by an edge in the condensation, ''x'' is any vertex in component ''X'', and ''y'' is any vertex in component ''Y''. The condensation of ''G'' is a directed acyclic graph that has a vertex for every strongly connected component of ''G'' and an edge for every two components that are connected by an edge in ''G''. In particular, because it is acyclic, its transitive reduction can be defined as in the previous section.
The total number of edges in this type of transitive reduction is then equal to the number of edges in the transitive reduction of the condensation, plus the number of vertices in nontrivial strongly connected components (components with more than one vertex).
The edges of the transitive reduction that correspond to condensation edges can always be chosen to be a subgraph of the given graph ''G''. However, the cycle within each strongly connected component can only be chosen to be a subgraph of ''G'' if that component has a
Hamiltonian cycle
In the mathematics, mathematical field of graph theory, a Hamiltonian path (or traceable path) is a path (graph theory), path in an undirected or directed graph that visits each vertex (graph theory), vertex exactly once. A Hamiltonian cycle (or ...
, something that is not always true and is difficult to check. Because of this difficulty, it is
NP-hard
In computational complexity theory, a computational problem ''H'' is called NP-hard if, for every problem ''L'' which can be solved in non-deterministic polynomial-time, there is a polynomial-time reduction from ''L'' to ''H''. That is, assumi ...
to find the smallest subgraph of a given graph ''G'' with the same reachability (its minimum equivalent graph).
In infinite graphs
Aho et al. provide the following example to show that in
infinite graphs, even when the graph is acyclic, a transitive reduction may not exist. Form a graph with a vertex for each
real number
In mathematics, a real number is a number that can be used to measure a continuous one- dimensional quantity such as a duration or temperature. Here, ''continuous'' means that pairs of values can have arbitrarily small differences. Every re ...
, with an edge
whenever
as real numbers. Then this graph is infinite, acyclic, and transitively closed. However, in any subgraph that has the same transitive closure, each remaining edge
can be removed without changing the transitive closure, because there still must remain a path from
to
through any vertex between them. Therefore, among the subgraphs with the same transitive closure, none of these subgraphs is minimal: there is no transitive reduction.
Computational complexity
As Aho et al. show,
when the
time complexity
In theoretical computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations ...
of graph algorithms is measured only as a function of the number ''n'' of vertices in the graph, and not as a function of the number of edges, transitive closure and transitive reduction of directed acyclic graphs have the same complexity. It had already been shown that transitive closure and
multiplication
Multiplication is one of the four elementary mathematical operations of arithmetic, with the other ones being addition, subtraction, and division (mathematics), division. The result of a multiplication operation is called a ''Product (mathem ...
of
Boolean matrices of size ''n'' × ''n'' had the same complexity as each other,
[ credit this result to an unpublished 1971 manuscript of Ian Munro, and to a Russian-language paper by M. E. Furman, .] so this result put transitive reduction into the same class. The
best exact algorithms for matrix multiplication, as of 2023, take time O(''n''
2.371552), and this gives the fastest known worst-case time bound for transitive reduction in dense graphs, by applying it to matrices over the integers and looking at the nonzero entries in the result.
Computing the reduction using the closure
To prove that transitive reduction is as easy as transitive closure, Aho et al. rely on the already-known equivalence with Boolean matrix multiplication. They let ''A'' be the
adjacency matrix
In graph theory and computer science, an adjacency matrix is a square matrix used to represent a finite graph (discrete mathematics), graph. The elements of the matrix (mathematics), matrix indicate whether pairs of Vertex (graph theory), vertices ...
of the given directed acyclic graph, and ''B'' be the adjacency matrix of its transitive closure (computed using any standard transitive closure algorithm). Then an edge ''uv'' belongs to the transitive reduction if and only if there is a nonzero entry in row ''u'' and column ''v'' of matrix ''A'', and there is a zero entry in the same position of the matrix product ''AB''. In this construction, the nonzero elements of the matrix ''AB'' represent pairs of vertices connected by paths of length two or more.
Computing the closure using the reduction
To prove that transitive reduction is as hard as transitive closure, Aho et al. construct from a given directed acyclic graph ''G'' another graph ''H'', in which each vertex of ''G'' is replaced by a path of three vertices, and each edge of ''G'' corresponds to an edge in ''H'' connecting the corresponding middle vertices of these paths. In addition, in the graph ''H'', Aho et al. add an edge from every path start to every path end. In the transitive reduction of ''H'', there is an edge from the path start for ''u'' to the path end for ''v'', if and only if edge ''uv'' does not belong to the transitive closure of ''G''. Therefore, if the transitive reduction of ''H'' can be computed efficiently, the transitive closure of ''G'' can be read off directly from it.
Computing the reduction in sparse graphs
When measured both in terms of the number ''n'' of vertices and the number ''m'' of edges in a directed acyclic graph, transitive reductions can also be found in time O(''nm''), a bound that may be faster than the matrix multiplication methods for
sparse graph
In mathematics, a dense graph is a Graph (discrete mathematics), graph in which the number of edges is close to the maximal number of edges (where every pair of Vertex (graph theory), vertices is connected by one edge). The opposite, a graph with ...
s. To do so, apply a
linear time
In theoretical computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations ...
longest path algorithm in the given directed acyclic graph, for each possible choice of starting vertex. From the computed longest paths, keep only those of length one (single edge); in other words, keep those edges (''u'',''v'') for which there exists no other path from ''u'' to ''v''. This O(''nm'') time bound matches the complexity of constructing transitive closures by using
depth-first search or
breadth first search to find the vertices reachable from every choice of starting vertex, so again with these assumptions transitive closures and transitive reductions can be found in the same amount of time.
Output-sensitive
For a graph with ''n'' vertices, ''m'' edges, and ''r'' edges in the transitive reduction, it is possible to find the transitive reduction using an
output-sensitive algorithm in an amount of time that depends on ''r'' in place of ''m''. The algorithm is:
*For each vertex ''v'', in the reverse of a
topological order of the input graph:
**Initialize a set of vertices reachable from ''v'', initially the singleton set .
**For each edge ''vw'', in topological order by ''w'', test whether ''w'' is in the reachable set of ''v'', and if not:
***Output edge ''vw'' as part of the transitive reduction.
***Replace the set of vertices reachable from ''v'' by its union with the reachable set of ''w''.
The ordering of the edges in the inner loop can be obtained by using two passes of
counting sort or another
stable sorting algorithm to sort the edges, first by the topological numbering of their end vertex, and secondly by their starting vertex. If the sets are represented as
bit array
A bit array (also known as bitmask, bit map, bit set, bit string, or bit vector) is an array data structure that compactly stores bits. It can be used to implement a simple set data structure. A bit array is effective at exploiting bit-level par ...
s, each set union operation can be performed in time ''O''(''n''), or faster using
bitwise operation
In computer programming, a bitwise operation operates on a bit string, a bit array or a binary numeral (considered as a bit string) at the level of its individual bits. It is a fast and simple action, basic to the higher-level arithmetic operatio ...
s. The number of these set operations is proportional to the number of output edges, leading to the overall time bound of ''O''(''nr''). The reachable sets obtained during the algorithm describe the transitive closure of the input.
If the graph is given together with a partition of its vertices into ''k'' chains (pairwise-reachable subsets), this time can be further reduced to ''O''(''kr''), by representing each reachable set concisely as a union of suffixes of chains.
Notes
References
*.
*.
*
*.
*.
*.
*.
External links
*
{{DEFAULTSORT:Transitive Reduction
Set theory
Graph theory
Graph algorithms
de:Transitive_Hülle_(Relation)#Transitive_Reduktion