8) a. By using Kruskal's algorithm find the shortest spanning tree for the following graph:
b. Determine if relation is a tree by drawing the graph and if it is, find the root.
R1 = {(1,2), (1,3), (3, 4), (5,3), (4,5)}
R2 = {(1,8), (5, 1), (7,3), (7,2), (7,4),(4,6),(4,5)
9) a. Let A = {e, f, h}, then write all the permutations of A.
b. Find the algebraic expression of the following given in postfix notation:
2 x * 4-2/8 4-2^4/+
[I have helped with question 8].
8) a. Kruskal's algorithm to find the minimum spanning tree T of a graph G works by adding edges and corresponding vertices to the tree T one by one, following the rules below:
The edges in non-decreasing order of weights are,
AD(1), EG(1), AC(2), GH(2), FG(3), CF(4), DF(4), AB(5), CE(5), BE(6), DH(6), EH(6)
The first 6 edges AD(1), EG(1), AC(2), GH(2), FG(3), CF(4) of least weights do not form any cycles with each other. So, we shall include them in T.
The remaining edges are DF(4), AB(5), CE(5), BE(6), DH(6), EH(6), of which the edge DF of least weight forms a cycle with AC, AD, CF. So, we shall discard this edge. The remaining edges now are AB(5), CE(5), BE(6), DH(6), EH(6), of which the edge AB of least weight does not form any cycles with the edges already in T. So, we shall include it in T.
All the vertices from A to H are now in T, so the procedure stops.
Therefore, the minimum spanning tree is given by the relation
and the graph is
8) b. A tree is a connected acyclic graph. The root of a tree is a vertex such that all edges incedent on it, point away from it.
i. . The graph is
We can see that the edges (3,4),(5,3),(4,5) form a cycle, which is not allowed in a tree.
Therefore, R1 is not a tree.
ii. . The graph is
This graph has no cycles, and no disconnected parts. So, it is a connected acyclic graph, thus, a tree. We can see that only the vertex 7 is such that all edges incident on it are directed away from it. So, 7 is the root.
Therefore, R2 is a tree, with the vertex as the root.
8) a. By using Kruskal's algorithm find the shortest spanning tree for the following graph:
Question 3 Apply Kruskal's algorithm to find Minimum Spanning Tree for the following graph. (In the final exam, you might be asked about Prim's algorithm or both). Weight of edge(1,2) = 10 Weight of edge(2,4)= 5 Weight of edge(6,4)=10 Weight of edge(1,4) = 20 Weight of edge(2,3) = 3 Weight of edge(6,5)= 3 Weight of edge(1,6) = 2 Weight of edge(3,5) = 15 Weight of edge(4,5)= 11
7. MINIMUM WEIGHT SPANNING TREES (a) Use Kruskal's algorithm to find a minimum weight spanning tree. What is the total cost of this spanning tree?(b) The graph below represents the cost in thousands of dollars to connect nearby towns with high speed, fiber optic cable. Use Kruskal's algorithm to find a minimum weight spanning tree. What is the total cost of this spanning tree?
Use Kruskal's algorithm (Algorithm 4.2) to find a minimum spanning tree for the graph in Exercise 2. Show the actions step by step.
The weights of edges in a graph are shown in the table above. Find the minimum cost spanning tree on the graph above using Kruskal's algorithm. What is the total cost of the tree?
2. Use Prim's algorithm to find a minimum spanning tree for the following graph 3. Use Kruskal's algorithm to find a minimum spanning tree for the graph given in question.
Please explain thoroughly: Find the minimum spanning tree of the following graph using either Kruskal's or Prim's algorithm. Show your setup and the first 3 iterations 4. 4 5 4
Using the graph below, create a minimum cost spanning tree using Kruskal's Algorithm and report it's total weight. The Spanning Tree has a total Weight of _______
Use Kruskal's algorithm to find a minimum spanning tree for the graph. Indicate the order in which edges are added to form the tree. In what order were the edges added? (Enter your answer as a comma-separated list of sets.)
6. (6 points) Trace the execution of Kruskal's algorithm to find the Minimum Spanning Tree of the graph shown below. 5 10
7. Illustrate Kruskal's algorithm by giving detailed steps to find the minimum spanning tree for the following graph. You must explain the steps. 10 T,