toy-lib
Safe HaskellNone
LanguageHaskell2010

Data.Graph.Generic

Contents

Description

Generic graph search.

Synopsis

Graph search

genericComponentsOf :: Int -> (Vertex -> Vector Vertex) -> Vector Vertex -> Vector Vertex #

\(O(V+E)\) DFS that paints connnected components starting from a vertex.

runPersistentDfs :: (HasCallStack, Monad m, Unbox w) => (Vertex -> Vector (Vertex, w)) -> Vertex -> a -> (HasCallStack => a -> Vertex -> Vertex -> w -> m a) -> m () #

Vistor-based DFS for query processing with persistent data structure with minimum garbage collectin. Be sure to not make a bi-directed graph.

Typical problems