In problem 316C2, the solution is to find Max Flow Min Cost of the constructed graph.
Skimming through some fastest submissions, I noticed that there is a function called modify_label that replaced SPFA to find shortest path in normal MFMC. Here is one of those submisions.
And this modify_label only cost $$$O(|V| + |E|)$$$ complexity, result in small overall complexity. I think this has some relation with Johnson's algorithm.
Please someone explained it to me how this function works and how this is applicable with this problem. Thanks :<.