Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Excel File: Create a Python program Dijkstra.py to compute Dijkstra's algorithm. You could use Python 2 or Python 3, whichever you prefer. But you need

image text in transcribed

Excel File:

image text in transcribed

Create a Python program "Dijkstra.py" to compute Dijkstra's algorithm. You could use Python 2 or Python 3, whichever you prefer. But you need to let me know which version it is. Instructions: 1. 2. a. Read link state data from "LinkState.csv". In this file, the first row and the first column are the name of the nodes (From A to J). Other cells show the costs between the row node and the column node (hence these two nodes are neighbors). For convenience, number 1000" means infinity, as the two nodes are not neighbors. Your program should be able to print source tree and cost regarding to a node give by user in command line. A sample command line output should like this: b. Please type the node name and click Enter: (User input) Source tree for node A: ACB, ACE, ACF, ACDHGI, ACDHGJ Cost for node A A:0, B:4, C:1, D:4, E:6, F:7, G:8, H:6, I:10, J:9 The computations of shortest path and source tree must be done with Dijkstra's algorithm. (I know there are other shortest path algorithms) Please, please create enough comments for me to understand your code. c. d. Create a Python program "Dijkstra.py" to compute Dijkstra's algorithm. You could use Python 2 or Python 3, whichever you prefer. But you need to let me know which version it is. Instructions: 1. 2. a. Read link state data from "LinkState.csv". In this file, the first row and the first column are the name of the nodes (From A to J). Other cells show the costs between the row node and the column node (hence these two nodes are neighbors). For convenience, number 1000" means infinity, as the two nodes are not neighbors. Your program should be able to print source tree and cost regarding to a node give by user in command line. A sample command line output should like this: b. Please type the node name and click Enter: (User input) Source tree for node A: ACB, ACE, ACF, ACDHGI, ACDHGJ Cost for node A A:0, B:4, C:1, D:4, E:6, F:7, G:8, H:6, I:10, J:9 The computations of shortest path and source tree must be done with Dijkstra's algorithm. (I know there are other shortest path algorithms) Please, please create enough comments for me to understand your code. c. d

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 15th International Conference Dexa 2004 Zaragoza Spain August 30 September 3 2004 Proceedings Lncs 3180

Authors: Fernando Galindo ,Makoto Takizawa ,Roland Traunmuller

2004th Edition

3540229361, 978-3540229360

More Books

Students also viewed these Databases questions