Skip Menu |

This queue is for tickets about the Graph CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: nyoescape [...] gmail.com
Cc:
AdminCc:

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



Subject: UnionFind: Repeated adds clobbers graph component information
If a vertex which was already in the graph is added again, the information about what graph component it was in is lost. Here is an example: $graph = Graph::UnionFind->new; $graph->add('a'); $graph->union('a','b'); $graph->add('a'); # 'a' is no longer related to 'b' I have attached a patch which resolves this issue. Keep up the good work, Antonio
Subject: fix-repeated-add.diff
--- UnionFind.pm.orig 2008-10-03 20:32:10.000000000 +0200 +++ UnionFind.pm 2008-10-03 20:32:40.000000000 +0200 @@ -12,7 +12,7 @@ sub add { my ($self, $elem) = @_; - $self->{ $elem } = [ $elem, 0 ]; + $self->{ $elem } = [ $elem, 0 ] unless defined($self->{$elem}); } sub has {