[GAP Forum] program for computing noncommuting elements of groups

hojjat Rostami rostamihojjat at yahoo.com
Sat Sep 28 09:15:05 BST 2013


Dear GAP Forum
I would like to compute the maximal set of  pairwise non commuting elements in a finite groups.
Of course i can find the following program which work through  a grahp but i do not understand how it work.
I will be more grateful for any help or comments.
best regards

LoadPackage("grape");
N:=function(a,b)
return(IsAbelian(Group(a,b)));
end;
NonCommutingGraph:=function(g)
local k, x, y;
k:=Graph(g,Difference(g,Center(g)),OnPoints,function(x,y) return
N(x,y)=false;end);
return k;
end;
clique:=function(x)
local G1,G2;
G1:=NonCommutingGraph(x);
G2:=ComplementGraph(G1);
return Size(IndependentSet(G2));
end;
CliqueNumber:=function(x)
local c, t, M;
c:=clique(x);
while c>0 do
t:=c;
M:=CompleteSubgraphsOfGivenSize(NonCommutingGraph(x),c+1,0);
c:=Size(M);
if c=0 then     return(t); fi;
od;
end; 


More information about the Forum mailing list