yog/components

Types

pub type TarjanState {
  TarjanState(
    index: Int,
    stack: List(Int),
    on_stack: dict.Dict(Int, Bool),
    indices: dict.Dict(Int, Int),
    low_links: dict.Dict(Int, Int),
    components: List(List(Int)),
  )
}

Constructors

  • TarjanState(
      index: Int,
      stack: List(Int),
      on_stack: dict.Dict(Int, Bool),
      indices: dict.Dict(Int, Int),
      low_links: dict.Dict(Int, Int),
      components: List(List(Int)),
    )

Values

pub fn strongly_connected_components(
  graph: model.Graph(n, e),
) -> List(List(Int))

Finds Strongly Connected Components (SCC) using Tarjan’s Algorithm. Returns a list of components, where each component is a list of NodeIds.

Search Document