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

Fix bug in chessboard graphs generator #13813

Closed
dcoudert opened this issue Dec 9, 2012 · 6 comments
Closed

Fix bug in chessboard graphs generator #13813

dcoudert opened this issue Dec 9, 2012 · 6 comments

Comments

@dcoudert
Copy link
Contributor

dcoudert commented Dec 9, 2012

We should normally have:

  • The BishopGraph([d1,d2],radius=r) is isomorphic to the graph obtained merging the edges of the KnightGraphs([d1,d2],one=i,two=i) for 1<= i <= r.
  • The QueenGraph([d1,d2],radius=r) is isomorphic to the graph obtained merging the edges of a RookGraph([d1,d2,radius=r) and a BishopGraph([d1,d2],radius=r)

With current implementation, the result was sometimes incorrect. This patch solves this issue and adds necessary doctests.

CC: @sagetrac-sluther @nathanncohen

Component: graph theory

Author: David Coudert

Reviewer: Nathann Cohen

Merged: sage-5.6.beta0

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

@dcoudert

This comment has been minimized.

@dcoudert
Copy link
Contributor Author

dcoudert commented Dec 9, 2012

comment:1

Attachment: trac_13813.patch.gz

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Dec 9, 2012

comment:2

I was about to say that you should replace if not B.is_isomorphic(H) by if B != H, but...

sage: %timeit B == H
5 loops, best of 3: 199 ms per loop
sage: %timeit B.is_isomorphic(H)
25 loops, best of 3: 16.3 ms per loop

Honestly ...>_<

Nathann

@dcoudert
Copy link
Contributor Author

dcoudert commented Dec 9, 2012

comment:3

Thanks.

@jdemeyer
Copy link

Reviewer: Nathann Cohen

@jdemeyer
Copy link

Merged: sage-5.6.beta0

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

3 participants