Package org.graphstream.algorithm
Class APSP.APSPInfo
java.lang.Object
org.graphstream.algorithm.APSP.APSPInfo
- Enclosing class:
- APSP
public static class APSP.APSPInfo extends Object
Information stored on each node of the graph giving the length of the
shortest paths toward each other node.
-
Field Summary
Fields Modifier and Type Field Description static String
ATTRIBUTE_NAME
double
maxLength
Maximum number of hops to attain another node in the graph from the "from" node.double
minLength
Minimum number of hops to attain another node in the graph from the "from" node.org.graphstream.graph.Node
source
The start node name.HashMap<String,APSP.TargetPath>
targets
Shortest paths toward all other accessible nodes. -
Constructor Summary
-
Method Summary
Modifier and Type Method Description double
getLengthTo(String other)
Minimum distance between this node and another.double
getMaximumLength()
The maximum distance between this node and another.double
getMinimumLength()
The minimum distance between this node and another.String
getNodeId()
The node represented by this APSP information.org.graphstream.graph.Path
getShortestPathTo(String other)
void
setLengthTo(APSP.APSPInfo other, double length, APSP.APSPInfo passBy)
Add or change the length between this node and another and update the minimum and maximum lengths seen so far.
-
Field Details
-
ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
source
public org.graphstream.graph.Node sourceThe start node name. This information is stored inside this node. -
maxLength
public double maxLengthMaximum number of hops to attain another node in the graph from the "from" node. XXX this is the maximum value seen during compute not the maximum shortest path XXX -
minLength
public double minLengthMinimum number of hops to attain another node in the graph from the "from" node. XXX this is the minimum value seen during compute not the minimum shortest path XXX -
targets
Shortest paths toward all other accessible nodes.
-
-
Constructor Details
-
APSPInfo
Create the new information and put in it all the paths between this node and all its direct neighbours.- Parameters:
node
- The node to start from.weightAttributeName
- The key used to retrieve the weight attributes of edges. This attribute but store a value that inherit Number.directed
- If false, the edge orientation is not taken into account.
-
-
Method Details
-
getNodeId
The node represented by this APSP information.- Returns:
- A node identifier.
-
getLengthTo
Minimum distance between this node and another. This returns -1 if there is no path stored yet between these two nodes.- Parameters:
other
- The other node identifier.- Returns:
- The distance or -1 if no path is stored yet between the two nodes.
-
getMinimumLength
public double getMinimumLength()The minimum distance between this node and another. XXX this is the minimum value seen during compute not the minimum shortest path XXX- Returns:
- A distance.
-
getMaximumLength
public double getMaximumLength()The maximum distance between this node and another. XXX this is the maximum value seen during compute not the maximum shortest path XXX- Returns:
- A distance.
-
setLengthTo
Add or change the length between this node and another and update the minimum and maximum lengths seen so far.- Parameters:
other
- The other node APSP info.length
- The new minimum path lengths between these nodes.
-
getShortestPathTo
-