MCPcopy Create free account
hub / github.com/douchuan/algorithm / Topological

Class Topological

src/graph/directed/sort.rs:14–16  ·  view source on GitHub ↗

The Topological represents a data type for determining a topological order of a directed acyclic graph (DAG). A digraph has a topological order if and only if it is a DAG. The has_order operation determines whether the digraph has a topological order, and if so, the order operation returns one. This implementation uses depth-first search.

Source from the content-addressed store, hash-verified

12/// returns one.
13/// This implementation uses depth-first search.
14pub struct Topological {
15 order: Option<Vec<usize>>,
16}
17
18impl Topological {
19 /// Does the digraph have a topological order?

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected