Skip Menu |

This queue is for tickets about the Graph CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: derhoermi [...] gmx.net
Cc:
AdminCc:

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



Subject: Graph::TransitiveClosure::Matrix contradictory wrt reflexive
Date: Mon, 01 Nov 2010 21:32:35 +0100
To: bug-graph [...] rt.cpan.org
From: Bjoern Hoehrmann <derhoermi [...] gmx.net>
Hi, For 0.94, in the synopsis it says "Being reflexive is the default" while the documentation for the reflexive option says "By default the transitive closure matrix is not reflexive" (and in 0.91 the default appears to be reflexive, haven't checked 0.94). regards, -- Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de 25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
From: ynnor [...] mm.st
On Mon Nov 01 16:32:45 2010, derhoermi@gmx.net wrote: Show quoted text
> For 0.94, in the synopsis it says "Being reflexive is the default" > while the documentation for the reflexive option says "By default the > transitive closure matrix is not reflexive" (and in 0.91 the default > appears to be reflexive, haven't checked 0.94).
Same in 0.94. The documentation says on one point "is_reachable is always reflexive", and in a different place it says that is_reachable would be the same as has_edge (which means it is NOT reflexive for directed graphs. In fact, is_transitive($u,$g) seems to do the job.
From: ynnor [...] mm.st
I need to correct my last post. is_transitive doesn't work either. Although the documentation says: ======= # The reflexivity of is_transitive(u, v) depends of the reflexivity # of the transitive closure. $tcg->is_transitive($u, $v) ======= is_transitive always ignores its arguments and just returns the transitivity of the whole graph.
From: ynnor [...] mm.st
Example program to demonstrate the bug: Although the add_edge line has been commented out (i.e. the graph consists only of 2 isolated notes), is_transitive(1,2) returns true. ==================================================== use strict; use warnings; use Graph; use Graph::TransitiveClosure; my $g=Graph->new; for my $n (1..2) { $g->add_vertex($n) } # $g->add_edge(1,2); print "$g\n"; my $tcg=Graph::TransitiveClosure->new($g,reflexive => 1); for my $n (1..2) { my $z=3-$n; print "is_transitive($n,$z) is ",$tcg->is_transitive($n,$z) ? 'true' : 'false',"\n"; }
I think this is mostly a documentation bleargh. is_transitive() is not meant for testing reachability: is_reachable() is.