Question: Use Python 3 to find the Shortest bath between two nodes (the start node and end node should be selected by the user) given a

Use Python 3 to find the Shortest bath between two nodes (the start node and end node should be selected by the user) given a array of adjacency lists using Dynamic programming.

Where

index 0 is node i index 1 is node j index 2 is the weight of the edge between node i and j.

Example

Node_adjacency_List = [

[1 ,2 ,2.669279]

[1 ,12 ,2.445226]

[2, 1, 2.669279]

[2, 3, 4.183270]

[2 ,13 ,4.123552]

[3, 2, 4.183270]

[3, 4, 5.702186]

[3, 14, 6.003664]

[4, 3, 5.702186]

[4 ,5 ,6.922902]

[4 ,15, 7.663811]

]

note: Code as if the number of nodes could be very large

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!