Last active
March 18, 2018 18:09
-
-
Save ricbit/de75d46145b16b28ec164b9da21ca9a4 to your computer and use it in GitHub Desktop.
Count paths using brute force
This file contains 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
count[graph_, pos_, 0] := 1 | |
count[graph_, pos_, size_] := Sum[ | |
If[graph[[i, pos]] == 1, count[graph, i, size - 1], 0], | |
{i, 1, Length[graph]}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment