sorts.topological_sort

Topological Sort.

Attributes

edges

sort

vertices

Functions

topological_sort(→ list[str])

Perform topological sort on a directed acyclic graph.

Module Contents

sorts.topological_sort.topological_sort(start: str, visited: list[str], sort: list[str]) list[str]

Perform topological sort on a directed acyclic graph.

sorts.topological_sort.edges: dict[str, list[str]]
sorts.topological_sort.sort
sorts.topological_sort.vertices: list[str] = ['a', 'b', 'c', 'd', 'e']