• Performs a breadth-first search traversal on a graph.

    Type Parameters

    • TGraph extends default<Attributes, Attributes, Attributes>

      The type of the graph.

    • R

      The return type of the visitor function.

    Parameters

    • params: {
          fn: GraphRecursorVisitor<TGraph, R>;
          graph: TGraph;
          nodes: string | string[] | Set<string>;
          opts?: TraversalOptions;
      }

      The parameters for the breadth-first search.

      • fn: GraphRecursorVisitor<TGraph, R>

        The visitor function to be called for each visited node.

      • graph: TGraph

        The graph to traverse.

      • nodes: string | string[] | Set<string>

        The starting nodes for the traversal.

      • Optional opts?: TraversalOptions

        The options for the traversal.

    Returns R | undefined

    The result of the visitor function or undefined.

Generated using TypeDoc