Skip Menu |

This queue is for tickets about the Graph CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: nospam-abuse [...] bloodgate.com
Cc:
AdminCc:

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



Subject: set_edge_attribute_by_id() borken in 0.66
Graph 0.66 breaks Graph::Easy rather badly. My Graph::Easy package has a method that is called connetions() and returns the number of egdes coming in plus going out. For "A-B,C-B" it should return "2" for "B" as it does with Graph 0.65. With 0.66, it will return "3". Breakage ensues. It seems either get_multiedge_ids() or set_edge_attribute_by_id() has changed somehow. Attached is a script to reproduce the symptom. I am adding three vertices to the (multi-edged) graph, with two edges: A => B C => B I also attach an attribute to the edges (as Graph::Easy does, one attribute per vertex and edge containing the pointer to the objects from the Graph::Easy name space). When not commenting out the line to add the attribute, get_multiedge_ids() suddenlty returns "1 0" for "C => B", instead of the expected "0" (there is only one edge with the ID "0" from "C" to "B"). I do think the change from 0.65 to 0.66 is a bug. The problem is probably somewhere in set_edge_attribute_by_id() but after tracking this down for a few hours I am too tired to look further. (It maybe thinks the edge does not yet exist and adds it again). Best wishes, Tels
use Graph; use strict; print "creating graph\n"; my $gr = Graph->new( multiedged => 1 ); my $A = { name => 'A' }; my $B = { name => 'B' }; my $C = { name => 'C' }; print "adding A => B\n"; add_edge ($gr,$A,$B); dumper2($gr); print "adding C => B\n"; add_edge( $gr, $C, $B ); dumper2($gr); sub add_edge { my ($g,$x,$y) = @_; my $edge_id = $g->add_edge_get_id($x->{name}, $y->{name}); # work around bug in Graph v0.65 returning something else instead of '0' # on first call $edge_id = '0' if ref($edge_id); # comment this line out, and the dump changes $g->set_edge_attribute_by_id( $x->{name}, $y->{name}, $edge_id, "OBJ", {}); } sub dumper2 { my @nodes = $gr->vertices(); for my $n (sort @nodes) { print "$n:\n"; print " successors : ", scalar $gr->successors($n),"\n"; print " predecessors : ", scalar $gr->predecessors($n),"\n"; my @suc = $gr->successors($n); for my $s (@suc) { print " multiedge_ids $n => $s: ", join (", ", $gr->get_multiedge_ids($n, $s)),"\n"; } my @pre = $gr->predecessors($n); for my $p (@pre) { print " multiedge_ids $p => $n: ", join (", ", $gr->get_multiedge_ids($p, $n)),"\n"; } } }
Date: Thu, 04 Aug 2005 00:12:33 +0300
From: Jarkko Hietaniemi <jhietaniemi [...] gmail.com>
To: bug-Graph [...] rt.cpan.org
CC: undisclosed-recipients:;
Subject: Re: [cpan #13796] set_edge_attribute_by_id() borken in 0.66
RT-Send-Cc:
via RT wrote: Show quoted text
> This message about Graph was sent to you by TELS <TELS@cpan.org> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=13796 > > > Graph 0.66 breaks Graph::Easy rather badly. My Graph::Easy package has a method that is called connetions() and returns the number of egdes coming in plus going out. For "A-B,C-B" it should return "2" for "B" as it does with Graph 0.65. With 0.66, it will return "3". Breakage ensues. > > It seems either get_multiedge_ids() or set_edge_attribute_by_id() has changed somehow. Attached is a script to reproduce the symptom. > > I am adding three vertices to the (multi-edged) graph, with two edges: > > A => B > C => B > > I also attach an attribute to the edges (as Graph::Easy does, one attribute per vertex and edge containing the pointer to the objects from the Graph::Easy name space). > > When not commenting out the line to add the attribute, get_multiedge_ids() suddenlty returns "1 0" for "C => B", instead of the expected "0" (there is only one edge with the ID "0" from "C" to "B"). > > I do think the change from 0.65 to 0.66 is a bug. > > The problem is probably somewhere in set_edge_attribute_by_id() but after tracking this down for a few hours I am too tired to look further. (It maybe thinks the edge does not yet exist and adds it again). > > Best wishes, > > Tels
Please retry with Graph 0.67.
From: Tels <nospam-abuse [...] bloodgate.com>
To: bug-Graph [...] rt.cpan.org
Subject: Re: [cpan #13796] AutoReply: set_edge_attribute_by_id() borken in 0.66
Date: Sun, 7 Aug 2005 18:17:03 +0200
RT-Send-Cc:
-----BEGIN PGP SIGNED MESSAGE----- Moin Jarkko, Graph 0.67 works now perfect. Thank you! You can close this bug, as well as: 13193 13194 (sorry about the duplicate) 13195 Best wishes, Tels - -- Signed on Sun Aug 7 18:15:58 2005 with key 0x93B84C15. Visit my photo gallery at http://bloodgate.com/photos/ PGP key on http://bloodgate.com/tels.asc or per email. "Not King yet." -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iQEVAwUBQvYz/3cLPEOTuEwVAQFFMgf8DirdIfhRZ/J1YmLRYWRbW7ssS6RFaIE4 p8vConiF5Ku6HZFQjSaCVJg3aRe+jPe6fDPB9aqZOvvnPrJb2OmtpawJ0PD9/Iq5 TPpi3pXH/4l4x91nLn7eKaEtCotbLaescL4QJPUJrkAN8gkNvLDrD86/Xarf1vuR Mbzonw+X7AxX9OMLMw3GOmcm2l/NM2E2CfoQbaE3q7It/egcjDcoF5pemVAvtdoq WrcHddS/MjE7KDBS3YeJDSUF2hkx1OzeXcKbULRGdSWm6gW/pLI0QNinMd+dhl5L KJ6JAhHq5k3ENGc36wtb7aXzyS6ldyiLyxy8lz6guN4xIjHiyFVyvw== =oQzQ -----END PGP SIGNATURE-----