public class TransitiveReduction<V,E> extends Object
This is a port from a python example by Michael Clerx, posted as an answer to a question about transitive reduction algorithm pseudocode on Stack Overflow
| Constructor and Description |
|---|
TransitiveReduction() |
| Modifier and Type | Method and Description |
|---|---|
void |
reduce(org.jgrapht.DirectedGraph<V,E> directedGraph)
This method will remove all transitive edges from the graph passed as
input parameter.
|
public void reduce(org.jgrapht.DirectedGraph<V,E> directedGraph)
You may want to clone the graph before, as transitive edges will be pitilessly removed.
e.g.
DirectedGraph<V, T> soonToBePrunedDirectedGraph;
new TransitiveReduction<V, T>().reduce(soonToBePrunedDirectedGraph);
// pruned !
directedGraph - the directed graph that will be reduced transitivelyCopyright © 2015 aequologica. All rights reserved.