Examine the following graph. We will be running Dijkstra's algorithm starting at the node labeled S S 5 1 2 A E F 9. 3 4 6 B C D 2 5 10 5 We're using the version of Dijkstra's algorithm described here in lecture: note that the fringe and distro data structures are always changed at the same time. Give the resulting edgeTo and distão maps after vertex B is visited (i.e. its outgoing edges to C and E have been relaxed). Also give the resulting edgeTo and distro maps after Dijkstra's algorithm has completely finished execution. Initialize the edgeTo for each vertex as - which will represent null for us. Initialize the distro for each vertex as inf which we'll use to represent ∞o, except for S where it should be 0. So, before the first iteration, the values of these variables are: edgeTo = {A, B, C:-, D:-, E:-, F:-, G:-, S:-} distTo = {A: inf, B:inf, C:inf, D:inf, E:inf, F:inf, G:inf, S:0} The maps must be in this order. If you have the same mappings but in a different order (i.e. the mapping for S comes first), Gradescope will say your answer is incorrect. Give edgeTo after B is visited. Format your answer as {A:?, B:?, C:?, D:?, E:?, F:?, G:?, S:-}. | (Hint: the first step of the algorithm is to visit S, which should change the entries for A and B in edgeTo and distTo. The second step is to visit B, which should change the entries for C and E)
Examine the following graph. We will be running Dijkstra's algorithm starting at the node labeled S S 5 1 2 A E F 9. 3 4 6 B C D 2 5 10 5 We're using the version of Dijkstra's algorithm described here in lecture: note that the fringe and distro data structures are always changed at the same time. Give the resulting edgeTo and distão maps after vertex B is visited (i.e. its outgoing edges to C and E have been relaxed). Also give the resulting edgeTo and distro maps after Dijkstra's algorithm has completely finished execution. Initialize the edgeTo for each vertex as - which will represent null for us. Initialize the distro for each vertex as inf which we'll use to represent ∞o, except for S where it should be 0. So, before the first iteration, the values of these variables are: edgeTo = {A, B, C:-, D:-, E:-, F:-, G:-, S:-} distTo = {A: inf, B:inf, C:inf, D:inf, E:inf, F:inf, G:inf, S:0} The maps must be in this order. If you have the same mappings but in a different order (i.e. the mapping for S comes first), Gradescope will say your answer is incorrect. Give edgeTo after B is visited. Format your answer as {A:?, B:?, C:?, D:?, E:?, F:?, G:?, S:-}. | (Hint: the first step of the algorithm is to visit S, which should change the entries for A and B in edgeTo and distTo. The second step is to visit B, which should change the entries for C and E)
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
![Examine the following graph. We will be running Dijkstra's algorithm starting at the node labeled S
S
5
1
2
A
E
F
9.
3
4
6
B
C
D
2
5
10
5
We're using the version of Dijkstra's algorithm described here in lecture: note that the fringe and
distro data structures are always changed at the same time.
Give the resulting edgeTo and distão maps after vertex B is visited (i.e. its outgoing edges to C and
E have been relaxed). Also give the resulting edgeTo and distro maps after Dijkstra's algorithm has
completely finished execution. Initialize the edgeTo for each vertex as - which will represent null
for us. Initialize the distro for each vertex as inf which we'll use to represent ∞o, except for S
where it should be 0.
So, before the first iteration, the values of these variables are:
edgeTo = {A, B, C:-, D:-, E:-, F:-, G:-, S:-}
distTo = {A: inf, B:inf, C:inf, D:inf, E:inf, F:inf, G:inf, S:0}
The maps must be in this order. If you have the same mappings but in a different order (i.e. the
mapping for S comes first), Gradescope will say your answer is incorrect.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1d5e88e6-b1af-4aea-9b08-2dadd85f5e2c%2F5dd756c2-8820-437f-a1df-af57bff6594e%2F8fveth_processed.png&w=3840&q=75)
Transcribed Image Text:Examine the following graph. We will be running Dijkstra's algorithm starting at the node labeled S
S
5
1
2
A
E
F
9.
3
4
6
B
C
D
2
5
10
5
We're using the version of Dijkstra's algorithm described here in lecture: note that the fringe and
distro data structures are always changed at the same time.
Give the resulting edgeTo and distão maps after vertex B is visited (i.e. its outgoing edges to C and
E have been relaxed). Also give the resulting edgeTo and distro maps after Dijkstra's algorithm has
completely finished execution. Initialize the edgeTo for each vertex as - which will represent null
for us. Initialize the distro for each vertex as inf which we'll use to represent ∞o, except for S
where it should be 0.
So, before the first iteration, the values of these variables are:
edgeTo = {A, B, C:-, D:-, E:-, F:-, G:-, S:-}
distTo = {A: inf, B:inf, C:inf, D:inf, E:inf, F:inf, G:inf, S:0}
The maps must be in this order. If you have the same mappings but in a different order (i.e. the
mapping for S comes first), Gradescope will say your answer is incorrect.
![Give edgeTo after B is visited. Format your answer as {A:?, B:?, C:?, D:?, E:?, F:?, G:?, S:-}.
|
(Hint: the first step of the algorithm is to visit S, which should change the entries for A and B in
edgeTo and distTo. The second step is to visit B, which should change the entries for C and E)](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1d5e88e6-b1af-4aea-9b08-2dadd85f5e2c%2F5dd756c2-8820-437f-a1df-af57bff6594e%2F785zsmv_processed.png&w=3840&q=75)
Transcribed Image Text:Give edgeTo after B is visited. Format your answer as {A:?, B:?, C:?, D:?, E:?, F:?, G:?, S:-}.
|
(Hint: the first step of the algorithm is to visit S, which should change the entries for A and B in
edgeTo and distTo. The second step is to visit B, which should change the entries for C and E)
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education