Skip to content

Instantly share code, notes, and snippets.

@jamii
Created October 27, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jamii/4107eb8dce3b90f55fff to your computer and use it in GitHub Desktop.
Save jamii/4107eb8dce3b90f55fff to your computer and use it in GitHub Desktop.
safe path from ?a to ?c
+
edge from ?a to ?c
+
edge from ?a to ?b
! ?b is dangerous
safe path from ?b to ?c
# cannot be rewritten as:
safe path from ?a to ?c
+
edge from ?a to ?c
+
edge from ?a to ?b
safe path from ?b to ?c
-
?b is dangerous # where does ?b come from?
# this is also incorrect - only finds nodes where every path is safe
safe path from ?a to ?c
+
edge from ?a to ?c
+
edge from ?a to ?b
safe path from ?b to ?c
-
edge from ?a to ?b
safe path from ?b to ?c
?b is dangerous
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment