That naturally means an upper bound for the length of the DNA, nobody expects a string reaching to the moon. Making the problem much easier to handle with a weighted graph, if he was able to express his task!
Theoretically speaking:
IMHO a really good solution would imply to analyze and (de)compose combinations of graphs. eg:
Subgraph X \ / 0 - N4 - a - b - N4 - *
all paths from 0 to * will be P(0->a) x P(a->b) x P(b->*), i.e.
combinations of paths thru N4 times paths from a to b thru Subgraph X times N4.¹
As already sketched a BFS should be able to handle your "short-circuit problem" by assigning a simple distance degree to each vertex at a first phase. No big memory problem...
Cheers Rolf
1) IMHO it's not unlikely that DNA-snippets could be clustered in different groups...
In reply to Re^5: Short Circuiting DFS Graph Traversal
by LanX
in thread Short Circuiting DFS Graph Traversal
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |