Subject: | toposort (topological sort, linear extension) fails |
Show quoted text
cpan> i Graph
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Database was generated on Mon, 17 Nov 2003 14:46:56 GMT
Strange distribution name [Graph]
Module id = Graph
DESCRIPTION Data structure and ops for directed graphs
CPAN_USERID JHI (Jarkko Hietaniemi <jhi@iki.fi>)
CPAN_VERSION 0.20101
CPAN_FILE J/JH/JHI/Graph-0.20101.tar.gz
DSLI_STATUS RdpO (released,developer,perl,object-oriented)
MANPAGE Graph - graph operations
INST_FILE /usr/lib/perl5/site_perl/5.8.0/Graph.pm
INST_VERSION 0.20101
[root@theodolite root]# perl -v
This is perl, v5.8.0 built for i386-linux-thread-multi
Copyright 1987-2002, Larry Wall
[root@theodolite root]# uname -a
Linux theodolite.dyndns.org 2.4.18-27.8.0debug #1 Fri Mar 14 06:23:49 EST 2003 i686 athlon i386 GNU/Linux
SORRY: Also attached the file which demonstrates problem.
#!/usr/bin/perl -w
use strict;
use Graph::Directed;
my $g = new Graph::Directed;
$g = $g->add_edge('a','b');
if (! $g->has_edge('a','b')) {
die "add_edge failed";
}
$g = $g->add_edge('b','a');
if (! $g->has_edge('b','a')) {
die "add_edge failed";
}
my @toposort = $g->toposort;
print "@toposort\n";
#!/usr/bin/perl -w
use strict;
use Graph::Directed;
my $g = new Graph::Directed;
$g = $g->add_edge('a','b');
if (! $g->has_edge('a','b')) {
die "add_edge failed";
}
$g = $g->add_edge('b','a');
if (! $g->has_edge('b','a')) {
die "add_edge failed";
}
my @toposort = $g->toposort;
print "@toposort\n";