#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 ncohen):

 Oh. I see ! Sorry, I had not realized that the problem came from
 frozensets inside of the graph !

 > This can be fixed very easily, but also more efficiently.
 > First of all, we can pass g1.vertex_iterator() to frozenset(), which
 will probably solve it all together.

 Right, but that's going too far I guess.

 > Ok, so apparently Graph._backend.iterator_edges() also compares vertices
 before yielding them, to make sure the 'lesser' one is reported as the
 first vertex. And _ford_fulkerson uses this function through
 Graph.edge_iterator().

 Yepyep. And g.vertices() sorts the vertices, which is not a good idea in
 itself but has some advantages, still ... `:-/`

 > I guess there is no way around using a Set?

 Ahahaah. As you said there are many ways around, but the best is indeed to
 use Set. I don't think that it is a performance issue in this context, I
 was just saying aloud that it's better to avoid Set in general. Let's keep
 the code as it is `:-)`

 Nathann

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