Class StronglyConnectedComponents
- java.lang.Object
-
- com.ensoftcorp.open.commons.algorithms.StronglyConnectedComponents
-
public class StronglyConnectedComponents extends java.lang.Object
A wrapper for the JGraphT implementation of StronglyConnectedComponent (SCC) computations- Author:
- Tom Deering, Ben Holland
-
-
Constructor Summary
Constructors Constructor Description StronglyConnectedComponents(com.ensoftcorp.atlas.core.db.graph.Graph graph)
StronglyConnectedComponents(com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> nodes, com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Edge> edges)
Deprecated.StronglyConnectedComponents(com.ensoftcorp.atlas.core.query.Q q)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<com.ensoftcorp.atlas.core.db.set.AtlasHashSet<com.ensoftcorp.atlas.core.db.graph.Node>>
findSCCs()
Returns the graph's strongly-connected-components in the graph.java.util.List<com.ensoftcorp.atlas.core.db.set.AtlasHashSet<com.ensoftcorp.atlas.core.db.graph.Node>>
findSCCs(boolean includeSingleElementSCCs)
Returns the graph's strongly-connected-components in the graph.java.util.Iterator<com.ensoftcorp.atlas.core.db.graph.Node>
forwardDFSIterator()
Returns an iterator which iterates over the elements of this graph in a forward DFS order, after having identified SCCs and converted the graph to a DAG.com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Edge>
getEdges()
com.ensoftcorp.atlas.core.db.graph.Graph
getGraph()
com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node>
getNodes()
java.util.Iterator<com.ensoftcorp.atlas.core.db.graph.Node>
reverseDFSIterator()
Returns an iterator which iterates over the elements of this graph in a forward DFS order, after having identified SCCs and converted the graph to a DAG.java.util.List<com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node>>
roots()
Returns the graph's roots, which may be single nodes or else root SCCs.
-
-
-
Constructor Detail
-
StronglyConnectedComponents
public StronglyConnectedComponents(com.ensoftcorp.atlas.core.db.graph.Graph graph)
-
StronglyConnectedComponents
@Deprecated public StronglyConnectedComponents(com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> nodes, com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Edge> edges)
Deprecated.Use either Graph or Q constructor- Parameters:
nodes
-edges
-
-
StronglyConnectedComponents
public StronglyConnectedComponents(com.ensoftcorp.atlas.core.query.Q q)
-
-
Method Detail
-
findSCCs
public java.util.List<com.ensoftcorp.atlas.core.db.set.AtlasHashSet<com.ensoftcorp.atlas.core.db.graph.Node>> findSCCs()
Returns the graph's strongly-connected-components in the graph.- Returns:
-
findSCCs
public java.util.List<com.ensoftcorp.atlas.core.db.set.AtlasHashSet<com.ensoftcorp.atlas.core.db.graph.Node>> findSCCs(boolean includeSingleElementSCCs)
Returns the graph's strongly-connected-components in the graph.- Parameters:
includeSingleElementSCCs
- If true includes SCCs that consist of a single node- Returns:
-
roots
public java.util.List<com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node>> roots()
Returns the graph's roots, which may be single nodes or else root SCCs.- Returns:
-
forwardDFSIterator
public java.util.Iterator<com.ensoftcorp.atlas.core.db.graph.Node> forwardDFSIterator()
Returns an iterator which iterates over the elements of this graph in a forward DFS order, after having identified SCCs and converted the graph to a DAG.- Returns:
-
reverseDFSIterator
public java.util.Iterator<com.ensoftcorp.atlas.core.db.graph.Node> reverseDFSIterator()
Returns an iterator which iterates over the elements of this graph in a forward DFS order, after having identified SCCs and converted the graph to a DAG.- Returns:
-
getGraph
public com.ensoftcorp.atlas.core.db.graph.Graph getGraph()
-
getNodes
public com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Node> getNodes()
-
getEdges
public com.ensoftcorp.atlas.core.db.set.AtlasSet<com.ensoftcorp.atlas.core.db.graph.Edge> getEdges()
-
-