Skip to content
← All questions

What should you do when several candidate edges have the same minimum weight?

When multiple candidate edges share the same minimum weight, you can pick any one of them. The choice does not affect the validity of the greedy step, though it may lead to a different MST if edge weights are not distinct.

Conditions

  • Multiple edges connect the visited set to unvisited nodes.
  • These edges have identical minimum weights.

Reasoning, step by step

  1. Identify all edges crossing from the visited set to unvisited nodes.
  2. Find the minimum weight among these edges.
  3. Select any edge that has this minimum weight.
  4. Add the selected edge and its unvisited endpoint to the MST.

Example

The narrator says, "Three edges all have a weight of three. Pick one of these. I've chosen to add AC."

Common misconceptions

  • Believing that a specific tie-breaking rule (like alphabetical order) is mandatory.
  • Thinking that ties invalidate the algorithm.
  • Assuming that different tie-breaking choices always result in different total weights.

Watch the explanation

Connected concepts

Explore next

Related questions

Meet the concept

↗
Understand why

↗

Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.