Class BFSTraversal<V>

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

public class BFSTraversal<V> extends Object implements GraphTraversalStrategy<V>
Breadth-First Search (BFS) traversal strategy.

Explores neighbors level by level before moving to the next depth. Uses CPU-based queue implementation.

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

    • BFSTraversal

      public BFSTraversal()
  • 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