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

bug in chromatic number #12485

Closed
williamstein opened this issue Feb 9, 2012 · 2 comments
Closed

bug in chromatic number #12485

williamstein opened this issue Feb 9, 2012 · 2 comments

Comments

@williamstein
Copy link
Contributor

This triggers a bug:

sage: g = graphs.IcosahedralGraph()
sage: g.chromatic_number(algorithm='MILP')

The bug is in graphs/graph_coloring.py. In particular, this code is bogus:

        # - No need to try any k smaller than the maximum clique in
        # - the graph No need to try k less than |G|/alpha(G), as each
        #   color class is at most alpha(G)
        # - max, because we know it is not bipartite
        from math import ceil
        k = max([3, g.clique_number(),ceil(g.order()/len(g.independent_set()))])

Somebody (see #9618) thinks that ceil returns an int, but it returns a float. Oops.

CC: @nathanncohen

Component: graph theory

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

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Feb 9, 2012

comment:1

Could it be the one that was fixed in #12389 ? :-)

Nathann

@nathanncohen nathanncohen mannequin added the s: needs info label Feb 9, 2012
@williamstein
Copy link
Contributor Author

comment:2

Yep, that is one way to fix it. I couldn't find that searching. Oops. I'm closing this as a duplicate.

@sagetrac-mvngu sagetrac-mvngu mannequin removed this from the sage-5.0 milestone Feb 12, 2012
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

2 participants