Educational implementation of the max flow algorithm in Python