slightly better definitions for cython in topological sort and some algorithm for partial sorting (that should be converted to cmpiled code