Class Network<V>

java.lang.Object
org.drip.graph.core.Network<V>
Direct Known Subclasses:
Directed, Tree

public abstract class Network<V>
extends java.lang.Object
Network implements a Generic Topological Network containing Discrete Vertexes and Edges. 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
  • Method Summary

    Modifier and Type Method Description
    boolean addBidirectionalEdge​(Edge edge)
    Add a Bidirectional Edge to the Network
    boolean addBidirectionalEdge​(Edge edge, java.util.Map<java.lang.String,​V> vertexValueMap)
    Add a Bidirectional Edge to the Network
    boolean addEdge​(Edge edge)
    Add an Edge to the Network
    boolean addEdge​(Edge edge, java.util.Map<java.lang.String,​V> vertexValueMap)
    Add an Edge to the Network
    boolean addVertex​(java.lang.String vertexName)
    Add a Vertex to the Network
    boolean addVertex​(java.lang.String vertexName, V vertexValue)
    Add a Vertex to the Network
    boolean containsEdge​(Edge edgeOther)
    Indicate if the Specified Edge matches with any Edges in the Network
    boolean containsVertex​(java.lang.String vertexName)
    Indicate if the Vertex is Contained in the Network
    int edgeCount()
    Retrieve the Count of the Edges
    java.util.Map<java.lang.String,​Edge> edgeMap()
    Retrieve the Edge Map
    PriorityQueue<java.lang.Double,​java.lang.String> edgePriorityQueue​(boolean minHeap)
    Construct an Edge Priority Queue
    java.lang.String initialVertexName()
    Retrieve the Initial Vertex Name
    boolean isEdgeACycle​(Edge edge)
    Indicate if the Edge forms a Cycle with the Network
    boolean isEmpty()
    Indicate if the Network is Empty
    double length()
    Retrieve the Length of the Discrete Object
    boolean removeEdge​(java.lang.String edgeKey)
    Remove an Edge from the Network
    int vertexCount()
    Retrieve the Count of the Vertexes
    java.util.Map<java.lang.String,​Vertex<?>> vertexMap()
    Retrieve the Vertex Map
    java.util.Set<java.lang.String> vertexNameSet()
    Retrieve the Set of Vertex Names
    V vertexValue​(java.lang.String vertexName)
    Retrieve the Value contained in the Vertex

    Methods inherited from class java.lang.Object

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

    • vertexMap

      public java.util.Map<java.lang.String,​Vertex<?>> vertexMap()
      Retrieve the Vertex Map
      Returns:
      The Vertex Map
    • edgeMap

      public java.util.Map<java.lang.String,​Edge> edgeMap()
      Retrieve the Edge Map
      Returns:
      The Edge Map
    • initialVertexName

      public java.lang.String initialVertexName()
      Retrieve the Initial Vertex Name
      Returns:
      The Initial Vertex Name
    • edgeCount

      public int edgeCount()
      Retrieve the Count of the Edges
      Returns:
      The Count of the Edges
    • vertexCount

      public int vertexCount()
      Retrieve the Count of the Vertexes
      Returns:
      The Count of the Vertexes
    • vertexNameSet

      public java.util.Set<java.lang.String> vertexNameSet()
      Retrieve the Set of Vertex Names
      Returns:
      The Set of Vertex Names
    • vertexValue

      public V vertexValue​(java.lang.String vertexName)
      Retrieve the Value contained in the Vertex
      Parameters:
      vertexName - Vertex Name
      Returns:
      Value contained in the Vertex
    • addVertex

      public boolean addVertex​(java.lang.String vertexName)
      Add a Vertex to the Network
      Parameters:
      vertexName - The Vertex Name
      Returns:
      TRUE - The Vertex successfully added to the Network
    • addVertex

      public boolean addVertex​(java.lang.String vertexName, V vertexValue)
      Add a Vertex to the Network
      Parameters:
      vertexName - The Vertex Name
      vertexValue - The Vertex Value
      Returns:
      TRUE - The Vertex successfully added to the Network
    • addEdge

      public boolean addEdge​(Edge edge)
      Add an Edge to the Network
      Parameters:
      edge - The Edge
      Returns:
      TRUE - The Edge successfully added
    • addEdge

      public boolean addEdge​(Edge edge, java.util.Map<java.lang.String,​V> vertexValueMap)
      Add an Edge to the Network
      Parameters:
      edge - The Edge
      vertexValueMap - Vertex Value Map
      Returns:
      TRUE - The Edge successfully added
    • addBidirectionalEdge

      public boolean addBidirectionalEdge​(Edge edge)
      Add a Bidirectional Edge to the Network
      Parameters:
      edge - The Bidirectional Edge
      Returns:
      TRUE - The Bidirectional Edge successfully added
    • addBidirectionalEdge

      public boolean addBidirectionalEdge​(Edge edge, java.util.Map<java.lang.String,​V> vertexValueMap)
      Add a Bidirectional Edge to the Network
      Parameters:
      edge - The Bidirectional Edge
      vertexValueMap - Vertex Value Map
      Returns:
      TRUE - The Bidirectional Edge successfully added
    • removeEdge

      public boolean removeEdge​(java.lang.String edgeKey)
      Remove an Edge from the Network
      Parameters:
      edgeKey - The Edge Key
      Returns:
      TRUE - The Edge successfully removed
    • edgePriorityQueue

      public PriorityQueue<java.lang.Double,​java.lang.String> edgePriorityQueue​(boolean minHeap)
      Construct an Edge Priority Queue
      Parameters:
      minHeap - TRUE - The Priority Queue is in the Ascending Order of Weight
      Returns:
      The Edge Priority Queue
    • isEmpty

      public boolean isEmpty()
      Indicate if the Network is Empty
      Returns:
      TRUE - The Network is Empty
    • containsVertex

      public boolean containsVertex​(java.lang.String vertexName)
      Indicate if the Vertex is Contained in the Network
      Parameters:
      vertexName - The Vertex Name
      Returns:
      TRUE - The Vertex is Contained in the Network
    • length

      public double length()
      Retrieve the Length of the Discrete Object
      Returns:
      Length of the Discrete Object
    • isEdgeACycle

      public boolean isEdgeACycle​(Edge edge)
      Indicate if the Edge forms a Cycle with the Network
      Parameters:
      edge - The Edge
      Returns:
      TRUE - The Edge forms a Cycle with the Network
    • containsEdge

      public boolean containsEdge​(Edge edgeOther)
      Indicate if the Specified Edge matches with any Edges in the Network
      Parameters:
      edgeOther - The "Other" Edge
      Returns:
      TRUE - The Specified Edge matches with any Edges in the Network