java.lang.Object
omix.util.math.graph.Graph<E,N>
- Type Parameters:
E
- type of the reference edgesN
- type of the reference nodes
public final class Graph<E,N> extends Object
Graph analysis tool.
This class allowes to compute connected components and strongly connected components inside a given graph.
The graph must be specified by adding nodes (
addNode(Object)
) and edges (addEdge(Object, Object, Object)
).
Thereafter, the method analyze()
computes the CCs and SCCs of the graph.- Author:
- Dr. Peter Droste, Omix Visualization
-
Constructor Summary
Constructors Constructor Description Graph()
-
Method Summary
Modifier and Type Method Description void
addEdge(E edge, N srcNode, N dstNode)
Edges can be added by specifying a reference to any kind of external edge connecting two nodes.void
addNode(N node)
Nodes can be added by specifying a reference to any kind of external graph component.List<CC<E,N>>
analyze()
Computation of all CCs and SCCs in the graph.
-
Constructor Details
-
Graph
public Graph()
-
-
Method Details
-
analyze
Computation of all CCs and SCCs in the graph.- Returns:
- List of CCs containing SCCs
-
addNode
Nodes can be added by specifying a reference to any kind of external graph component.- Parameters:
node
-
-
addEdge
Edges can be added by specifying a reference to any kind of external edge connecting two nodes.- Parameters:
edge
- reference to an edge objectsrcNode
- reference to the connected source nodedstNode
- reference to the connected destination node
-