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

    Constructors 
    Constructor Description
    APSPInfo​(org.graphstream.graph.Node node, String weightAttributeName, boolean directed)
    Create the new information and put in it all the paths between this node and all its direct neighbours.
  • 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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ATTRIBUTE_NAME

      public static final String ATTRIBUTE_NAME
      See Also:
      Constant Field Values
    • source

      public org.graphstream.graph.Node source
      The start node name. This information is stored inside this node.
    • maxLength

      public double maxLength
      Maximum 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 minLength
      Minimum 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

      public HashMap<String,​APSP.TargetPath> targets
      Shortest paths toward all other accessible nodes.
  • Constructor Details

    • APSPInfo

      public APSPInfo​(org.graphstream.graph.Node node, String weightAttributeName, boolean directed)
      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

      public String getNodeId()
      The node represented by this APSP information.
      Returns:
      A node identifier.
    • getLengthTo

      public double getLengthTo​(String other)
      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

      public 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.
      Parameters:
      other - The other node APSP info.
      length - The new minimum path lengths between these nodes.
    • getShortestPathTo

      public org.graphstream.graph.Path getShortestPathTo​(String other)