#17225: Degrees of looped *immutable* graphs are wrong
----------------------------+----------------------------
   Reporter:  kcrisman      |            Owner:
       Type:  defect        |           Status:  new
   Priority:  major         |        Milestone:  sage-6.4
  Component:  graph theory  |         Keywords:
  Merged in:                |          Authors:
  Reviewers:                |  Report Upstream:  N/A
Work issues:                |           Branch:
     Commit:                |     Dependencies:
   Stopgaps:                |
----------------------------+----------------------------
 See [http://stackoverflow.com/questions/26566823/sage-python-bug-in-
 looped-graph-degree-computation this SO question].

 {{{
 q=graphs.CompleteGraph(2)
 q.allow_loops(True)
 q.allow_multiple_edges(True)
 q.add_edge([1,1])
 a=q.copy(immutable=True)
 b=q.copy(immutable=False)

 sage: a==b
 True
 sage: a.degree()
 [1, 2]
 sage: b.degree()
 [1, 3]
 }}}

 Basically, the problem is that the usual backend has a case for this
 {{{
     if self._loops and self.has_edge(v, v, None):
         if self._multiple_edges:
             d += len(self.get_edge_label(v, v))
         else:
             d += 1
 }}}
 but the "static" one doesn't.

--
Ticket URL: <http://trac.sagemath.org/ticket/17225>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to