I got a directed network graph and need to find all possible paths from node "a" and compare the value of every node along every possible path. If it reaches a node which value is less than the value of a, then it will stop to search the rest of that specific path. For example, in this network, we can get four possible paths:
a,b,e,m
a,c,f,k
a,c,g,h
a,c,g,I
The specific code will depend on what graph framework (if any) you are using to represent the graph. In general, a depth-first search is a recursive algorithm; so if you have a list of sub-nodes for each node (assuming your structure is a tree like the one in the image), you can loop through each node's children and then for each:
a
, recursively check sub-nodesThis is just general guidance; if you can provide a sample of your current code, we can give some more specific direction.