Question

8) a. By using Kruskal's algorithm find the shortest spanning tree for the following graph:



8) a. By using Kruskal's algorithm find the shortest spanning tree for the following graph: 

image.png

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/+ 

0 0
Add a comment Improve this question Transcribed image text
Answer #1

[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:

  1. Arrange the edges in non-decreasing order of weights.
  2. Take the edge of smallest weight that is not already in T.
  3. If it makes a cycle with the edges already in T, discard it. Otherwise, include it in the tree, along with its corresponding vertices.
  4. Continue steps 2,3 till all vertices of G are in T

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.

Add a comment
Know the answer?
Add Answer to:
8) a. By using Kruskal's algorithm find the shortest spanning tree for the following graph:
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT