ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 05 May 2019 04:27:55 -0500Constructing graphs using permutation or symmetric groupshttp://ask.sagemath.org/question/46450/constructing-graphs-using-permutation-or-symmetric-groups/ I'm trying to construct a graph whose vertices are the elements of a permutation group or a symmetric group. Whenever I do this, it ignores the identity element (). For instance, when I use the Symmetric Group S3, it prints a graph with 5 vertices and the missing vertex is the identity.
Any ideas on why this happening and how I can fix it? Sat, 04 May 2019 15:47:42 -0500http://ask.sagemath.org/question/46450/constructing-graphs-using-permutation-or-symmetric-groups/Comment by slelievre for <p>I'm trying to construct a graph whose vertices are the elements of a permutation group or a symmetric group. Whenever I do this, it ignores the identity element (). For instance, when I use the Symmetric Group S3, it prints a graph with 5 vertices and the missing vertex is the identity. </p>
<p>Any ideas on why this happening and how I can fix it? </p>
http://ask.sagemath.org/question/46450/constructing-graphs-using-permutation-or-symmetric-groups/?comment=46454#post-id-46454Please provide some code to let others reproduce the problem easily.
This dramatically increases the chances of an answer, the speed of getting an answer,
and the accuracy with which the answers target the problem.Sun, 05 May 2019 04:18:52 -0500http://ask.sagemath.org/question/46450/constructing-graphs-using-permutation-or-symmetric-groups/?comment=46454#post-id-46454Comment by slelievre for <p>I'm trying to construct a graph whose vertices are the elements of a permutation group or a symmetric group. Whenever I do this, it ignores the identity element (). For instance, when I use the Symmetric Group S3, it prints a graph with 5 vertices and the missing vertex is the identity. </p>
<p>Any ideas on why this happening and how I can fix it? </p>
http://ask.sagemath.org/question/46450/constructing-graphs-using-permutation-or-symmetric-groups/?comment=46453#post-id-46453Welcome to Ask Sage! Thank you for your question.Sun, 05 May 2019 04:18:02 -0500http://ask.sagemath.org/question/46450/constructing-graphs-using-permutation-or-symmetric-groups/?comment=46453#post-id-46453Answer by slelievre for <p>I'm trying to construct a graph whose vertices are the elements of a permutation group or a symmetric group. Whenever I do this, it ignores the identity element (). For instance, when I use the Symmetric Group S3, it prints a graph with 5 vertices and the missing vertex is the identity. </p>
<p>Any ideas on why this happening and how I can fix it? </p>
http://ask.sagemath.org/question/46450/constructing-graphs-using-permutation-or-symmetric-groups/?answer=46455#post-id-46455Using the `Graph([list_of_vertices, list_of_edges])` construction,
one can build a graph with vertices the elements in the symmetric
group $S_3$, and with no edges, as follows:
sage: S = SymmetricGroup(3)
sage: G = Graph([list(S), []])
sage: G
Graph on 6 vertices
Not a very interesting graph... If the goal is a Cayley graph,
use the dedicated method:
sage: C = S.cayley_graph()
sage: C
Digraph on 6 vertices
Tested with SageMath 8.8.beta4 built for Python 3.
Sun, 05 May 2019 04:27:55 -0500http://ask.sagemath.org/question/46450/constructing-graphs-using-permutation-or-symmetric-groups/?answer=46455#post-id-46455