# Ticket #7294: trac_7294-fix.patch

File trac_7294-fix.patch, 1.4 KB (added by mhansen, 10 years ago)
• ## sage/graphs/graph.py

```# HG changeset patch
# User Mike Hansen <mhansen@gmail.com>
# Date 1260899495 28800
# Node ID 3b79b0bbc70225a44af608cc13daef3e466592bd
# Parent  2b2706c80635d55d6273e48b90eed1fc93de2bc4
Minor fixes for #7294

diff --git a/sage/graphs/graph.py b/sage/graphs/graph.py```
 a Is there a perfect matching in an even cycle ? sage: g = graphs.CycleGraph(6) sage: bounds = lambda x : [1,1] sage: m=g.degree_constrained_subgraph(bounds=bounds) # optional - requires GLPK or CBC sage: m.size() sage: bounds = lambda x: [1,1] sage: m = g.degree_constrained_subgraph(bounds=bounds) # optional - requires GLPK or CBC sage: m.size() #optional 3 """ reorder = lambda x: (min(x[0],x[1]),max(x[0],x[1]),x[2]) if bounds == None: if bounds is None: raise ValueError,"The `bounds` keyword can not be equal to None" elif isinstance(bounds,dict): f_bounds = lambda x : bounds[x] f_bounds = lambda x: bounds[x] else: f_bounds = bounds if self.weighted(): weight = lambda x: x[2] if x[2] != None else 1 weight = lambda x: x[2] if x[2] is not None else 1 else: weight = lambda x: 1