Home > Archive > PERL Modules > July 2006 > "diameter", "has_a_cycle" problems in Graph-0.76 module
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
"diameter", "has_a_cycle" problems in Graph-0.76 module
|
|
| hi_ryo 2006-07-12, 3:56 am |
| Hello all,
I have some problems with these two functions in Graph : "diameter" and
"has_a_cycle".
"diameter" works only at the first time it's used. If then I added some
other vertices and edges, and call diameter again, it returns the
previous value, no matter how the graph is changed.
"has_a_cycle" should return true when there is a cycle in the graph,
and false if not. However, when there is no cycle, it returns
"uninitialized value" instead of false.
Thanks for help.
| |
| hi_ryo 2006-07-12, 3:56 am |
| The return of undef value in "has_a_cycle" seems to have no harm.
Thanks again to wolverian and purl for making it clear to me.
hi_ryo
> "has_a_cycle" should return true when there is a cycle in the graph,
> and false if not. However, when there is no cycle, it returns
> "uninitialized value" instead of false.
|
|
|
|
|