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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:08:42+00:00 2026-05-20T00:08:42+00:00

I want to find the next shortest path between 2 vertices in a graph

  • 0

I want to find the next shortest path between 2 vertices in a graph and the path has a positive cost.The next shortest path is allowed to share edges of the shortest path .Which algorithm can I use?

  • 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-20T00:08:43+00:00Added an answer on May 20, 2026 at 12:08 am

    I doubt this is optimal in terms of running time but:

    1. Use Dijkstra’s algorithm on graph G to get path P
    2. For all edges E in path P:
    3. — If G – E is not connected, continue for next edge (go to 2)
    4. — Use Dijkstra’s algorithm on G – E to find path X_i
    5. — If length of current X_i is shorter than all other X_i, save it
    6. The X_i at the end of the for loop is the second shortest path

    The second-shortest path can’t go through all edges in P, but it could go through all but one of them, potentially. I assume by “second-shortest” that you don’t use edges more than once, otherwise the second-shortest path could contain P.

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

Sidebar

Related Questions

I have a small problem where I want to find the next active item
I want to find the next form-element, starting from input-object inside. Find() is a
I have a database, and I want to find out the previous and next
I am new to iPhone. I want to find out the next date from
I want an efficient algorithm to find the next greater permutation of the given
I want to find the next instance of an element at the same level.
I have a number (let's say, 34), and I want to find its next
I want to find difference between two time-components, but I am not getting what
I have the next table: code, year, day I want to find the code
I want to find data with double quotes. I have the next simple query:

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.