#12244: Empty graphs and new distance computations
-----------------------------+----------------------------------------------
Reporter: ncohen | Owner: jason, ncohen, rlm
Type: defect | Status: needs_work
Priority: major | Milestone: sage-5.0
Component: graph theory | Keywords:
Work_issues: | Upstream: N/A
Reviewer: David Coudert | Author: Nathann Cohen
Merged: | Dependencies:
-----------------------------+----------------------------------------------
Changes (by dcoudert):
* status: needs_review => needs_work
Comment:
Sorry Nathann, but it's not enough :-p
All functions related to distances have to be fixed according to the
proposed patch. I tried only one and get the following error, but for sure
other functions are impacted.
{{{
sage: G = Graph()
sage: G.average_distance()
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call
last)
/path-to-sage/sage-4.8.alpha5/devel/sage-myclone/<ipython console> in
<module>()
/path-to-sage/sage-4.8.alpha5/local/lib/python2.6/site-
packages/sage/graphs/generic_graph.pyc in average_distance(self)
11634 """
11635
> 11636 return
Integer(self.wiener_index())/Integer((self.order()*(self.order()-1))/2)
11637
11638 def szeged_index(self):
/path-to-sage/sage-4.8.alpha5/local/lib/python2.6/site-
packages/sage/structure/element.so in
sage.structure.element.RingElement.__div__
(sage/structure/element.c:12744)()
/path-to-sage/sage-4.8.alpha5/local/lib/python2.6/site-
packages/sage/rings/integer.so in sage.rings.integer.Integer._div_
(sage/rings/integer.c:11987)()
/path-to-sage/sage-4.8.alpha5/local/lib/python2.6/site-
packages/sage/rings/integer_ring.so in
sage.rings.integer_ring.IntegerRing_class._div
(sage/rings/integer_ring.c:5350)()
ZeroDivisionError: Rational division by zero
sage:
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12244#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.