Skip Menu |

This queue is for tickets about the Graph CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: DONANGEL [...] cpan.org
Cc: an.gorohovski [...] gmail.com
AdminCc:

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



CC: an.gorohovski [...] gmail.com
Subject: Problem division by zero
Hello Jarkko, I cannot but admire your Graph module. Excuse me, but I found some problem using clustering_coefficient function to empty graph (network without any edges). I got error message: "Illegal division by zero at .../alessandro/perl5/lib/perl5/Graph.pm line 4026." Yeah, I looked this line: $ tail -n +4026 Graph.pm | head -n 1 $gamma /= $g->vertices(); I think here problem of controlling the zero value $g->vertices(). Sorry for next question: Have you idea to add useful function of the calculation Assortativity coefficient (Newman M. E. J. Mixing patterns in networks // Phys. Rev. E 67, 026126. 2003 by the American Physical Society http://arxiv.org/abs/cond-mat/0209450) ? Regards, Alessandro
Hi Alessandro, The "division by zero" problem I have just fixed (and documented) by returning empty (ergo undefined) when there are no vertices. On Sat Apr 30 05:38:12 2016, DONANGEL wrote: Show quoted text
> Sorry for next question: > Have you idea to add useful function of the calculation Assortativity > coefficient > (Newman M. E. J. Mixing patterns in networks // Phys. Rev. E 67, > 026126. > 2003 by the American Physical Society > http://arxiv.org/abs/cond-mat/0209450) > ?
I am somewhat open to ideas on this, but please open an issue on https://github.com/neilb/Graph/issues to discuss. Closing this. Thanks for the report!