Last active
April 6, 2018 16:03
-
-
Save scott2b/bc6a77dbe938c07f583f255d27b9f485 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for each home destination, find all paths that lead back home and print only | |
# the ones that are a full traversal (i.e. 5 hops) | |
for home in graph.keys(): | |
print("Home: %s" % home) | |
for start in graph.keys(): | |
if (start != home): | |
print([path for path in find_path(graph, start, home) if len(path) == 5]) | |
print("---") | |
print("=====") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment