Added min cost max flow implementation