Question

Exercise 2 Given the following graph: a. Write the formal description of the graph, G=(V,E) b. Show the Adjacency Matrix repr

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

According to HomeworkLib policy we answer first Four Sub parts., but I answer 5 for u.

a) In a Graph if there is a Weighted edge between vertexes a and vertex b then Put weight value of a to b in adjacency Matrix otherwise we take php6NLR1F.png in the adjacency matrix

b) Adjacency Matrix: In a Graph if there is a direct edge between vertexes a and vertex b then Put weight value of a to b in adjacency Matrix otherwise we take php6NLR1F.png in the adjacency matrix

Adjacency Matrix Representation of given Weighted graph is as follows

a

b

c

d

e

f

g

h

a

0

2

3

phpbmBnNE.png

phpsLDFAh.png

phphN0Lip.png

php6NLR1F.png

phpOKtNSF.png

b

2

0

phpNhN7Co.png

2

php1w7sgI.png

phpoa9yW3.png

phpF36ktm.png

phpN16DpI.png

c

3

0

1

phpSYfa9I.png

php1JD6bR.png

phpKQXjk3.png

phpjBdXxb.png

d

phpJJ1q5g.png

2

1

0

2

4

phpuU1ITE.png

phpCKjlCi.png

e

phpZVhKm8.png

phpq8EPCD.png

phpejZJNY.png

2

0

1

2

f

phpv3bBSv.png

phpBsjGrC.png

php7Dge74.png

4

1

0

2

1

g

php0sVvy6.png

phpIlqyx6.png

phphE7i4H.png

phpE7aXAs.png

2

2

0

3

h

phpXyZ16Y.png

phpAg8NtD.png

phpWInADy.png

phpCaSSQF.png

1

3

0

c) Adjacency List Representation:

els」十H_ 十 e」十 」 十」。 十 |← ←回← ←回 [ 十 ]十 个 。 十z]T]Tzjg]十回 []]十me」十 |zle」十几le十回 e Tz]」十。

d) Dijkstra’s shortest-path algorithm to compute the shortest path from “a” to all other vertices of a graph is as follows

Step D(d) P(d) D(e) Ple) D(f) P(f) D(g) P(8) D(h) P(h) Dla) P(a) D(b) P(b) D(c) P(c) 2,a(min) 3,a 2, a 3,a 2,a 1 | 88 4(2+2),

Step 0: Initially we take a as a minimum Weight and highlight that value

Step 1: In this we consider the minimum weight other than Vertex a that is at Vertex b we have minimum weight so highlight that value

Step 2: In this we consider the minimum weight other than Vertex a & b that is at Vertex c we have minimum weight so highlight that value

Step 3: In this we consider the minimum weight other than Vertex a,b & c that is at Vertex d we have minimum weight so highlight that value

Step 4: In this we consider the minimum weight other than Vertex a,b,c & d that is at Vertex e we have minimum weight so highlight that value

Step 5: In this we consider the minimum weight other than Vertex a,b,c,d & e that is at Vertex f we have minimum weight so highlight that value

Step 6: In this we consider the minimum weight other than Vertex a,b,c,d,e & f that is at Vertex g we have minimum weight so highlight that value

Step 7: In this we consider the minimum weight other than Vertex a,b,c,d,e,f & g that is at Vertex h we have minimum weight so highlight that value

The shortest path tree from the above routing table.

هج

h) Kruskal’s Algorithm to find the Minimum Cost Spanning Tree (MCST) of a graph G as follows:

Here consider those edges in each step which are minimum and doesnot form Loops

Step 1:                                                                 

phpfvpZz2.png

Step 2:                                               

مسن

Step 3:

phpRim15w.png

Step 4:                                                                 

php2CaI1z.png

Step 5:                                               

phpQOnwkr.png

Step 6:

phpz4g2uc.png

Step 7:   

php8mfOUh.png

For n- Vertices we get (n-1) Edges in MCST. Here in graph having 8 Vertices so we get 7 Edges

Which is Required MCST of a graph

Add a comment
Know the answer?
Add Answer to:
Exercise 2 Given the following graph: a. Write the formal description of the graph, G=(V,E) b....
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