{v1 => $vertex1, v2 => $vertex2, rna => $rna, state => 1 }
# build a directed graph with this data, vertices have a weight ( score )
my $g = Graph->new();
for my $edge ( @E )
{
my %weights = map { $_->{dna} => $_->{score} } @{$RNA_SEQ{$edge->{rna}}->{alignments}};
$g->add_weighted_vertices( $edge->{v1}, $weights{$edge->{v1}}, $edge->{v2}, $weights{$edge->{v2}});
$g->add_edge ( $edge->{v1}, $edge->{v2} );
}
# Print out the graph to see what it looks like
foreach ( @E )
{
my $w1 = $g->get_vertex_weight($_->{v1});
my $w2 = $g->get_vertex_weight($_->{v2});
print qq[$_->{v1} --> $_->{v2}\t$w1 $w2\n];
}
# Output the edges of the graph with weights for each vertex
####
# 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;
##
##
@v = $t->postorder;
print qq[Postorder:\n];
print qq[$_\t] foreach @v;
##
##
my @r = $t->roots;
print qq[Roots:\n];
print qq[$_\t] foreach @r;