Can python-igraph be used for min s-t cut?
Question: Can Python-igraph be used to do min s-t cut?

I want the minimum cost cut that cuts the designated source and sink nodes.

Thanks!


Answer: Yep.

    
    
    from igraph import Graph
    from random import randint
    g = Graph.GRG(100, 0.2)        # generate a geometric random graph
    g.es["capacity"] = [randint(0, 1000) for i in xrange(g.ecount())]
    cut = g.maxflow(0, 99, "capacity")
    

cut.membership then gives you the membership of each vertex (0-1 vector),
cut[0] gives you the vertices on one side of the cut, cut[1] gives the other,
cut.value gives the value of the cut.

[all credit goes to @Tamás]

