|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.graph.analysis.Analysis
ptolemy.graph.analysis.SingleSourceLongestPathAnalysis
public class SingleSourceLongestPathAnalysis
An analysis to find the longest path from a single source to all the other nodes in a directed graph. In a graph with multiple edges between two nodes the one with the largest associated value is being considered for the longest path.
Red (ssb) |
Red (shahrooz) |
Constructor Summary | |
---|---|
SingleSourceLongestPathAnalysis(Graph graph,
Node startNode,
ToDoubleMapping edgeLengths)
Construct an instance of this class with a default analyzer. |
|
SingleSourceLongestPathAnalysis(SingleSourceLongestPathAnalyzer analyzer)
Construct an instance of this class with a given analyzer. |
Method Summary | |
---|---|
double[] |
distance()
Return the distance from the node "startNode" to all the other nodes in the graph. |
Node |
getStartNode()
Return the single source-node (start node) of this analyzer. |
java.util.List |
path(Node endNode)
Return the longest path from node "startNode" to node "endNode" in the form of an ordered list. |
double |
pathLength(Node endNode)
Return the length of the longest path from node "startNode" to node "endNode". |
void |
setStartNode(Node startNode)
Set the start-node of this analysis to the given node. |
java.lang.String |
toString()
Return a description of the analysis and the associated analyzer. |
boolean |
validAnalyzerInterface(Analyzer analyzer)
Check if a given analyzer is compatible with this analysis. |
Methods inherited from class ptolemy.graph.analysis.Analysis |
---|
analyzer, changeAnalyzer, graph, valid |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SingleSourceLongestPathAnalysis(Graph graph, Node startNode, ToDoubleMapping edgeLengths)
graph
- The given graph.startNode
- The node from which the longest path is going to be
calculated.edgeLengths
- The lengths of the edges of the given graph, which
are going to be used to calculated the longest path.public SingleSourceLongestPathAnalysis(SingleSourceLongestPathAnalyzer analyzer)
analyzer
- The given analyzer.Method Detail |
---|
public double[] distance()
Graph.nodeLabel(ptolemy.graph.Node)
public Node getStartNode()
setStartNode(Node)
public java.util.List path(Node endNode)
endNode
- The ending node of the path.
public double pathLength(Node endNode)
setStartNode(ptolemy.graph.Node)
.
endNode
- The ending node of the path.
public void setStartNode(Node startNode)
startNode
- The given node.getStartNode()
public java.lang.String toString()
toString
in class Analysis
public boolean validAnalyzerInterface(Analyzer analyzer)
validAnalyzerInterface
in class Analysis
analyzer
- The given analyzer.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |