Adds Topo sort and min cost max flow