# construct graph using max flow algorithm

Given n pair of integer (di, dj), e.g. (0, 2), (1, 1), (1, 0), (1, 0)... Construct a directed graph G = ({1...n}, E) such that in-degree of vertex 1 is di and out-degree is dj. Is it possible to reduce this problem to max flow problem?

In other words, using idea to Ford–Fulkerson to solve this problem.

Thank you!

To figure out whether the given set $$(a_i, b_i)$$ is valid, you can use the sufficiency/necessary conditions from the Fulkerson–Chen–Anstee theorem