Question
Give an O( m log n ) algorithm to determine if a given minimum spanning tree is unique. The inputs to your algorithm are n
Give an O(m log n) algorithm to determine if a given minimum spanning tree is unique. The inputs to your algorithm are
- n, the number of vertices in the graph (the vertices are then numbered 0,,n1);
- the set of edges in the graph and their weights, as an adjacency list or adjacency matrix (specify which one you are using);
- a subset T of the edges that forms a minimum spanning tree, using the same data structure as the complete set of edges.
You may assume that 1) if the given T is not the unique minimum spanning tree then there is another minimum spanning tree T' that differs from it by one edge; and 2)you can determine the edge of maximum weight (and its weight) on the simple path between any two vertices using edges in T in O(log n) time. Compute the overall asymptotic running time of your algorithm in terms of n (the number of vertices) and mm (the number of edges) and explain your result. You need not prove that your algorithm is correct.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started