max_flow = sum(res[e] for e in tgt.in_edges())
print(max_flow)
pos = g.vertex_properties['pos']
gt.graph_draw(g, pos=pos, pin=True, penwidth=res, output=
    'example-kolmogorov.png')
Fast max-flow min-cut library for Python