Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fractional Chromatic Index Infinite Loop #23658

Closed
sagetrac-fidelbarrera mannequin opened this issue Aug 20, 2017 · 23 comments
Closed

Fractional Chromatic Index Infinite Loop #23658

sagetrac-fidelbarrera mannequin opened this issue Aug 20, 2017 · 23 comments

Comments

@sagetrac-fidelbarrera
Copy link
Mannequin

sagetrac-fidelbarrera mannequin commented Aug 20, 2017

The implementation contains an infinite loop that is broken when a quantity is less than or equal to 1, however the loop never ends on the following input:

sage: g=graphs.PetersenGraph()
sage: g.fractional_chromatic_index(solver="GLPK")

The problem seems to depend on the LP solver, using PPL seems to work just fine. Issue seems to be GLPK and CBC/Coin.

Relevant sage-devel thread at 1.

Relevant ask.sagemath thread at 2.

Component: graph theory

Keywords: graph-theory

Author: David Coudert

Branch: ceb0eb8

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/23658

@sagetrac-fidelbarrera sagetrac-fidelbarrera mannequin added this to the sage-8.1 milestone Aug 20, 2017
@dimpase
Copy link
Member

dimpase commented Aug 20, 2017

comment:1

The easiest fix is to set the default solver to PPL.

@dimpase
Copy link
Member

dimpase commented Aug 20, 2017

Branch: u/dimpase/fracchromfix

@dimpase
Copy link
Member

dimpase commented Aug 20, 2017

Commit: 66322e3

@dimpase
Copy link
Member

dimpase commented Aug 20, 2017

Author: Dima Pasechnik

@dimpase
Copy link
Member

dimpase commented Aug 20, 2017

Changed keywords from GLPK, graph-theory to graph-theory

@dcoudert
Copy link
Contributor

comment:2

another fix is to change the stop condition to

if sum((x[2] for x in matching)) <= 1 + 1e-9:
    break

with GLPK, we add multiple times the same constraint

Adding a constraint on matching : [(0, 5, 0.9999999999999999), (1, 2, 3.3306690738754696e-16), (6, 9, 1.4802973661668753e-16)]

and we can check that

sage: M = [(0, 5, 0.999999999999), (1, 6, 9.999778782798785e-13), (7, 9, 2.0000667788622195e-12)]
sage: round(sum(e[2] for e in M),10)
1.0
sage: round(sum(e[2] for e in M),11)
1.0
sage: round(sum(e[2] for e in M),12)
1.000000000002

This is similar with Coin and I believe that it could also happen with Cplex/Gurobi/... on some graphs.

@dimpase
Copy link
Member

dimpase commented Aug 21, 2017

comment:3

Replying to @dcoudert:

another fix is to change the stop condition to

if sum((x[2] for x in matching)) <= 1 + 1e-9:
    break

these kinds of absolute bounds don't scale well.
While I didn't try, I guess taking a sufficiently big example
will render this broken, still.

There are several pointers in the source on how to improve it, perhaps
they should be explored, on another ticket.

@dcoudert
Copy link
Contributor

comment:4

I have another version in u/dcoudert/23658. It uses a LP for the matching problem which solved the issue.

@jplab
Copy link

jplab commented Aug 22, 2017

comment:5

So which branch should be used?

Choosing PPL sounds reasonable since it is also the default in Polyhedron. In the current branch, I see only some spacing missing. Otherwise, looks good.

@dcoudert
Copy link
Contributor

comment:6

The branch I proposed seems solver independent.

Dima, what do you think?

@dimpase
Copy link
Member

dimpase commented Aug 30, 2017

Changed commit from 66322e3 to dae20a3

@dimpase
Copy link
Member

dimpase commented Aug 30, 2017

Changed branch from u/dimpase/fracchromfix to u/dcoudert/23658

@dimpase
Copy link
Member

dimpase commented Aug 30, 2017

Changed author from Dima Pasechnik to David Coudert

@dimpase
Copy link
Member

dimpase commented Aug 30, 2017

New commits:

dae20a3trac #23658: use LP for the matching problem

@dimpase
Copy link
Member

dimpase commented Aug 30, 2017

comment:8

Sorry for sitting on this: I presume your approach is more efficient.
Could we have more tests, in particular the example on the ticket ought to become a test, with a reference to this ticket...

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 31, 2017

Branch pushed to git repo; I updated commit sha1. New commits:

dda33fatrac #23658: Merged with 8.1.beta3
ceb0eb8trac #23658: test

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 31, 2017

Changed commit from dae20a3 to ceb0eb8

@dcoudert
Copy link
Contributor

comment:10

The ticket number of the test was wrong, but the test of this ticket is in the patch.
I don't know which extra tests I could be added.

@dimpase
Copy link
Member

dimpase commented Aug 31, 2017

comment:11

OK, sorry, I overlooked it. It's good to go, thanks.

@dimpase
Copy link
Member

dimpase commented Aug 31, 2017

Reviewer: Dima Pasechnik

@vbraun
Copy link
Member

vbraun commented Sep 4, 2017

Changed branch from u/dcoudert/23658 to ceb0eb8

@vbraun vbraun closed this as completed in d996058 Sep 4, 2017
@jdemeyer
Copy link

jdemeyer commented Sep 7, 2017

comment:13

Follow-up: #23798

@jdemeyer
Copy link

jdemeyer commented Sep 7, 2017

Changed commit from ceb0eb8 to none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants