# 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):