↧
Answer by Andrew Dalke for Shortest distance algorithm Python
This looks like it works. It keeps track of a current set of movies. For each step, it looks at all of the one-step-away movies which haven't already been considered ("seen").actor_info = { "act1" :...
View ArticleAnswer by zubinmehta for Shortest distance algorithm Python
Firstly create one graph out of this to connect all the nodes and then run the shortest_path code(There could be an efficient graph library to do this instead of the function mentioned below,...
View ArticleShortest distance algorithm Python
I wanted to create a simple breadth first search algorithm, which returns the shortest path.An actor information dictionary maps and actor to the list of movies the actor appears in:actor_info = {...
View Article
More Pages to Explore .....