Skip Menu |

This queue is for tickets about the Graph CPAN distribution.

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

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

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



Subject: Nodes appear to unblessed after using connected_components()
JHI, This bug is similar to 17108, except the method is connected_components(). use strict; use Graph; use Digest::MD5; my $g = Graph::Undirected->new; my $v1 = Digest::MD5->new(); my $v2 = Digest::MD5->new(); my $v3 = Digest::MD5->new(); my $v4 = Digest::MD5->new(); $g->add_vertices($v1,$v2,$v3,$v4); $g->add_edges([$v1,$v2],[$v3,$v4],[$v3,$v2]); my $v = $g->random_vertex; # OK check($v); my @cc = $g->connected_components; # NOT OK for my $ref (@cc) { for (@$ref) { check($_); } } sub check { my $md5 = shift; $md5->add("ljdfgljfglj"); print $md5->hexdigest,"\n"; } MacOS 10.4.4 135 ~>perl -V Summary of my perl5 (revision 5 version 8 subversion 6) configuration: Platform: osname=darwin, osvers=8.0, archname=darwin-thread-multi-2level uname='darwin b31.apple.com 8.0 darwin kernel version 8.0.0: sat mar 26 14:15:22 pst 2005; root:xnu-792.obj~1release_ppc power macintosh powerpc ' config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe -Dldflags=-Dman3ext=3pm - Duseithreads -Duseshrplib' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict- aliasing -I/usr/local/include', optimize='-Os', cppflags='-no-cpp-precomp -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='3.3 20030304 (Apple Computer, Inc. build 1809)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='-L/usr/local/lib' libpth=/usr/local/lib /usr/lib libs=-ldbm -ldl -lm -lc perllibs=-ldl -lm -lc libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, libperl=libperl.dylib gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-bundle -undefined dynamic_lookup -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Locally applied patches: 23953 - fix for File::Path::rmtree CAN-2004-0452 security issue 33990 - fix for setuid perl security issues Built under darwin Compiled at Aug 21 2005 17:14:55 %ENV: PERL5LIB="/usr/local/GUS/gus_home/lib/perl:/Users/bosborne/bioperl-live:~/bioperl- db:~/bioperl-ext" @INC: /usr/local/GUS/gus_home/lib/perl /Users/bosborne/bioperl-live ~/bioperl-db ~/bioperl-ext /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread-multi-2level /Network/Library/Perl/5.8.6 /Network/Library/Perl /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.6 /Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.8.1
Subject: Re: [rt.cpan.org #17160] Nodes appear to unblessed after using connected_components()
Date: Sat, 18 Feb 2006 19:43:14 +0200
To: bug-Graph [...] rt.cpan.org
From: Jarkko Hietaniemi <jhietaniemi [...] gmail.com>
An update for this and all the similar bugs - you have found a widespread implementation problem in the Graph module related to using references as vertices. The short answer is that there never was even a slightest chance of anything working as expected (when using Perl objects as vertices) without explicitly specifying the option refvertexed => 1 when creating a graph. (A medium answer is that the 'supervertices' of e.g. "connected graphs" are by default NOT objects, even if the vertices of the original graph are. They cannot be.) The long answer is that even doing this would not have helped much since many, MANY, places in the code go KABOOM (especially so if such references "stringify" to identical values, as my further investigation revealed). The summary of the situation is that I need to make some extensive rethinking and fixing, so extensive that I cannot give any estimates when these problems would be fixed.
Subject: Re: [rt.cpan.org #17160] Nodes appear to unblessed after using connected_components()
Date: Wed, 22 Feb 2006 12:53:43 -0500
To: bug-Graph [...] rt.cpan.org
From: Brian Osborne <osborne1 [...] optonline.net>
Jarkko, Thanks for the note. I'll continue to base the package I'm working on, bioperl-network, on Graph on the assumption that sooner or later the vertices returned by any method is referenced. At this point it's too late to go back! BIO On 2/18/06 12:44 PM, "jhi@iki.fi via RT" <bug-Graph@rt.cpan.org> wrote: Show quoted text
> An update for this and all the similar bugs - you have found > a widespread implementation problem in the Graph module related > to using references as vertices. > > The short answer is that there never was even a slightest chance of > anything working as expected (when using Perl objects as vertices) > without explicitly specifying the option refvertexed => 1 when creating > a graph. > > (A medium answer is that the 'supervertices' of e.g. "connected graphs" > are by default NOT objects, even if the vertices of the original graph > are. They cannot be.) > > The long answer is that even doing this would not have helped much > since many, MANY, places in the code go KABOOM (especially so if such > references "stringify" to identical values, as my further investigation > revealed). > > The summary of the situation is that I need to make some extensive > rethinking and fixing, so extensive that I cannot give any estimates > when these problems would be fixed. > > > >
Subject: Re: [rt.cpan.org #17160] Nodes appear to unblessed after using connected_components()
Date: Wed, 22 Feb 2006 20:51:00 +0200
To: bug-Graph [...] rt.cpan.org
From: Jarkko Hietaniemi <jhietaniemi [...] gmail.com>
osborne1@optonline.net via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=17160 > > > Jarkko, > > Thanks for the note. I'll continue to base the package I'm working on, > bioperl-network, on Graph on the assumption that sooner or later the > vertices returned by any method is referenced. At this point it's too late > to go back!
I would recommend a two-stage approach: write an intermediate layer that maps your objects to unique ids, then create and use Graphs using those ids, then map the results back to your objects. Show quoted text
> BIO > > On 2/18/06 12:44 PM, "jhi@iki.fi via RT" <bug-Graph@rt.cpan.org> wrote: >
>> An update for this and all the similar bugs - you have found >> a widespread implementation problem in the Graph module related >> to using references as vertices. >> >> The short answer is that there never was even a slightest chance of >> anything working as expected (when using Perl objects as vertices) >> without explicitly specifying the option refvertexed => 1 when creating >> a graph. >> >> (A medium answer is that the 'supervertices' of e.g. "connected graphs" >> are by default NOT objects, even if the vertices of the original graph >> are. They cannot be.) >> >> The long answer is that even doing this would not have helped much >> since many, MANY, places in the code go KABOOM (especially so if such >> references "stringify" to identical values, as my further investigation >> revealed). >> >> The summary of the situation is that I need to make some extensive >> rethinking and fixing, so extensive that I cannot give any estimates >> when these problems would be fixed. >> >> >> >>
> > > >
Subject: Re: [rt.cpan.org #17160] Nodes appear to unblessed after using connected_components()
Date: Wed, 22 Feb 2006 14:10:01 -0500
To: bug-Graph [...] rt.cpan.org
From: Brian Osborne <osborne1 [...] optonline.net>
Jarkko, That's right, that's what I've been thinking of. My code already builds this mapping hash for fast retrieval, id-to-vertex, using it as a work-around should not be hard. BIO On 2/22/06 1:51 PM, "jhi@iki.fi via RT" <bug-Graph@rt.cpan.org> wrote: Show quoted text
> I would recommend a two-stage approach: write an intermediate layer that > maps your objects to unique ids, then create and use Graphs using those > ids, then map the results back to your objects.
CC: osborne1 [...] optonline.net
Subject: Re: [rt.cpan.org #17160] Nodes appear to unblessed after using connected_components()
Date: Sun, 21 May 2006 21:50:06 +0300
To: bug-Graph [...] rt.cpan.org
From: Jarkko Hietaniemi <jhietaniemi [...] gmail.com>
Guest via RT wrote: Show quoted text
> Thu Jan 19 10:42:06 2006: Request 17160 was acted upon. > Transaction: Ticket created by guest > Queue: Graph > Subject: Nodes appear to unblessed after using connected_components() > Owner: Nobody > Requestors: osborne1@optonline.net > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=17160 >
Please try Graph 0.70 for this and all the other bugs you reported. Show quoted text
>