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

Cayley graph connecting set #6858

Closed
rlmill mannequin opened this issue Sep 2, 2009 · 5 comments
Closed

Cayley graph connecting set #6858

rlmill mannequin opened this issue Sep 2, 2009 · 5 comments

Comments

@rlmill
Copy link
Mannequin

rlmill mannequin commented Sep 2, 2009

Reported by Chris Godsil.

Component: graph theory

Author: Robert Miller

Reviewer: Nathann Cohen

Merged: Sage 4.1.2.alpha2

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

@rlmill rlmill mannequin added this to the sage-4.1.2 milestone Sep 2, 2009
@rlmill rlmill mannequin added c: graph theory labels Sep 2, 2009
@rlmill rlmill mannequin self-assigned this Sep 2, 2009
@rlmill rlmill mannequin added the s: needs review label Sep 2, 2009
@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Sep 5, 2009

comment:1

Hmmm.. I may have done something wrong, but here is what I tried

sage: g=PermutationGroup([(i+1,j+1) for i in range(5) for j in range(5) if j!=i])
sage: (1,2) in g
True
sage: (2,3) in g
True
sage: g.cayley_graph(connecting_set=[(1,2),(2,3)])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/user/ncohen/home/.sage/temp/rebelote.inria.fr/4013/_user_ncohen_home__sage_init_sage_0.py in <module>()

/usr/local/sage/local/lib/python2.6/site-packages/sage/groups/group.so in sage.groups.group.FiniteGroup.cayley_graph (sage/groups/group.c:2157)()

/usr/local/sage/local/lib/python2.6/site-packages/sage/structure/element.so in sage.structure.element.MonoidElement.__mul__ (sage/structure/element.c:8537)()

TypeError: unsupported operand parent(s) for '*': 'Permutation Group with generators [(4,5), (3,4), (3,5), (2,3), (2,4), (2,5), (1,2), (1,3), (1,4), (1,5)]' and '<type 'tuple'>'

Even though it's apparent I know very few about groups in Sage as I had to build S_n by enumerating generators ( I guess there is a command to do that with only the cardinal ? ) ^^;

@nathanncohen nathanncohen mannequin added the s: needs work label Sep 8, 2009
@rlmill
Copy link
Mannequin Author

rlmill mannequin commented Sep 9, 2009

comment:3

Attachment: trac_6858.patch.gz

OK, this new patch should do the trick.

@rlmill rlmill mannequin added s: needs review and removed s: needs work labels Sep 9, 2009
@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Sep 11, 2009

comment:4

Applies fine, documented,does its job.... Positive review ! ;-)

When testing the patch, I tried ( among others ) :

sage: len(g.cayley_graph(connecting_set=[(1,2)]).connected_components())
60
sage: len(g.cayley_graph(connecting_set=[(1,2),(2,3)]).connected_components())
20
sage: len(g.cayley_graph(connecting_set=[(1,2),(2,3),(3,4)]).connected_components())
5

If you think it useful, it could also be included in the examples contained in the docstring, even though there are already two and it may not be necessary at all :-)

Nathann

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Sep 11, 2009

Reviewer: Nathann Cohen

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Sep 11, 2009

Merged: Sage 4.1.2.alpha2

@sagetrac-mvngu sagetrac-mvngu mannequin closed this as completed Sep 11, 2009
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

0 participants