Skip Menu |

This queue is for tickets about the Graph CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: macha [...] labri.fr
Cc:
AdminCc:

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



Subject: delete_vertex
Hi Jarkko, I do not know if this is a bug or a feature, but in presence of vertex attributes, the graph after delete_vertex($v) still has $v in the list of vertices. Here is an example exibiting this behaviour. use Graph::Undirected; my $G = Graph::Undirected->new; $G->add_vertex('a'); $G->set_vertex_attribute('a', 'sim', 0); $G->add_vertex('b'); $G->set_vertex_attribute('b', 'sim', 1); $G->add_edge('a', 'b'); $G->delete_vertex('a'); print "G has vertex a ", $G->has_vertex('a') ? 1 : 0, "\n"; print "G vertices are: ", join " ", $G->vertices, "\n"; This prints out: G has vertex a 0 G vertices are: b a Best regards, Macha Nikolski
Date: Sun, 27 Mar 2005 19:49:06 +0300
From: Jarkko Hietaniemi <jhi [...] iki.fi>
To: bug-Graph [...] rt.cpan.org
Subject: Re: [cpan #12023] delete_vertex
RT-Send-Cc:
Guest via RT wrote: Show quoted text
> This message about Graph was sent to you by guest <> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=12023 > > > Hi Jarkko, > > I do not know if this is a bug or a feature, but in presence of > vertex attributes, the graph after delete_vertex($v) still has $v > in the list of vertices. Here is an example exibiting this behaviour. > > use Graph::Undirected; > > my $G = Graph::Undirected->new; > $G->add_vertex('a'); > $G->set_vertex_attribute('a', 'sim', 0); > $G->add_vertex('b'); > $G->set_vertex_attribute('b', 'sim', 1); > $G->add_edge('a', 'b'); > $G->delete_vertex('a'); > print "G has vertex a ", $G->has_vertex('a') ? 1 : 0, "\n"; > print "G vertices are: ", join " ", $G->vertices, "\n"; > > This prints out: > > G has vertex a 0 > G vertices are: b a > > Best regards, > > Macha Nikolski
Try Graph 0.61. -- Jarkko Hietaniemi <jhi@iki.fi> http://www.iki.fi/jhi/ "There is this special biologist word we use for 'stable'. It is 'dead'." -- Jack Cohen