Data Structures and
You are given a weighted undirected graph G = (V,E), where E and V denote set of edges and vertices, and a minimum spanning tree T of that graph G. Answer the following questions about G and T on minimum spanning trees.
(a) Suppose we decrease the weight of one of the edges in G that is not among the edges in T. Suggest an algorithm in plain English that determines whether T is still a minimum spanning tree, and if it is not, calculates a minimum spanning tree of G. Explain the running time of your algorithm. (Note: Your algorithm should be faster than Prim’s and Kruskal’s)
(b) Consider the following algorithm running on G = (V,E). Would it calculate a valid MST of G? If yes, explain your reasoning in plain English, if no, provide a counter example graph that the algorithm will fail producing an MST. Also, what is the running time of the algorithm in the previous question. Show your analysis.
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
- a) write the algorithm b) Briefly explain why the algorithm solves the problem, and the correctness c ) State and briefly explain the running time of your algorithmarrow_forward7. Consider the following graph: A 14 CO D 9 E C 12 10 17 b) What is the weight of the minimum spanning tree? B Apply Kruskal's algorithm to find the minimum spanning tree. Edges are sorted first by length, and in the event of a tie, by name, where the two letters are in alphabetical order. Use makeset (x), find (x), and union (x, y) to determine if there are cycles. a) Circle the edges that are part of the minimum spanning tree. AC, AD, AE, BC, BD, BE, DE c) Draw the tree that results from applying the union-find algorithm for cycle detection. When drawing the tree, put vertices with lower letters in the left subtrees so that all the vertices in a level are sorted alphabetically from left to rightarrow_forwardIn Pythonarrow_forward
- A B. D H Suppose you run the topological sort algorithm on the graph above starting at vertex C. Use the rule that when there is a choice of vertices for the algorithm to visit, it visits them in alphabetic order. Which vertex would end up first in the eventual topologically sorted order? Which would end up being second? Which would end up being third? Which would end up being fourth? Which would end up being fifth? Which would end up being sixth?arrow_forward[Problem 9] Starting at vertex A, run Prim's algorithm on the following graph. You do not need to draw all steps but you must display the final picture of the generated minimum spanning tree and the order of inclusion of edges into the tree, using standard notation (u,v) to represent an edge between hypothetical vertices u and v, in order to receive points. B A 1 2 D 3 Farrow_forwarda) Which edges would you keep for the minimum-weight spanning tree? (Indicate as vertex-vertex — eg. “K-P”... if there were vertices K and P.) b) Describe the algorithm you used to determine the minimum-weight spanning tree above. Did you face any challenges in applying this algorithm?arrow_forward
- c. In graph traversal, Breadth-first Search (BFS) order is "Level order" in the sense that it explores the neighbour nodes first, before moving to the next level neighbours reachable from the source and its distance. A B E 3 5 F G Figure 2 ii) Perform Dijkstra's algorithm starting from node A. In which order does the algorithm visit the nodes, and what is the computed distance to each of them? There are several possible orders to visit the nodes; choose and show one possible path that can be taken.arrow_forward1. Use the graph below to answer the following questions. A B H 10 G 10 25 20 5 50 5 5 30 5 15 C 20 D F 15 E (a) Use Kruskal's Algorithm to produce a minimum spanning tree. Write down the edges that you choose in order of the algorithm. (b) Use Prim's Algorithm to produce a minimum spanning tree (assume A is the root/source). Write down the edges that you choose in order of the algorithm.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY