This would include both a maximum flow algorithm and a minimum cost flow algorithm. See https://cp-algorithms.com/graph/Assignment-problem-min-flow.html and https://developers.google.com/optimization/flow/maxflow for a references