commit ae06cb361b07ed024d38e8bf8ec37809c2c42dc2 Author: josch Date: Tue Jul 3 20:45:41 2012 +0200 initial commit diff --git a/cycles.py b/cycles.py new file mode 100644 index 0000000..721eb2e --- /dev/null +++ b/cycles.py @@ -0,0 +1,107 @@ +""" +R. Tarjan, Enumeration of the elementary circuits of a directed graph, SIAM Journal on Computing, 2 (1973), pp. 211-216 + +procedure circuit_enumeration; + begin + procedure BACKTRACK(integer value v, logical result f); + begin + logical g; + f := false; + place v on point stack; + mark(v) := true; + place v on marked stack; + for w in A(v) do + if w