Quiz6_sol

# Quiz6_sol - Step 1 put a into S S ={a and then update L L(a...

This preview shows page 1. Sign up to view the full content.

Name:__________________________________________________ UFID:____________________________ 1 COT 3100 Spring 2010 Quiz 6 . 1. (5 pts) An undirected graph has vertices of degree 4, 3, 3, 2, 2. How many edges does it have? Please draw such a graph. By using the handshaking theorem, we know that the number of edges is (4+3+3+2+2)/2 = 7. The graph is shown below. 2. (5 pts) Use Dijkstra’s Algorithm to find the length of the shortest path between the vertices a and e in the given weighted graph. Please show each step used in the algorithm. Initial: L(a) = 0, L(b) = infinity, L(c) = infinity, L(d) = infinity, L(e) = infinity, S = empty
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Step 1: put a into S, S = {a}, and then update L L(a) = 0, L(b) = 4, L(c) = 1, L(d) = infinity, L(e) = infinity Step 2: put c into S, S = {a, c}, and then update L L(a) = 0, L(b) = 3, L(c) = 1, L(d) = 3, L(e) = infinity Step3: put b into S, S = {a, c, b}, and then update L L(a) = 0, L(b) = 3, L(c) = 1, L(d) = 3, L(e) = 6 Step4: put d into S, S = {a, c, b, d}, and then update L L(a) = 0, L(b) = 3, L(c) = 1, L(d) = 3, L(e) = 5 Step5: put e into S, S = {a, c, b, d, e}. Thus the length of the shortest path between a and e is 5....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online