Learn Algorithm Design by Building a Shortest Path Algorithm - Step 15

Tell us what’s happening:

Describe your issue in detail here.

Your code so far


# User Editable Region

my_graph = {
    'A':(3,1),

# User Editable Region

    'B': ['A', 'C'],
    'C': ['B', 'D'],
    'D': ['A', 'C']
}

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36

Challenge Information:

Learn Algorithm Design by Building a Shortest Path Algorithm - Step 15

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

my_graph['A'] should be a list of tuples, not a tuple. It should contain 2 tuples, each of them with two items:
the first item in the tuple is the string representing the node and the second item should be integer number representing the distance.

This worked for me
—solution removed—

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

Additionally, if a thread has been dormant for months that person is likely already past that step and you don’t need to respond anymore

1 Like