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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T21:26:38+00:00 2026-05-28T21:26:38+00:00

I was given a task to write an algorithm that finds the # of

  • 0

I was given a task to write an algorithm that finds the # of paths from s to t, formed by distinguished vertices.

exemple:
consider directed graph G=(V,E):
enter image description here

in the given exemple the answer is 2, one s,v,t or s,u,v,t and the other s,x,t

I saw the solution to this problem that goes by:
make a flow network Graph G’ as following:
enter image description here

where capacity of arcs of the form (i,i’) = 1 (i is some vertex) and
capacity of arcs of the form (i’,j) = infinity

they say running Edmonds Karp Algorithm on G’ would output the wanted flow.

now i dont seem to catch how does this solve the problem, i mean what if in the first iteration edmonds karp would accidently improve the flow with the path s,u,u’,v,v’,x,x’,t – in this case how would it get fixed?

thanks ahead.

  • 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-28T21:26:39+00:00Added an answer on May 28, 2026 at 9:26 pm

    How the network flow is equivalent with the original problem:

    => if there’s n paths, these will give a flow of n

    <= if there’s a flow of size n, the edges with non-zero flow form n paths, every vertex is used at most once, because the capacity of i->i’ is 1 (and no edges leave i or end at i’)

    don’t get distracted by the infinite capacity given to i->j edges, it may as well be 1 without changing anyting

    For the description of the whole algorithm you should refer to some literature, like this one, but the path you’re writing won’t get selected first because of it’s length. The Edmonds-Karp algorithm starts with shortest paths possible.

    Now, (ignoring this fact), you’re probably confused by the fact that such a path ‘blocks’ two other paths. If such a path (or combination of paths) is selected by previous iterations, there will still be an augmenting path that will use part of the previous path in backward direction (s-x-v’-t in your example).

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

Sidebar

Related Questions

I'm given a task to write an algorithm to compute the maximum two dimensional
I am given task to write a script (or better yet, a daemon), that
I was given a task of write the coding guidelines for my team, and
Simple task: given that an article has many comments, be able to display in
We've been given the task by my customer to export data from a legacy
I'm given a task to write a user authentication and login system in java.
I have been given a task to write a program to automatically create a
I've been given the task to write a plugin for Trac. It should provide
I am grasping Node JS after already knowing Java. Given the task to write
I have to write program that create process using pipe() . My first task

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.