Question

1. Use the following graph for the questions. Show all the steps (a) Draw the adjacency matrix and the adjacency list (b) Using the Depth First Search algorithm learned in class, topologically sort the graph. 4 t5 64 (c) Use Dijstras algorithm to determine the shortest path from node s to all other nodes. (d) Use Bellman-Fords algorithm to determine the shortest path from node s to all other nodes.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. (a) Adjacency matrix :

s t u v w y

s 0 2 1 6

t 0 3

u 0

v 0 4 4

w 5 4 0 2

y 3 0

Adjacency List:

s -> t -> v -> w -> /

t -> u -> /

u -> /

v -> w -> y -> /

w -> t -> u -> y -> /

y -> s -> /

"/" indicates null pointer

Add a comment
Know the answer?
Add Answer to:
1. Use the following graph for the questions. Show all the steps (a) Draw the adjacency...
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