Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6389405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:23:58+00:00 2026-05-25T03:23:58+00:00

Is there a reliable and well-documented Python library with a fast implementation of an

  • 0

Is there a reliable and well-documented Python library with a fast implementation of an algorithm that finds maximum flows and minimum cuts in directed graphs?

pygraph.algorithms.minmax.maximum_flow from python-graph solves the problem but it is painfully slow: finding max-flows and min-cuts in a directed graph with something like 4000 nodes and 11000 edges takes > 1 minute. I am looking for something that is at least an order of magnitude faster.

Bounty: I’m offering a bounty on this question to see if the situation has changed since when this question was asked. Bonus points if you have personal experience with the library you recommend!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:23:58+00:00Added an answer on May 25, 2026 at 3:23 am

    I have used graph-tool for similar tasks.

    Graph-tool is an efficient python module for manipulation and statistical analysis of graphs (a.k.a. networks). They even have superb documentation about max-flow algorithms.

    Currently graph-tool supports given algorithms:

    • Edmonds-Karp – Calculate maximum flow on the graph with the Edmonds-Karp algorithm.
    • Push relabel – Calculate maximum flow on the graph with the push-relabel algorithm.
    • Boykov Kolmogorov – Calculate maximum flow on the graph with the Boykov-Kolmogorov algorithm.

    Example taken from docs: find maxflow using Boykov-Kolmogorov:

    >>> g = gt.load_graph("flow-example.xml.gz") #producing example is in doc
    >>> cap = g.edge_properties["cap"]
    >>> src, tgt = g.vertex(0), g.vertex(1)
    >>> res = gt.boykov_kolmogorov_max_flow(g, src, tgt, cap)
    >>> res.a = cap.a - res.a  # the actual flow
    >>> max_flow = sum(res[e] for e in tgt.in_edges())
    >>> print max_flow
    6.92759897841
    >>> pos = g.vertex_properties["pos"]
    >>> gt.graph_draw(g, pos=pos, pin=True, penwidth=res, output="example-kolmogorov.png")
    

    I executed this example with random directed graph(nodes=4000, vertices = 23964), all process took just 11seconds.

    alternative libraries:

    • igraph – mainly implemented in C, but has Python and R interface
    • Linked topic “Python packages for graph theory”
    • or other selected graph tools in Sage wiki.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any reliable and simple priority queue (linked list preferred, not necessary) implementation
Is there a reliable way to JSON.stringify a JavaScript object that guarantees that the
Is there any framework or platform that is providing message exchange in reliable, flexible,
Is there a reliable equivalent of xkill for Windows? For those who don't know
Is there a reliable way of detecting what version of Java is installed on
Is there a reliable way to determine where a user is coming from in
Is there a reliable way to access the client machine's clipboard using Javascript? I
Is there a reliable way to know what executable has called my executable? I
I'm trying to find if there is a reliable way (using SQLite ) to
Is there a standard or reliable method already out there for a javascript framework

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.