Quick Overview

Given an undirected graph as a node count and an edge list, compute the fewest edge relocations needed to make every node reachable from every other, or report that it is impossible. It tests reasoning about connected components and redundant edges, and efficient graph processing on up to 100,000 nodes.

Fewest Edge Relocations to Make an Undirected Graph Connected

Company: Amazon

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Overview: Given an undirected graph as a node count and an edge list, compute the fewest edge relocations needed to make every node reachable from every other, or report that it is impossible. It tests reasoning about connected components and redundant edges, and efficient graph processing on up to 100,000 nodes.

Loading…