# Obtaining the adjacency matrix of Cayley graphs

Is it possible to obtain the adjacency matrix of a Cayley graph of $$Z_3 \times Z_5$$? (Manually or by using a software like GAP).

Will there be a pattern for adjacency matrices of Cayley graphs for a particular type of groups considered (i.e. if we consider Cayley graphs of the groups $$Z_p \times Z_q$$, where p,q are distinct primes, will the adjacency matrices obtained for various choices of p and q be related to each other by some pattern)?

I know we obtain different Cayley graphs for different generating sets chosen to construct the Cayley graph. So if the adjacency matrix is difficult to be taken due to this reason please mention at least for one generating set chosen.

• I am very fond of doing the question by GAP. Maybe we have to arrange sort of certain codes for it. But, by calling simple codes in Maple, you can have the matrix very nice. Are you interested in doing it by Maple which is not a professional abstarct algebra tool? – Mikasa Sep 22 '18 at 20:09
• Yes I am. Please tell me how to. Thanks. – Buddhini Angelika Sep 23 '18 at 4:45
• I'm glad if I can identify a pattern as well (if there is) which will be good to express when you have any prime numbers as p and q. – Buddhini Angelika Sep 23 '18 at 4:46
• Typing ??cayley into GAP shows that the package GRAPE has a method called CayleyGraph which gives you the Cayley graph in some format (specified in the help file). Going from that to an adjacency matrix should be fairly easy. – Tobias Kildetoft Sep 23 '18 at 17:27

In GAP: With the function

AdjacencyMatrixCayleyGraph:=function(elms,gens)
local g,A,i,l;
l:=Length(elms);
A:=NullMat(l,l);
for i in [1..Length(elms)] do
for g in gens do
A[i][Position(elms,elms[i]*g)]:=1;
A[i][Position(elms,elms[i]/g)]:=1; # or -1 if digraph is wanted
od;
od;
return A;
end;


you can call AdjacencyMatrixCayleyGraph with a list of elements of the group and a list of generator.

For example, in the case of a cyclic generator of $$Z_3\times Z_5$$:

gap> g:=AbelianGroup([3,5]);
<pc group of size 15 with 2 generators>
[ [ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ],
[ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0 ],
[ 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 ],
[ 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0 ],
[ 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0 ],
[ 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1 ],
[ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ],
[ 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0 ],
[ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 ] ]

• This deserves much + votes. You won't believe how much that old windows friendly version of GAP has helped me to do research. I see what I wanted in screen, delete them and run the codes easily. Thanks for that. Also, as you told me long ago somewhere on this site, the new versions has not constructed as your version unfortunately. – Mikasa Sep 24 '18 at 8:02
• What is that Windows friendly version of GAP? Is it much older version than GAP 4.9.2? – Buddhini Angelika Sep 26 '18 at 11:14
• I also would like to try that since I'm a Windows user. – Buddhini Angelika Sep 26 '18 at 11:23
with(GroupTheory):
with(GraphTheory):
G := DirectProduct(CyclicGroup(3), CyclicGroup(5));
H := CayleyGraph(G):


So the result will be as follows:

Indeed, the output is great but I did like to know the way we could do it by GAP.

• Thanks a lot. Another small question, when giving the command CayleyGraph don't we have to think of the generating sets? Does maple choose a random generating set? – Buddhini Angelika Sep 23 '18 at 7:08
• Thanks for your good question! Honestly, I don't know how Maple does that. I tried to introduce cyclic groups as gens and relations but it didn't get me an exciting result. Maybe I sould be waiting for a programmer which know GAP professionally. – Mikasa Sep 23 '18 at 12:30
• @mrs You can add an option of the form “generators = […]” to the CayleyGraph command to specify a particular sequence of generators for the group. Otherwise, Maple uses the generators returned by “Generators(…)” applied to the group. – James Sep 24 '18 at 1:04
• @James :Thanks so much for notifying that. From years ago, I have thought good points from your side. – Mikasa Sep 24 '18 at 7:40
• Congratulations on you shiny new gold star in group theory!! – amWhy Sep 24 '18 at 22:02