Class DepthFirst

java.lang.Object
org.drip.graph.search.DepthFirst

public class DepthFirst
extends java.lang.Object
DepthFirst implements the Recursive and Iterative Depth-first Search Schemes. The References are:

  • Cormen, T., C. E. Leiserson, R. Rivest, and C. Stein (2009): Introduction to Algorithms 3rd Edition MIT Press
  • de Fraysseix, H., O. de Mendez, and P. Rosenstiehl (2006): Tremaux Trees and Planarity International Journal of Foundations of Computer Science 17 (5) 1017-1030
  • Mehlhorn, K., and P. Sanders (2008): Algorithms and Data Structures: The Basic Tool-box Springer
  • Reif, J. H. (1985): Depth-first Search is inherently Sequential Information Processing Letters 20 (5) 229-234
  • Wikipedia (2020): Depth-first Search https://en.wikipedia.org/wiki/Depth-first_search




Author:
Lakshmi Krishnamurthy
  • Constructor Summary

    Constructors
    Constructor Description
    DepthFirst​(Network<?> network)
    DepthFirst Constructor
  • Method Summary

    Modifier and Type Method Description
    Network<?> network()
    Retrieve the Graph Network
    boolean nonRecursive​(java.lang.String vertexName, OrderedVertexGroup orderedVertexGroup)
    Generate the Vertex Set using a Non-recursive Depth-First Search
    boolean recursive​(java.lang.String vertexName, OrderedVertexGroup orderedVertexGroup)
    Generate the Vertex Set using a Recursive Depth-First Search

    Methods inherited from class java.lang.Object

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

    • DepthFirst

      public DepthFirst​(Network<?> network) throws java.lang.Exception
      DepthFirst Constructor
      Parameters:
      network - Graph Network
      Throws:
      java.lang.Exception - Thrown if the Inputs are Invalid
  • Method Details

    • network

      public Network<?> network()
      Retrieve the Graph Network
      Returns:
      The Graph Network
    • recursive

      public boolean recursive​(java.lang.String vertexName, OrderedVertexGroup orderedVertexGroup)
      Generate the Vertex Set using a Recursive Depth-First Search
      Parameters:
      vertexName - Vertex Name
      orderedVertexGroup - The Ordered Vertex Group
      Returns:
      The Vertex Set using a Recursive Depth-First Search
    • nonRecursive

      public boolean nonRecursive​(java.lang.String vertexName, OrderedVertexGroup orderedVertexGroup)
      Generate the Vertex Set using a Non-recursive Depth-First Search
      Parameters:
      vertexName - Vertex Name
      orderedVertexGroup - The Ordered Vertex Group
      Returns:
      The Vertex Set using a Non-recursive Depth-First Search