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 6915531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:29:11+00:00 2026-05-27T09:29:11+00:00

I have an implementation of the preflow push network flow algorithm that returns the

  • 0

I have an implementation of the preflow push network flow algorithm that returns the maximum flow of a flow network. What I need is to identify the set of saturated edges that form the cut in the graph.

In my current implementation, I look for saturated forward edges with empty backward edges in the graph for which the distance from the edge source to the edge target is greater than or equal to one (ie, the source has a greater height than the target). In case there is only one possible set of edges in the graph that satisfies the min cut, the algorithm works ok, but if the algorithm can find more than one cut in the graph then it returns all the saturated edges in the graph. I have copied my code below. Any help is highly appreciated.

public Set<Edge> cutEdges(){
    for (String v_name : vertices.keySet()){
        int v_id = vertices.get(v_name);
        ArrayList<Edge> veList = residual_edges.get(v_id);
        for (Edge ve : veList){
            boolean reverseFound = false;
            EdgeData vinfo = (EdgeData) ve.getData();
            if (vinfo.getAvailable() == 0){
                Vertex temp1 = ve.getFirstEndpoint();
                Vertex temp2 = ve.getSecondEndpoint();
                int u_id = (v_id != vertices.get(temp1.getName().toString()) ? 
                        vertices.get(temp2.getName().toString()) : vertices.get(temp1.getName().toString()));
                ArrayList<Edge> ueList = residual_edges.get(u_id);
                for (Edge ue : ueList){
                    EdgeData uinfo = (EdgeData) ue.getData();
                    if (ue.getFirstEndpoint().getName().toString().equals(temp2.getName().toString()) && 
                            ue.getSecondEndpoint().getName().toString().equals(temp1.getName().toString())){                            
                        if (((VertexData)ue.getFirstEndpoint().getData()).getPreflowHeight() - 
                                ((VertexData)ue.getSecondEndpoint().getData()).getPreflowHeight() >= 1){
                            if (uinfo.getFlow() == 0)
                            continue;
                        }
                        reverseFound = true;
                        break;
                    }
                }
                if (!reverseFound){
                    if (((VertexData)temp1.getData()).getPreflowHeight() - 
                            ((VertexData)temp2.getData()).getPreflowHeight() >= 1)
                        cut_edges.add(ve);
                }
            }
        }
    }
    return cut_edges;
}
  • 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-27T09:29:12+00:00Added an answer on May 27, 2026 at 9:29 am

    I’ll copy my answer from the question How can I find the minimum cut on a graph using a maximum flow algorithm?:

    From the source vertex, do a depth-first search along edges that still
    have residual capacity (i.e., non-saturated edges). The cut consists
    of all edges that were “seen” (i.e., are incident on a visited
    vertex), but were not traversed since they are saturated. As you
    noted, there might be other saturated edges that are not part of the
    minimum cut.

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

Sidebar

Related Questions

I have C implementation of an algorithm that includes shared library. The performance of
I know that it's OK for a pure virtual function to have an implementation.
I have written 2 implementation of bubble sort algorithm in C and Haskell. Haskell
I have an implementation of an interface, and that interface extends IDisposable . In
Note:I don't mean some theoretical question which don't have any implementation just languages that
I have an implementation of Faceebook connect and I have noticed that if you
I have an implementation like that: public interface IGenericRepository { //... void Update<T>(T entity,
I have multiple classes that have similar implementation for different named methods: class MyClassX
I want to recognize uppercase letters using objective-c. I have an implementation now that
I have an implementation of javax.servlet.http.HttpSessionListener that is supposed to detect user session invalidation/timeout

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.