(i) Find the Shortest Paths Tree (SPT) in G starting with source vertex s using Dijkstra’s algorithm. Show the main steps of the algorithm. Note that the graph has a negative weight edge. Does Dijkstra’s algorithm still find the correct shortest paths? (ii) Find the Shortest Paths Tree (SPT) in G starting with source vertex s using Bellman-Ford’s algorithm. Show the main steps of the algorithm. (iii) Suppose we want to the shortest path distances between all pairs of nodes such that the shortest paths use intermediate vertices only from the set {a, b, g}. Use the Floyd-Warshall algorithm to compute these distances between all pairs of nodes.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

ID - 1542553

Problem 2
Consider the graph from Problem 1 (Figure 1).
The goal is to find single source shortest paths (in particular, the Shortest Paths Tree) starting from source node s (see Weights and Source Node in picture).

(i) Find the Shortest Paths Tree (SPT) in G starting with source vertex s using Dijkstra’s algorithm. Show the main steps of the algorithm. Note that the graph has a negative weight edge. Does Dijkstra’s algorithm still find the correct shortest
paths?

(ii) Find the Shortest Paths Tree (SPT) in G starting with source vertex s using Bellman-Ford’s algorithm. Show the main steps of the algorithm.

(iii) Suppose we want to the shortest path distances between all pairs of nodes such that the shortest paths use intermediate vertices only from the set {a, b, g}. Use the Floyd-Warshall algorithm to compute these distances between all pairs of nodes.

W1
a
W2
w6
w7
6.
-1
4
W3
W5
e
W4
Figure 1: Weighted, undirected graph G.
Weights and Source Node
All problems use weights wi through w7. To determine these weights, look at your 7
digit ID. The weight wi corresponds to the first digit of your ID, the weight w2
corresponds to the second digit of your ID, and so on.
For problems 2 and 4, we use a source node or starting node s, determined as
follows: find the digit in your ID that has the highest value. If it is the first digit then s =
a, if it is the second digit, then s = b, and so on. If there is more than one digit with the
same highest value, choose the first occurrence of that digit. For example, if your ID is
4526767, then the highest value is 7, and you choose the first 7, i.e., digit 5, and set s =
е.
Transcribed Image Text:W1 a W2 w6 w7 6. -1 4 W3 W5 e W4 Figure 1: Weighted, undirected graph G. Weights and Source Node All problems use weights wi through w7. To determine these weights, look at your 7 digit ID. The weight wi corresponds to the first digit of your ID, the weight w2 corresponds to the second digit of your ID, and so on. For problems 2 and 4, we use a source node or starting node s, determined as follows: find the digit in your ID that has the highest value. If it is the first digit then s = a, if it is the second digit, then s = b, and so on. If there is more than one digit with the same highest value, choose the first occurrence of that digit. For example, if your ID is 4526767, then the highest value is 7, and you choose the first 7, i.e., digit 5, and set s = е.
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY