public final class Transitivity extends Object
G = (V,E)
be a directed acyclic graph. The reflexive, transitive closure
of G
is a graph which contains edge (v,w)
only if there exists a path from v
to w
in
G
.
G = (V,E)
be a directed acyclic graph. The transitive reduction of G
is a graph which contains edge (v,w)
only if there exists no path from v
to w
in G
of
length 2
or more.
Modifier and Type | Method and Description |
---|---|
static void |
transitiveClosure(Graph graph)
Calculates the transitive closure for a directed acyclic graph.
|
static void |
transitiveClosure(Graph graph,
EdgeList addedEdges)
Calculates the transitive closure for a directed acyclic graph.
|
static void |
transitiveReduction(Graph graph)
Calculates the transitive reduction for a directed acyclic graph.
|
static void |
transitiveReduction(Graph graph,
EdgeList transitiveEdges)
Calculates the transitive reduction for a directed acyclic graph.
|
public static final void transitiveClosure(Graph graph)
Given a G = (V,E)
be a directed acyclic graph. The reflexive, transitive closure of G
is a graph
which contains edge (v,w)
only if there exists a path from v
to w
in G
.
acyclic
.graph
- the input graph to which this method will add transitive edges, if necessarypublic static final void transitiveClosure(Graph graph, EdgeList addedEdges)
Given a G = (V,E)
be a directed acyclic graph. The reflexive, transitive closure of G
is a graph
which contains edge (v,w)
only if there exists a path from v
to w
in G
.
acyclic
.graph
- the input graph to which this method will add transitive edges, if necessaryaddedEdges
- a list
that will be filled during the execution and contains the edges that have been added to the
graph by this methodpublic static final void transitiveReduction(Graph graph)
The transitive edges in the graph will be removed by this method.
Given G = (V,E)
be a directed acyclic graph. The transitive reduction of G
is a graph which
contains edge (v,w)
only if there exists no path from v
to w
in G
of length 2
or
more.
n
x
n
)-matrix is allocated to store reach data.acyclic
.O(graph.N()^3)
graph
- the input graphpublic static final void transitiveReduction(Graph graph, EdgeList transitiveEdges)
The transitive edges in the graph will be removed by this method.
Given G = (V,E)
be a directed acyclic graph. The transitive reduction of G
is a graph which
contains edge (v,w)
only if there exists no path from v
to w
in G
of length 2
or
more.
n
x
n
)-matrix is allocated to store reach data.acyclic
.O(graph.N()^3)
graph
- the input graphtransitiveEdges
- a list
that will be filled during the execution and contains all transitive edges of the given graph;
removal of these edges will yield the transitive reduction of the graph