# Ticket #10151: trac_10151.patch

File trac_10151.patch, 44.4 KB (added by ncohen, 3 years ago)
• ## sage/graphs/digraph.py

```# HG changeset patch
# User Nathann Cohen <nathann.cohen@gmail.com>
# Date 1287679187 -7200
# Parent  c759dc92eeb3e94e38c3226ecba4f836438c7442
trac 10151 -- Update calls to MixedIntegerLinearProgram and its solve function to follow the new interface

diff -r c759dc92eeb3 -r f7037b2573b1 sage/graphs/digraph.py```
 a from sage.numerical.mip import MixedIntegerLinearProgram, Sum p=MixedIntegerLinearProgram(maximization=False) p=MixedIntegerLinearProgram(maximization=False, solver=solver) b=p.new_variable() x=p.new_variable(dim=2) p.set_objective(Sum([b[(u,v)] for (u,v) in self.edges(labels=None)])) if value_only: return p.solve(objective_only=True, solver=solver, log=verbose) return p.solve(objective_only=True, log=verbose) else: p.solve(solver=solver, log=verbose) p.solve(log=verbose) b_sol=p.get_values(b) from sage.numerical.mip import MixedIntegerLinearProgram, Sum p=MixedIntegerLinearProgram(maximization=False) p=MixedIntegerLinearProgram(maximization=False, solver=solver) b=p.new_variable() x=p.new_variable(dim=2) p.set_objective(Sum([b[v] for v in self])) if value_only: return p.solve(objective_only=True, solver=solver, log=verbose) return p.solve(objective_only=True, log=verbose) else: p.solve(solver=solver, log=verbose) p.solve(log=verbose) b_sol=p.get_values(b) from sage.sets.set import Set
• ## sage/graphs/generic_graph.py

`diff -r c759dc92eeb3 -r f7037b2573b1 sage/graphs/generic_graph.py`
• ## sage/graphs/graph.py

`diff -r c759dc92eeb3 -r f7037b2573b1 sage/graphs/graph.py`
 a from sage.numerical.mip import MixedIntegerLinearProgram, MIPSolverException, Sum p = MixedIntegerLinearProgram(maximization=False) p = MixedIntegerLinearProgram(maximization=False, solver=solver) b = p.new_variable() reorder = lambda x,y: (x,y) if x
• ## sage/graphs/graph_coloring.py

`diff -r c759dc92eeb3 -r f7037b2573b1 sage/graphs/graph_coloring.py`
`diff -r c759dc92eeb3 -r f7037b2573b1 sage/numerical/all.py`
`diff -r c759dc92eeb3 -r f7037b2573b1 sage/numerical/backends/generic_backend.pyx`
`diff -r c759dc92eeb3 -r f7037b2573b1 sage/numerical/mip.pyx`