Ticket #8892: trac_8892-reviewer.patch

File trac_8892-reviewer.patch, 1.7 KB (added by mvngu, 11 years ago)
  • sage/graphs/graph.py

    # HG changeset patch
    # User Minh Van Nguyen <nguyenminh2@gmail.com>
    # Date 1273560560 25200
    # Node ID 5502dc2c69176dff5dd5dca4148b4ad4e2a9bf29
    # Parent  cfd7af5f5e6e1fa0dcdb494e33b0f507d364f04e
    #8892: reviewer patch: many doctests fails since the update of NetworkX
    
    diff --git a/sage/graphs/graph.py b/sage/graphs/graph.py
    a b  
    14291429            sage: g = graphs.CycleGraph(6)
    14301430            sage: bounds = lambda x: [1,1]
    14311431            sage: m = g.degree_constrained_subgraph(bounds=bounds) # optional - requires GLPK or CBC or CPLEX
    1432             sage: m.size() # optional - requires GLPK CBC or CPLEX
     1432            sage: m.size() # optional - requires GLPK or CBC or CPLEX
    14331433            3
    14341434        """
    14351435
     
    14561456
    14571457        for v in self:
    14581458            minimum,maximum = f_bounds(v)
    1459             p.add_constraint(sum([ b[reorder(x,y)]*weight(l) for x,y,l in self.edges_incident(v)]),min=minimum, max=maximum)
     1459            p.add_constraint(sum([ b[reorder(x,y)]*weight(l) for x,y,l in self.edges_incident(v)]), min=minimum, max=maximum)
    14601460       
    14611461        p.set_objective(sum([ b[reorder(x,y)]*weight(l) for x,y,l in self.edge_iterator()]))
    14621462        p.set_binary(b)
  • sage/graphs/graph_coloring.py

    diff --git a/sage/graphs/graph_coloring.py b/sage/graphs/graph_coloring.py
    a b  
    577577    color = p.get_values(color)
    578578    classes = [[] for i in xrange(k)]
    579579    [classes[i].append(e)
    580          for e in g.edge_iterator(labels = False)
     580         for e in g.edge_iterator(labels=False)
    581581             for i in xrange(k)
    582582                 if color[R(e)][i] == 1]
    583583    # if needed, builds a dictionary from the color classes adding colors