Will not be able to merge edges anymore, or at most merge only edges with the same cost per flow. So we should store in g[u] pairs (v, cost, capacity) instead of just (v, capacity).
Probably should run a SPFA/Bellman-Ford and then usa Dijkstra (same way as in Johnson's algorithm) so that we don't have to use SPFA/Bellman-Ford every iteration.
Will not be able to merge edges anymore, or at most merge only edges with the same cost per flow. So we should store in g[u] pairs (v, cost, capacity) instead of just (v, capacity).
Probably should run a SPFA/Bellman-Ford and then usa Dijkstra (same way as in Johnson's algorithm) so that we don't have to use SPFA/Bellman-Ford every iteration.
https://cp-algorithms.com/graph/min_cost_flow.html