pmneila / PyMaxflow

Python library for creating flow networks and computing the maxflow/mincut (aka graph-cuts for Python)
http://pmneila.github.io/PyMaxflow/
242 stars 59 forks source link

Unidirectional Edge #42

Closed tkhan1994 closed 4 years ago

tkhan1994 commented 4 years ago

Hi, I was wondering if it is possible to add a unidirectional edge between two nodes using the add_edge method?

Thanks

pmneila commented 4 years ago

Hi,

Yes. Just set the capacity to 0:

g.add_edge(nodes[0], nodes[1], 1, 0)