Class: Turbine::Traversal::BreadthFirst

Inherits:
Base
  • Object
show all
Defined in:
lib/turbine/traversal/breadth_first.rb

Overview

Traverses the graph breadth-first, following each item to its adjacent items.

      A
     / \
    B   C
   /   / \
  D   E   F
 /   /
G   H

In the above graph, using a breadth-first algorithm, starting from A, the nodes are traversed in the order B -> C -> D -> E -> F -> G -> H.

Method Summary

Methods inherited from Base

#initialize, #inspect, #next, #to_enum

Constructor Details

This class inherits a constructor from Turbine::Traversal::Base