Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Finding a Path

by Ieronim (Friar)
on Jan 24, 2007 at 15:19 UTC ( [id://596264]=note: print w/replies, xml ) Need Help??


in reply to Develop a Tree

Some examples of very optimized pathfinding can be found in the node A Better Word Morph Builder. I think that the general idea for solving your problem is giving each machine an unique number (which is already done if the network map is implemented as you described), buiding a datastructure like
%network_map = ( 12567 => # the machine id [335, 456, 338], # the id's of machines it is directly connected to 335 => [12657, 558, 667, 333] # etc )
and browsing this datastructure with some tree search algorithm. I myself prefer bidirectional search, the working example is given e.q. in this node, but i think that your network is small enough for using the breadth-first search without any significant performance loss.

Sorry for my English :)


     s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://596264]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (1)
As of 2024-04-25 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found