BitGraph.Dfs (bitgraph v0.1.10)

Depth-first search. Implementation roughly follows https://cp-algorithms.com/graph/depth-first-search.html

Summary

Functions

acyclic?(state)

order(state, atom, order)

parent(dfs_state, vertex)

parents(dfs_state)

run(graph, opts \\ [])

Options:

  • vertices - list of vertex indices (not vertex ids!) or :all (default)
  • state - initial state
  • direction - direction of edges connected to current vertex
    • :forward - out-edges
    • :reverse - in-edges
    • :both - all edges
  • process_vertex_fun callback for processing vertices
  • process_edge_fun - callback for processing edges
  • edge_process_order - whether the (dfs tree) edge processing will be made
    - before (:preorder, default)
    - after (:postorder)
    - before and after (:both)
  • neighbor_finder - the function to find neighbors of given vertex (defaults to BitGraph.E.default_neighbor_finder/0). Check BitGraphTest.NeighborFinder for examples of usage.

time_in(dfs_state, vertex)

time_ins(dfs_state)

time_out(dfs_state, vertex)

time_outs(dfs_state)

vertex_color(state, vertex)