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

  • Home
  • SEARCH
  • 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 6678083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:12:03+00:00 2026-05-26T04:12:03+00:00

I am studying the Ford-Fulkerson algorithm from Cormen’s Introduction to algorithms 2nd Edition. It

  • 0

I am studying the Ford-Fulkerson algorithm from Cormen’s “Introduction to algorithms 2nd Edition”. It is described in pseudo code for a directed graph G=(V, E) as follows where f is a flow defined on VxV

FORD-FULKERSON(G, s, t)
    for each edge (u,v) in E(G)
        do f[u, v] = 0
           f[v, u] = 0
    while there is a path p from s to t in the residual network Gf
        do m = min{c(u, v)-f[u, v]: (u, v) is on p}
            for each edge (u, v) on p
                do f[u, v] = f[u, v] + m
                   f[v, u] = - f[u, v]

The residual graph Gf has the same vertices as G and have as edges those ordered pairs of
vertices (u, v) for which c(u, v) – f(u, v) > 0. (Edit: c is a capacity function given when starting and extended to be zero on edges not part of the graph)

I am unsure about what to do in the case when there exists edges in “both directions”, for example what happens in the algorithm when an edge and its reverse is in the graph. I am assuming that the c(u, v) in the minimum is for the original capacities in the graph. Do I somehow need to handle four edges in the residual graph for a case when both (a, b) and (b, a) are edges ? At the moment in my setup I can’t directly handle parallel edges.

I found the following question on SO: Maximum flow – Ford-Fulkerson: Undirected graph
But I am not clear on what the outcome is.

  • 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-26T04:12:04+00:00Added an answer on May 26, 2026 at 4:12 am

    Nowhere in the pseudo-code is there any assumption about whether the graph is cyclic or has “reverse edges”. There are just edges.

    If there are edges in “both directions”, then c(u,v) and c(v,u) will be distinct. c(u,v) is just the capacity of the edge from u to v, while c(v,u) is the capacity of the edge from v to u. They have no more relationship to each other than they do to any other edges.

    Put another way, both c(u,v) and f[u,v] are actually functions on edges, not vertices. (And I think the algorithm would be more clear if it were written that way.) So think of them as c(E) and f[E] where E is an edge. The “residual network” is also a collection of edges, not vertices. The residual network is just all of the edges such that c(E) – f[E] is positive.

    All the algorithm does is to find any path from source to target that still has some spare capacity, and then increase the flow to consume that spare capacity. f[E] is the flow across the edge. So, find any path from s to t where all of the f[E] are less than c(E), take the smallest difference along that path, and increase the flow along that path by that difference. Iterate until there are no paths left with spare capacity.

    If E and E’ happen to be two edges that are the reverse of each other, the algorithm does not care; it treats them as independent edges.

    Understanding what the algorithm does is the easy part. Proving that it converges, proving that it gets the right answer, and analyzing its running time are the hard parts.

    [update]

    Ah, I see; f[u,v] really is the flow from u to v, not the flow along an edge (since there may be two edges connecting u and v in opposite directions).

    I think you can just maintain f[u,v] based on vertices, but the cost graph and residual graph still need to be based on edges. So basically do exactly what the algorithm says: For each edge E = (u,v) on the path, find the minimum of c(u,v)-f[u,v] and update the f[] values accordingly. Then compute a new residual graph based on the edges of the original graph; that is, for each edge E = (u,v), if c(u,v) is greater than f[u,v] then E is a member of the residual graph.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While studying the book Introduction to Algorithms by Cormen, I found a strange thing.
studying some sample code from an iOS programming course (cs193p fall2010) i came across
When studying a snippet of unknown Python code, I occasionally bump into the varName.methodName()
I am studying to use MVVM pattern for my Silverlight application. Following code is
I'm studying simple machine learning algorithms, beginning with a simple gradient descent, but I've
I am new to studying jquery.ajax. Through some tutorials, I tried some code by
I am new to studying jquery.ajax. I want to paste some data from a.php
I'm studying for an exam, and this is a problem from an old test:
Im studying some ruby code and I see this varx variable being used with
While studying how to build a nested table from list elements in CSS, I

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.