Maximum flow and topological sort algorithms