(a) Find a minimum spanning tree (MST) of the graph G in Figure 1 using Kruskal's...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
(a) Find a minimum spanning tree (MST) of the graph G in Figure 1 using Kruskal's algo- rithm. You only need to write down all the edges considered, in the correct order they are considered, and whether they are added to the MST or not. [3 marks] (b) Starting with the min-heap H in Figure 1, the following operations are applied successively to the heap. Show the contents of the heap (i.e., draw a tree representation of it) after each step. Insert 8; delete minimum; insert 4. [5 marks] (c) You are given a directed graph G where all edge weights are positive. Given two vertices s and t in G, we want to find the "best" path from s to t, where "best" means the primary objective is to minimise the total weight of all edges along the path; if there are multiple paths with the same minimum weight, we prefer the one with the fewest edges. i. Write down the pseudocode of an efficient algorithm for this problem. You only need to compute the total weight and the number of edges of the best path, and need not recover the path itself. [6 marks] ii. Demonstrate how your algorithm works with the graph G in Figure 1. You should show the contents of any data structure used after each step. [6 marks] 2 b 14 9 11 13 G d e 3 H 2 5 Figure 1: G for Q3(a); H for Q3(b); G for Q3(c). 10 12 2 (a) Find a minimum spanning tree (MST) of the graph G in Figure 1 using Kruskal's algo- rithm. You only need to write down all the edges considered, in the correct order they are considered, and whether they are added to the MST or not. [3 marks] (b) Starting with the min-heap H in Figure 1, the following operations are applied successively to the heap. Show the contents of the heap (i.e., draw a tree representation of it) after each step. Insert 8; delete minimum; insert 4. [5 marks] (c) You are given a directed graph G where all edge weights are positive. Given two vertices s and t in G, we want to find the "best" path from s to t, where "best" means the primary objective is to minimise the total weight of all edges along the path; if there are multiple paths with the same minimum weight, we prefer the one with the fewest edges. i. Write down the pseudocode of an efficient algorithm for this problem. You only need to compute the total weight and the number of edges of the best path, and need not recover the path itself. [6 marks] ii. Demonstrate how your algorithm works with the graph G in Figure 1. You should show the contents of any data structure used after each step. [6 marks] 2 b 14 9 11 13 G d e 3 H 2 5 Figure 1: G for Q3(a); H for Q3(b); G for Q3(c). 10 12 2
Expert Answer:
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date:
Students also viewed these programming questions
-
Create an introduction as well as a conclusion for the following below Purpose of motivation in the workplace The concept of motivation has a central position across the field of psychology....
-
particle of mass m & charge & which is moving 1-D harmonie oscillator pat" ge freq. w is subjee to a constant electric field E = Ex Calculate the energ the 7th state corrected to 1st Non zeno...
-
In Problems 5978, solve each equation in the complex number system. x 2 + 25 = 0
-
As the newest member of your company's Budgeting and Forecasting Division, you try to be respectful and helpful to all of your colleagues. When you complimented your supervisor Sarah on her tan, she...
-
Have you ever tried to coach someone? What did you do well, and what mistakes did you make? How can you become a better coach?
-
Discuss the underlying attributes necessary to support high achievers.
-
In the Vista City Hospital of Problem 8, Set 8.1a, suppose that only the bed limits represent flexible goals and that all the goals have equal weights. Can all the goals be met? Problem 8 Vista City...
-
While taking the measurement of a different sphere with a radius of r = 2 . 2 2 cm , your instrument has a measurement uncertainty of \ pm 0 . 0 4 cm . What is the propagated uncertainty of the...
-
Play the following games in the Games Fair: Three Prize Roller Word Scramble Marble Draw Ten Spinner For each Games Fair game, answer the following questions: Create the probability distribution in a...
-
You are evaluating the solvency and liquidity of XYZ Co. in light of the following information: FY 2017 $2000 $4000 Total Debt Total Equity Your MOST LIKELY conclusion is that: a. The company is...
-
Which of the following languages use asynchronous message passing: StateCharts, SDL, VHDL, CSP, Petri nets, or MPI?
-
Describe classes of embedded systems for which protection should definitely be provided! Describe classes of systems, for which we would possibly not need protection!
-
Find processors for which memory protection units are available! How are memory protection units different from the more frequently used memory management units (MMUs)? You may search in the Internet...
-
How is the use of the system stack optimized in ERIKA?
-
Which resource access protocols prevent deadlocks caused by exclusive access to resources?
-
Consider the types of reward systems that motivate you at work? Is financial compensation enough to motivate you to perform well? Why or why not?
-
Fill in each blank so that the resulting statement is true. A solution to a system of linear equations in two variables is an ordered pair that__________ .
-
Let G = (V, E) be a weighted, directed graph with weight function w : E . Give an O(V E)-time algorithm to find, for each vertex V , the value () = min uV {(u, )}.
-
Draw a table showing the order of every element in * 11 . Pick the smallest primitive root g and compute a table giving ind 11.g (x) for all x * 11 .
-
Suppose that we are given a function f . n n and an initial value x 0 n . Define x i = f (x i - 1 ) for i = 1, 2, .... Let t and u > 0 be the smallest values such that x t + i = x t + u + i for...
-
Evaluate the shape factor \(\phi_{B}^{f}\) for strength-limited design in bending of a square box section of outer edge-length \(h=100 \mathrm{~mm}\) and wall thickness \(t=3 \mathrm{~mm}\). Is this...
-
Derive the expression for the shape-efficiency factor \(\phi_{B}^{e}\) for stiffness-limited design for a circular tube with outer radius \(5 t\) and wall thickness \(t\), loaded in bending (Fig....
-
Derive the expression for the shape-efficiency factor \(\phi_{B}^{e}\) for stiffness-limited design for a square box section of wall thickness \(t\), and height and width \(h_{1}=10 t\) bent about...
Study smarter with the SolutionInn App