refactoring "new Cost" into "minimumCost(topo, demand, cb)