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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:35:54+00:00 2026-05-30T22:35:54+00:00

So it seems that determining whether an edge is in a minimum spanning tree

  • 0

So it seems that determining whether an edge is in a minimum spanning tree can be reduced down to the question of whether the edge is the heaviest edge of some cycle. I know how to detect whether an edge is in a cycle, using DFS, but how to determine whether it’s the heaviest edge in that cycle? Is it by just finding the cycle and picking the heaviest edge in it?

  • 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-30T22:35:56+00:00Added an answer on May 30, 2026 at 10:35 pm

    Assuming that all the edges have distinct weights, a simple and fairly elegant algorithm for doing this would be to do a modified DFS. Notice that if this edge is the heaviest edge in some cycle, then if you were to look at the graph formed by deleting all edges heavier than the current edge, there must be some path from the endpoint of the edge back to the start of the edge, because this path, combined with the edge itself, forms a cycle with the given edge being the heaviest such edge. Conversely, if there is no cycle containing the edge for which the given edge is the heaviest, then if you were to do a search in this graph from the end of the edge back to the source, you wouldn’t be able to get back to the source of the edge, since otherwise you could complete it into a cycle. This gives the following simple algorithm: do a DFS in the original graph from the endpoint of the edge back to the source, but whenever you encounter an edge that is heavier than the original edge, don’t process it (this simulates deleting it from the graph). If your DFS takes you from the end of the edge back to the source, then you know that there must be some cycle for which the edge is the heaviest edge, and if there is no such cycle then you won’t be able to get back to the source of the edge.

    In the case where the edges aren’t distinct, you would do the same search as above, but you would delete all edges whose weight was greater than or equal to the weight of the current edge. The reason for this is that if there is a path from the end of the edge to the start of the edge in this transformed graph, you know for a fact that we didn’t end up using any edges that have the same cost as the original edge, so any path found can be completed into a cycle where the given edge is the heaviest. If there is no path, then either

    1. Every cycle containing the given edge has some edge that’s strictly heavier than it, or
    2. Every cycle containing the given edge has some edge that has the same cost as it.

    In either case, it’s not the heaviest edge in the cycle.

    The runtime of this algorithm is O(m + n), the time required to do a standard DFS.

    Hope this helps!

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

Sidebar

Related Questions

It seems that anyone can snoop on incoming/outgoing .NET web service SOAP messages just
It seems that in some cases, if you end up with nested modalPopups wrapped
I would appreciate some feedback regarding the use of $(this)[0].defaultValue for determining whether a
It seems that this question gets asked frequently , but I am not coming
Seems that requirements on safety do not seem to like systems that use AI
Seems that even after unchecking the option in the PyDev/Debug preferenecs pane to launch
It seems that a List object cannot be stored in a List variable in
It seems that it is impossible to capture the keyboard event normally used for
It seems that Silverlight/WPF are the long term future for user interface development with
It seems that most of the installers for Perl are centered around installing Perl

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.