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

Re^2: How do I use Graph::Traversal?

by melmoth (Acolyte)
on Aug 08, 2016 at 00:57 UTC ( [id://1169319]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    {v1 => $vertex1, v2 => $vertex2, rna => $rna, state => 1 }
    
    ...
    }
    
    # Output the edges of the graph with weights for each vertex
    
  2. or download this
    # traverse the graph using DFS 
    my $t = Graph::Traversal::DFS->new($g);
    my @v = $t->preorder;
    print qq[Preorder:\n];
    print qq[$_\t] foreach @v;
    
  3. or download this
    @v = $t->postorder;
    print qq[Postorder:\n];
    print qq[$_\t] foreach @v;
    
  4. or download this
    my @r = $t->roots;
    print qq[Roots:\n];
    print qq[$_\t] foreach @r;
    

Log In?
Username:
Password:

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

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

    No recent polls found