- java.lang.Object
-
- it.unive.lisa.util.datastructures.graph.algorithms.Dominators<G,N,E>
-
- Type Parameters:
G
- the type of the targetGraph
sN
- the type ofNode
s in the target graphsE
- the type ofEdge
s in the target graphs
public class Dominators<G extends Graph<G,N,E>,N extends Node<G,N,E>,E extends Edge<G,N,E>> extends java.lang.Object
An algorithms that evaluates the dominators of each node in a graph. A noded
dominates a noden
if every path from an entry node ton
must go throughd
. By definition, every node dominates itself.- See Also:
- Dominators (graph theory)
-
-
Constructor Summary
Constructors Constructor Description Dominators()
Builds the dominators.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<N,java.util.Set<N>>
build(G graph)
Builds the dominators for the given graph.java.util.Map<N,java.util.Set<N>>
getDominators()
Yelds the last computed dominators throughbuild(Graph)
.
-
-
-
Constructor Detail
-
Dominators
public Dominators()
Builds the dominators. To run the algorithm, usebuild(Graph)
.
-
-
Method Detail
-
getDominators
public java.util.Map<N,java.util.Set<N>> getDominators()
Yelds the last computed dominators throughbuild(Graph)
. The returned value is a map going from each node of the given graph to the set of nodes that dominates it.- Returns:
- a map containing, for each node of the graph passed as argument
to the last call to
build(Graph)
, the set of nodes that dominates it
-
build
public java.util.Map<N,java.util.Set<N>> build(G graph)
Builds the dominators for the given graph. The returned value, that can also be accessed later throughgetDominators()
, is a map going from each node of the given graph to the set of nodes that dominates it.- Parameters:
graph
- the graph whose dominators are to be computed- Returns:
- a map containing, for each node of the graph, the set of nodes that dominates it
-
-