hgeometry-combinatorial-0.9.0.0: Data structures, and Data types.

Safe HaskellNone
LanguageHaskell2010

Algorithms.Graph.DFS

Synopsis

Documentation

dfs :: forall s w v e f. PlanarGraph s w v e f -> VertexId s w -> Tree (VertexId s w) Source #

DFS on a planar graph.

Running time: \(O(n)\)

Note that since our planar graphs are always connected there is no need need for dfs to take a list of start vertices.

type AdjacencyLists s w = Vector [VertexId s w] Source #

Adjacency list representation of a graph: for each vertex we simply list all connected neighbours.

adjacencyLists :: PlanarGraph s w v e f -> AdjacencyLists s w Source #

Transform into adjacencylist representation

dfs' :: forall s w. AdjacencyLists s w -> VertexId s w -> Tree (VertexId s w) Source #

DFS, from a given vertex, on a graph in AdjacencyLists representation.

Running time: \(O(n)\)