The max-flow algorithm finds the maximum flow through a graph given edge capacities. However, if there is an option between flowing through two edges, it will typically just leverage one of those edges fully and ignore the other. One can influence which of the edges should be preferred by using "min_cost_max_flow" and setting the costs of the preferable edges lower. However, this still makes some edges preferable compared with others. What if I want the flow to be evenly distributed among edges in such a situation? Here is a toy example. We can see that max flow leverages vertex-1 and flows 4 units through it. However, it could just as easily have sent 2 units through vertex-1 and 2 units through vertex-2. How can I make it do this? To make this concrete, we can say that the variance of flow across the edges should be minimized (with flowing the max volume possible being the first goal of course).
Note: I've posted a similar question on CS stackexchange: https://stackoverflow.com/questions/64635070/max-flow-modify-networkx-source-code-so-a-few-edges-dont-hog-all-the-flow. There, I'm not looking for the optimal solution in terms of variance, but any change to the source code (with toy code sample provided) that will make the flow less concentrated on the vertex in question in the toy example.