Dear hojjat Rostami, On 28 Sep 2013, at 09:15, hojjat Rostami <rostamihoj...@yahoo.com> wrote:
> 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. I think this question might be easier answered if you could be more specific. If you could post better formatted and more readable code (separate functions by blank lines, use indentation) and use comments to explain what the code is doing and where exactly do you need Forum's help in explaining it, that may be very helpful. If you have found this program and there are author contact details there, it may be also useful to ask the author directly. One last remark: > best regards > > LoadPackage("grape"); > N:=function(a,b) > return(IsAbelian(Group(a,b))); > end; In this function, you create a group given by two generators a and b and then check if it is abelian - it would be more efficient just to check that a*b = b*a. Hope this helps, Alexander > 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; > _______________________________________________ > Forum mailing list > Forum@mail.gap-system.org > http://mail.gap-system.org/mailman/listinfo/forum _______________________________________________ Forum mailing list Forum@mail.gap-system.org http://mail.gap-system.org/mailman/listinfo/forum