Skip to content

Instantly share code, notes, and snippets.

@lukegrecki
Last active November 23, 2017 00:03
Show Gist options
  • Save lukegrecki/2f6bcef0213185d7c2e7a6a032c98c2f to your computer and use it in GitHub Desktop.
Save lukegrecki/2f6bcef0213185d7c2e7a6a032c98c2f to your computer and use it in GitHub Desktop.
Determine if adding a new node would be a valid extension given a dictionary of dependencies
def is_valid_extension(visited_nodes, new_node, dependencies):
if dependencies.get(new_node) and dependencies.get(new_node) not in visited_nodes:
return False
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment