New answers tagged directed-acyclic-graph
-1
Using Kahn's algorithm, we can easily keep track of unvisited vertices at each step for the node at topological order $k\in[1..n]$. Using backtracking we can effectively accomplish this.
The worst case is a graph with no edges. In this case there are $n!$ topological orderings, and given that each contains $n$ nodes we are already at $n*n!$ output size ...
Top 50 recent answers are included
Related Tags
directed-acyclic-graph × 89graph-theory × 45
graph-algorithms × 41
ds.algorithms × 27
topological-sorting × 13
partial-order × 12
cc.complexity-theory × 11
np-hardness × 11
reference-request × 10
ds.data-structures × 7
shortest-path × 6
time-complexity × 4
sorting × 4
co.combinatorics × 3
graph-isomorphism × 3
treewidth × 3
order-theory × 3
circuit-complexity × 2
boolean-functions × 2
dc.distributed-comp × 2
topology × 2
transitive-closure × 2
approximation-algorithms × 1
automata-theory × 1
machine-learning × 1