Right, the average_distance method calls the wiener_index method without 
passing the parameters.
This is fixed in ticket #22885 https://trac.sagemath.org/ticket/22885

Le mercredi 26 avril 2017 13:11:03 UTC+2, Sebastian Smith a écrit :
>
> Hi, I ran across a bug in the graph.average_distance() function.  It 
> appears to ignore the by_weight parameter and defaults to False, even if 
> the edge labels are weights.  
>
> The segment of code that produced the error:
>
> # These incorrectly give the same value
> realG.average_distance(by_weight = False)
> realG.average_distance(by_weight = True)
>
> # calculating from the wiener index correctly gives two different values
> 2*realG.wiener_index(by_weight=False)/(realG.order()*(realG.order()-1))
> 2*realG.wiener_index(by_weight=True)/(realG.order()*(realG.order()-1))
>
> Thank you!
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to