neversaint,
I noticed you asked a graph
question the other day too. If they are related, then perhaps it might be useful for you to explain the bigger picture. There are a few
monks I lean on heavily whenever I have a graph question. Using
Graph or some other high level abstraction model is usually faster for the programmer to write - but can end up being
terribly slow runtime.
If you only wanted the shortest path between the two end points (assuming cyclical path avoidance), I would go with modified Bidirectional search which I discovered in A Better Word Morph Builder. To find all paths I might go with a self-pruning Depth-first search. This is still a brute force search but you pay attention to which paths are invalid and do not descend into them when reaching the node from a different path.
If you need example code beyond the explanation above, let me know but it won't happen until tonight.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.