The Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree interview question asks you to analyze the edges of a weighted undirected graph. A critical edge is one that, if removed, would increase the weight of the Minimum Spanning Tree (MST). A pseudo-critical edge is an edge that can be part of some MST, but not necessarily all MSTs. You need to return two lists: one containing the indices of all critical edges and another for pseudo-critical edges.
This "Hard" difficulty problem is used by Google, Amazon, and Uber to test a candidate's advanced graph algorithm knowledge. It evaluation your mastery of Kruskal's Algorithm or Prim's Algorithm and your ability to reason about MST properties. It requires you to think about how individual edges affect the global optimization goal, which is a key skill in network design and infrastructure planning.
This problem relies on MST construction using Union Find.
Graph: 3 nodes, 3 edges: (0-1, wt 1), (1-2, wt 1), (0-2, wt 1).
Any two edges form an MST of weight 2.
MST problems are almost always solved with Kruskal's + Union Find. To optimize, remember that Kruskal's is very fast once the edges are sorted. The core of this problem is the "Include/Exclude" logic applied to Kruskal's.
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| Checking Existence of Edge Length Limited Paths II | Hard | Solve | |
| Optimize Water Distribution in a Village | Hard | Solve | |
| Connecting Cities With Minimum Cost | Medium | Solve | |
| Min Cost to Connect All Points | Medium | Solve | |
| Minimize Maximum Component Cost | Medium | Solve |