Class Edge

java.lang.Object
org.drip.graph.core.Edge

public class Edge
extends java.lang.Object
Edge represents the Connection between a Pair of Vertexes. The References are:

  • Bollobas, B. (1998): Modern Graph Theory Springer
  • Eppstein, D. (1999): Spanning Trees and Spanners https://www.ics.uci.edu/~eppstein/pubs/Epp-TR-96-16.pdf
  • Gross, J. L., and J. Yellen (2005): Graph Theory and its Applications Springer
  • Kocay, W., and D. L. Kreher (2004): Graphs, Algorithms, and Optimizations CRC Press
  • Wikipedia (2020): Spanning Tree https://en.wikipedia.org/wiki/Spanning_tree




Author:
Lakshmi Krishnamurthy
  • Constructor Summary

    Constructors
    Constructor Description
    Edge​(java.lang.String sourceVertexName, java.lang.String destinationVertexName, double weight)
    Edge Constructor
  • Method Summary

    Modifier and Type Method Description
    boolean compareWith​(Edge edge)
    Compare the Current Edge with the Specified One
    java.lang.String destinationVertexName()
    Retrieve the Destination Vertex Name
    Edge invert()
    Retrieve a new "Inverted" Edge
    java.lang.String sourceVertexName()
    Retrieve the Source Vertex Name
    java.lang.String toString()  
    double weight()
    Retrieve the Weight

    Methods inherited from class java.lang.Object

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

    • Edge

      public Edge​(java.lang.String sourceVertexName, java.lang.String destinationVertexName, double weight) throws java.lang.Exception
      Edge Constructor
      Parameters:
      sourceVertexName - Source Vertex Name
      destinationVertexName - Destination Vertex Name
      weight - Weight
      Throws:
      java.lang.Exception - Thrown if the Inputs are Invalid
  • Method Details

    • sourceVertexName

      public java.lang.String sourceVertexName()
      Retrieve the Source Vertex Name
      Returns:
      The Source Vertex Name
    • destinationVertexName

      public java.lang.String destinationVertexName()
      Retrieve the Destination Vertex Name
      Returns:
      The Destination Vertex Name
    • weight

      public double weight()
      Retrieve the Weight
      Returns:
      The Weight
    • compareWith

      public boolean compareWith​(Edge edge)
      Compare the Current Edge with the Specified One
      Parameters:
      edge - The "Other" Edge
      Returns:
      TRUE - If the Edges are the same
    • invert

      public Edge invert()
      Retrieve a new "Inverted" Edge
      Returns:
      New "Inverted" Edge
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object