Class DFSTraversal<V>

java.lang.Object
org.episteme.core.mathematics.discrete.graph.DFSTraversal<V>
All Implemented Interfaces:
GraphTraversalStrategy<V>

public class DFSTraversal<V> extends Object implements GraphTraversalStrategy<V>
Depth-First Search (DFS) traversal strategy.

Explores as far as possible along each branch before backtracking. Uses CPU-based recursive implementation.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • DFSTraversal

      public DFSTraversal()
  • Method Details

    • traverse

      public void traverse(Graph<V> graph, V start, VertexVisitor<V> visitor)
      Description copied from interface: GraphTraversalStrategy
      Traverses the graph starting from the given vertex.

      The implementation chooses the appropriate backend automatically (CPU or GPU) based on graph size and backend availability.

      Specified by:
      traverse in interface GraphTraversalStrategy<V>
      Parameters:
      graph - the graph to traverse
      start - the starting vertex
      visitor - the visitor to call for each vertex