Skip Menu |

This queue is for tickets about the Graph CPAN distribution.

Report information
The Basics
Id: 19603
Status: resolved
Priority: 0/
Queue: Graph

People
Owner: Nobody in particular
Requestors: osborne1 [...] optonline.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Issue...
Date: Tue, 30 May 2006 12:57:48 -0400
To: bug-Graph [...] rt.cpan.org
From: Brian Osborne <osborne1 [...] optonline.net>
Jarrko, I stumbled across something while playing with articulation_points. If you pass a defined and an undefined variable to add_edges it can have nasty consequences for articulation_points(); #!/usr/bin/perl -w use strict; use Graph; use Digest::MD5; my $g = Graph::Undirected->new(refvertexed => 1); my $temp; for (my $x = 1 ; $x < 1000 ; $x++) { my $n1 = Digest::MD5->new(); my $n2 = Digest::MD5->new(); $g->add_vertices($n1,$n2); $g->add_edges($n1,$n2); $g->add_edges($n2,$temp); # if defined $temp; $temp = $n2; } my @rts = $g->articulation_points; Change: $g->add_edges($n2,$temp); # if defined $temp; To: $g->add_edges($n2,$temp) if defined $temp; And everything's fine. Should add_edges() be complaining about being passed an undefined variable? BIO
Subject: Re: [rt.cpan.org #19603] Issue...
Date: Tue, 30 May 2006 20:56:18 +0300
To: bug-Graph [...] rt.cpan.org
From: Jarkko Hietaniemi <jhi [...] iki.fi>
osborne1@optonline.net via RT wrote: Show quoted text
> Tue May 30 12:58:58 2006: Request 19603 was acted upon. > Transaction: Ticket created by osborne1@optonline.net > Queue: Graph > Subject: Issue... > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: osborne1@optonline.net > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=19603 > > > > Jarrko, > > I stumbled across something while playing with articulation_points. If you > pass a defined and an undefined variable to add_edges it can have nasty > consequences for articulation_points(); > > #!/usr/bin/perl -w > > use strict; > use Graph; > use Digest::MD5; > > my $g = Graph::Undirected->new(refvertexed => 1); > my $temp; > > for (my $x = 1 ; $x < 1000 ; $x++) { > my $n1 = Digest::MD5->new(); > my $n2 = Digest::MD5->new(); > $g->add_vertices($n1,$n2); > $g->add_edges($n1,$n2); > $g->add_edges($n2,$temp); # if defined $temp; > $temp = $n2; > } > > my @rts = $g->articulation_points; > > Change: > > $g->add_edges($n2,$temp); # if defined $temp; > > To: > > $g->add_edges($n2,$temp) if defined $temp; > > And everything's fine. Should add_edges() be complaining about being passed > an undefined variable?
Good point. Trying to use undefs as vertices just leads into all kinds of nastiness.
Resolved in 0.75.