Subject: | edges() missing on undirected multiedged graph |
Date: | Tue, 06 Oct 2015 19:03:56 +1100 |
To: | bug-Graph [...] rt.cpan.org |
From: | Kevin Ryde <user42_kevin [...] yahoo.com.au> |
With Graph.pm 0.96 and recent debian i386 perl 5.20.2, if a graph is
undirected and multiedged then sometimes the ->edges() method does not
return all edges of the graph. For example
use strict;
use Graph;
my $graph = Graph->new(undirected => 1, multiedged => 1);
$graph->add_vertex(0);
$graph->add_vertex(1);
$graph->add_edge(1,0);
print "$graph\n";
my @edges = $graph->edges;
print "edges array length ", scalar(@edges), "\n";
prints
0=1
edges array length 0
where I expected it to be "edges array length 0", which is the 0=1 edge
in the $graph print.
In case it helps, if add_edge(1,0) is changed to add_edge(0,1) then it's
ok ... whatever that could mean.