Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Finding connected components in a graph.

by SuicideJunkie (Vicar)
on Oct 02, 2012 at 18:32 UTC ( #996892=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Finding connected components in a graph.
in thread Finding connected components in a graph.

Yes. The subgraph is an array reference. Dig in! foreach my element (@{ $subgraphs[0] }) {...}

As expected, the last index in your two element array is 1. The other index is 0. As I wrote, you want to print 0+@subgraphs, or more explicitly, scalar(@subgraphs).


Comment on Re^3: Finding connected components in a graph.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2015-08-01 02:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls