Please hear me for I am in much need of your wisdom...
Nearing the anniversary of this (Golf) post, I find myself faced with a similar, "bacon number" type problem.
I have a MySQL database of collected factoids (nodes), each identified by a unique integer. Intersecting factoids (vertices) are identified in graph coordinate fashion. So, if fact1id='1' and fact2id='2', the intersection between them is identified as (1,2).
After hours of searching the web, a good deal of thought and much fiddling with code, I am left wondering about a few things... (Please read more for questions.)
Firstly, since the data is not recorded in the database in similar form to the Bacon/Golf post mentioned above, I am wondering if the form
%t =(22 =>[7, 40, 19, 24, 21, 33], ... 40 =>[18, 33, 23, 37, 22, 48, 26, 45], ... 23 =>[25, 46, 27, 40], ... 27 =>[46, 2, 28, 16, 23, 47] ... );
Secondly, though I am quite sure the Perl golf examples are well done, I have a hard time following them let alone coaxing out the results I would hope to get. Does anyone have or know where I can find a more fleshed out example of a shortest path/breadth first search (with "bacon number" tracking, perferably) in Perl? The samples I have been looking at are in C or Java--I don't know Java and it's been years and years since I looked at C.
Lastly, and this is the tie-in for all of the above, how would an experienced Perl programmer approach the problem?
Thanks very much in advance for any help!
Edit by tye, adjust links
In reply to Graph traversal--shortest path? by porkpilot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |