Idris2Doc : Data.Graph.Indexed.Query.BFS

Data.Graph.Indexed.Query.BFS

(source)

Definitions

limitedBfsWith : IGraphken->List (Fink) -> (s->Fink->Eithersa) ->s->Fink->Maybea
  Traverses the graph in breadth-first order for the given
start nodes and accumulates the nodes encountered with the
given function.

Unlike `bfsWith`, this takes a list of nodes that are taboo, that is
that will already be set to `visited`. This allows us exclude certain
pathways from our search.

One use case is to find the shortest cycle containing a given
edge or sequence of edges.

Totality: total
Visibility: export
bfsWith : IGraphken-> (s->Fink->Eithersa) ->s->Fink->Maybea
  Traverses the graph in breadth-first order for the given
start nodes and accumulates the nodes encountered with the
given function.

Totality: total
Visibility: export
limitedBfs : IGraphken->List (Fink) ->Fink->Fink->Maybe (SnocList (Fink))
  Tries to find a shortest path between the two nodes.

Totality: total
Visibility: export
bfs : IGraphken->Fink->Fink->Maybe (SnocList (Fink))
  Tries to find a shortest path between the two nodes.

Totality: total
Visibility: export
bfsAllWith : IGraphken-> (s->Fink->s) ->s->Fink->Lists
  Traverses the graph in breadth-first order for the given
start nodes and accumulates the nodes encountered with the
given function.

Totality: total
Visibility: export
distancesToNode : IGraphken->Fink->List (Nat, Fink)
Totality: total
Visibility: export
shortestPaths : IGraphken->Fink->List (SnocList (Fink))
  Computes the shortest paths to all nodes reachable from
the given starting node. This is a simplified version of
Dijkstra's algorithm for unweighted edges.

Runs in O(n+m) time and O(n) memory.

Totality: total
Visibility: export