Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Tree in perl

by Tux (Canon)
on Nov 18, 2014 at 20:44 UTC ( [id://1107642]=note: print w/replies, xml ) Need Help??


in reply to Tree in perl

Such a shame that Graph is out of support.

use 5.16.2; use warnings; use Graph; my $g = Graph->new; while (<DATA>) { $g->add_edge (m/(\w+)/g); } say join "-" => $g->SP_Dijkstra (1, 5); __END__ 5 6 1 2 2 3 2 4 4 5 1 3 3 5 -> 1-3-5

Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2024-04-19 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found