First steps for implementing topological sort of multigraph - experimental and buggy