alltopsorts_recursion: all topological orderings of a DAG
Description
This function computes all topological orderings of a graph
using the recursive algorithm described in Knuth and Szwarcfiter (1974).
Usage
alltopsorts_recursion(n, adj_list)
Value
Returns a list of topological orderings.
Arguments
n
number of nodes in the DAG
adj_list
edges given as an adjacency list
References
Knuth, D. E. and J. L. Szwarcfiter (1974).
A structured program to generate all topological sorting arrangements.
Information Processing Letters 2(6), 153–157.