#16475: Bug in Gomory-Hu tree algorithm
-------------------------------------+-------------------------------------
       Reporter:  foosterhof         |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.3
      Component:  graph theory       |   Resolution:
       Keywords:  gomory hu tree     |    Merged in:
  gomory-hu gomory_hu_tree           |    Reviewers:
        Authors:                     |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  e4604fa9ba9cf8ef5475620ed6b3d156402015d6
  u/foosterhof/ticket/16475          |     Stopgaps:
   Dependencies:  #12797             |
-------------------------------------+-------------------------------------

Comment (by foosterhof):

 In Graph.vertices():
 {{{
 if not boundary_first:
     return sorted(list(self.vertex_iterator()), key=key)
 }}}

 Apparently, it is possible to compare Set and int (or sage.blabla.Integer)
 objects, but not (frozen)set and int.

 {{{
 sage: Set([252,35]) < 1
 True
 sage: set([252,35]) < 1
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 <ipython-input-16-ea79432632b4> in <module>()
 ----> 1 set([Integer(2352),Integer(2352)]) < Integer(1)

 TypeError: can only compare to a set

 sage: frozenset([2352,2352]) < 1
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 <ipython-input-17-55b270cfd9be> in <module>()
 ----> 1 frozenset([Integer(2352),Integer(2352)]) < Integer(1)

 TypeError: can only compare to a set
 }}}

 And thus, when doing:
 {{{
 R1 = vertices & frozenset(g1.vertices())
 }}}
 it gives a TypeError, as g1 contains a vertex that is a frozenset, namely
 g1_v:
 {{{
 g1_v = frozenset(set2)
 g2_v = frozenset(set1)
 g1.add_vertex(g1_v)
 g2.add_vertex(g2_v)
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/16475#comment:10>
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