# HG changeset patch
# User Nathann Cohen <nathann.cohen@gmail.com>
# Date 1261126927 -3600
# Node ID 3f96f2bfbde9ebca40ed917bf4ea04bf4ccdf386
# Parent 964c2f4ce74db0417a771de0b0cfc951b1fab73c
small bug : infinite loop in edge_coloring when no solver was installed
diff -r 964c2f4ce74d -r 3f96f2bfbde9 sage/graphs/graph_coloring.py
a
|
b
|
|
513 | 513 | """ |
514 | 514 | from sage.numerical.mip import MixedIntegerLinearProgram |
515 | 515 | from sage.plot.colors import rainbow |
| 516 | from sage.numerical.mip import MIPSolverException |
516 | 517 | |
517 | 518 | if g.is_clique(): |
518 | 519 | if value_only: |
… |
… |
|
551 | 552 | e = g.edge_iterator().next() |
552 | 553 | p.set_objective(color[R(e)][0]) |
553 | 554 | p.set_binary(color) |
| 555 | |
554 | 556 | try: |
555 | 557 | if value_only: |
556 | 558 | p.solve(objective_only=True, log=log) |
557 | 559 | else: |
558 | 560 | chi = p.solve(log=log) |
559 | | except: |
| 561 | except MIPSolverException: |
560 | 562 | if value_only: |
561 | 563 | return k + 1 |
562 | 564 | else: |