Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: traversing a hash looking for path?

by Herkum (Parson)
on Apr 11, 2006 at 20:28 UTC ( #542665=note: print w/replies, xml ) Need Help??


in reply to traversing a hash looking for path?

I was somewhat excited to see a module that did something neat when the two previous posters mentioned Graph but after looking at it and the extensive documentation and no tutorials I thought this was too much...

The method I was thinking of is a hash of a hash; the key of the hash is all the IP's and the values are a hash with with your linked IP's.

my %network = ( '1.2.3.4' => {'1.2.3.5' => undef, '1.2.3.6' => undef, '1.2.3.7' => undef }, '1.2.3.5' => {'1.2.3.4' => undef, '1.2.3.6' => undef, '1.2.3.7' => undef }, '1.2.3.6' => {'1.2.3.4' => undef, '1.2.3.5' => undef, '1.2.3.7' => undef }, '1.2.3.7' => {'1.2.3.4' => undef, '1.2.3.5' => undef, '1.2.3.6' => undef }, );

Replies are listed 'Best First'.
Re^2: traversing a hash looking for path?
by Anonymous Monk on Apr 11, 2006 at 21:05 UTC
    I've been looking at the documentation and I agree. I can easily create a hash of hashes with my info, and then I suppose I hand it off to graph and look for has_edge providing my start and end node?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2022-01-25 15:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (66 votes). Check out past polls.

    Notices?