Class R5R9Dijkstra.DijkstraEdge

java.lang.Object
edu.cmu.tetrad.search.utils.R5R9Dijkstra.DijkstraEdge
Enclosing class:
R5R9Dijkstra

public static class R5R9Dijkstra.DijkstraEdge extends Object
Represents a node in Dijkstra's algorithm. The weight of the edge from the start is stored in the distance field and is modified by the algorithm.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DijkstraEdge(Node y, int weight)
    Represents an edge connecting two nodes in Dijkstra's algorithm.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves to-node represented by this DijkstraEdge.
    int
    Retrieves the weight of the edge represented by this DijkstraEdge.
    Returns a string representation of the DijkstraEdge object.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DijkstraEdge

      public DijkstraEdge(Node y, int weight)
      Represents an edge connecting two nodes in Dijkstra's algorithm. The edge has a weight that represents the cost of traversing from one node to another.

      Immutable.

      Parameters:
      y - the to-node.
      weight - the weight of the edge.
  • Method Details

    • getToNode

      public Node getToNode()
      Retrieves to-node represented by this DijkstraEdge.
      Returns:
      the to-node.
    • getWeight

      public int getWeight()
      Retrieves the weight of the edge represented by this DijkstraEdge.
      Returns:
      the weight of the edge
    • toString

      public String toString()
      Returns a string representation of the DijkstraEdge object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the DijkstraEdge object