I have a number of graphs that look similar to this: Graph
In this image, there are 4 levels and 4 node per level: Green is level 1, Blue is level 2, Pink is level 3 and Yellow is level 4.
To calculate the paths from node 1 (ana) to node 200 (sara), if the graph is directed, the total number of paths is equal to number of nodes per level ^ number of levels like in this table: Table - Directed
If the graph is undirected, the number of paths grows exponencially but I can't find the relationship between the number of levels and the number of nodes per level to get the ammount of paths. I am using prolog with a recursive dfs algorythm to get these values but, as the values keep increasing, the ammount of time increases as well. Here is a table with all the data I have for the undirected graph: Table - Unidirected