{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw7solution

# hw7solution - 4 3 2-1 3 2-3 2 2-4 3 2-4-5 5 2-4-5-6 12.11...

This preview shows pages 1–2. Sign up to view the full content.

12.7 Using Dijkstra’s algorithm, generate a least-cost route to all other nodes for nodes 2 of Figure 12.2. Display the results as in Table 12.2a. M L(1) Path L(3) Path L(4) Path L(5) Path L(6) Path 1 {2} 3 2-1 3 2-3 2 2-4 2 {2, 4} 3 2-1 3 2-3 2 2-4 3 2-4-5 3 {2, 4, 1} 3 2-1 3 2-3 2 2-4 3 2-4-5 4 {2, 4, 1, 3} 3 2-1 3 2-3 2 2-4 3 2-4-5 8 2-3-6 5 {2, 4, 1, 3, 5} 3 2-1 3 2-3 2 2-4 3 2-4-5 5 2-4-5-6 6 {2, 4, 1, 3, 5, 6} 3 2-1 3 2-3 2 2-4 3 2-4-5 5 2-4-5-6 12.8 Repeat Problem 12.7 using the Bellman-Ford algorithm. h L h (1) Path L h (3) Path L h (4) Path L h (5) Path L h (6) Path 0 1 3 2-1 3 2-3 2 2-4 2 3 2-1 3 2-3 2 2-4 3 2-4-5 8 2-3-6 3 3 2-1 3 2-3 2 2-4 3 2-4-5 5 2-4-5-6

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 4 3 2-1 3 2-3 2 2-4 3 2-4-5 5 2-4-5-6 12.11 Will Dijkstra’s algorithm and the Bellman-Ford algorithm always yield the same solutions? Why or why not? If there is a unique least-cost path, the two algorithms will yield the same result because they are both guaranteed to find the least-cost path. If there are two or more equal least-cost paths, the two algorithms may find different least-cost paths, depending on the order in which alternatives are explored....
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

hw7solution - 4 3 2-1 3 2-3 2 2-4 3 2-4-5 5 2-4-5-6 12.11...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online