Connecting Cities With Minimum Cost
Connect every city with the cheapest set of roads, or report that this cannot be done. Roads are added in cost order, skipping any that would form a loop.
Connect every city with the cheapest set of roads, or report that this cannot be done. Roads are added in cost order, skipping any that would form a loop.