|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javanetworkanalyzer.alg.GraphSearchAlgorithm<V,E>
V - VerticesE - Edgespublic abstract class GraphSearchAlgorithm<V extends VPred,E extends EdgeSPT>
Root class for graph search algorithms, including BFS, DFS, Dijkstra, etc., and their modified versions for centrality and connectedness calculations.
| Field Summary | |
|---|---|
protected V |
currentStartNode
Current start node |
protected org.jgrapht.Graph<V,E> |
graph
The graph on which to calculate shortest paths. |
| Constructor Summary | |
|---|---|
GraphSearchAlgorithm(org.jgrapht.Graph<V,E> graph)
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
init(V startNode)
Performs any initializations to be done at the start of the TraversalAlg.calculate(V) method. |
int |
outdegree(V node)
Returns the outdegree (or degree for undirected graphs) of the given node. |
static Set |
outgoingEdgesOf(org.jgrapht.Graph g,
Object node)
|
Set<E> |
outgoingEdgesOf(V node)
Returns the outgoing edges of a node for directed graphs and all edges of a node for undirected graphs. |
TraversalGraph<V,E> |
reconstructTraversalGraph()
Returns the SPT (BFS/Dijkstra) or traversal graph (DFS) from the last start node TraversalAlg.calculate(V) was called on. |
List<V> |
successorListOf(V node)
Returns the successor list of a node for directed graphs or the neighbor list of a node for undirected graphs. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.javanetworkanalyzer.alg.TraversalAlg |
|---|
calculate |
| Field Detail |
|---|
protected final org.jgrapht.Graph<V extends VPred,E extends EdgeSPT> graph
protected V extends VPred currentStartNode
| Constructor Detail |
|---|
public GraphSearchAlgorithm(org.jgrapht.Graph<V,E> graph)
graph - The graph| Method Detail |
|---|
protected void init(V startNode)
TraversalAlg.calculate(V) method.
startNode - Start nodepublic TraversalGraph<V,E> reconstructTraversalGraph()
TraversalAlgTraversalAlg.calculate(V) was called on. For BFS/Dijkstra, the
shortest path "tree" we return may contain multiple shortest paths.
reconstructTraversalGraph in interface TraversalAlg<V extends VPred,E extends EdgeSPT>TraversalAlg.calculate(V)
was called onpublic Set<E> outgoingEdgesOf(V node)
node - The node.
public static Set outgoingEdgesOf(org.jgrapht.Graph g,
Object node)
public List<V> successorListOf(V node)
node - The node.
public int outdegree(V node)
node - The node.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||