#12797: The cut returned by edge_cut of undirected weighted graphs is sometimes
incorrect
--------------------------------+----------------------------------
       Reporter:  hartke        |        Owner:  jason, ncohen, rlm
           Type:  defect        |       Status:  new
       Priority:  major         |    Milestone:  sage-6.3
      Component:  graph theory  |   Resolution:
       Keywords:                |    Merged in:
        Authors:                |    Reviewers:
Report Upstream:  N/A           |  Work issues:
         Branch:                |       Commit:
   Dependencies:                |     Stopgaps:
--------------------------------+----------------------------------
Changes (by foosterhof):

 * cc: rudi (added)


Comment:

 This bug can quite easily be fixed by replacing in the code the part:

 {{{
 g = self.copy()
 for u,v,l in flow_graph.edge_iterator():
     if (not use_edge_labels or
         (weight(g.edge_label(u,v)) == weight(l))):
         g.delete_edge(u,v)
 }}}

 by:


 {{{
 g = self.copy()
 for u,v,l in flow_graph.edge_iterator():
     g.add_edge(v, u)                         # <-- Added line
     if (not use_edge_labels or
         (weight(g.edge_label(u,v)) == weight(l))):
         g.delete_edge(u,v)
 }}}

 This is because the usual algorithms search for the vertices reachable by
 s in the residual graph. However, the original graph is not a residual
 graph, and thus the constructed graph "g" not as well, as it has no back-
 edges. Therefore, the partition of vertices is calculated incorrectly, and
 therefor the edges exhibiting the cut as well.

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