Strand.Alg (strand v0.6.0)

Graph algorithms.

Link to this section Summary

Functions

Return the topological order of a graph according to Kahn's algorithm: https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm

Link to this section Functions

Link to this function

sort_topo(digraph)

Return the topological order of a graph according to Kahn's algorithm: https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm

Examples

iex> require Strand.Alg, as: Alg
iex> g = %{a: [], b: [:a], c: [:d, :a], d: [:a, :b]}
iex> Alg.sort_topo(g)
[:a, :b, :d, :c]