@@ -1892,10 +1892,20 @@ end);
18921892InstallMethod(SmallGeneratingSet," random and generators subset, randsims" ,true ,
18931893 [ IsPermGroup] ,0 ,
18941894function (G )
1895- local i, j, U, gens,o,v,a,sel,min;
1895+ local i, j, U, gens,o,v,a,sel,min,orb,orp,ok ;
18961896
1897- # remove obvious redundancies
18981897 gens := ShallowCopy(Set(GeneratorsOfGroup(G)));
1898+
1899+ # try pc methods first. The solvability test should not exceed cost, nor
1900+ # the number of points.
1901+ if # Length(MovedPoints(G))<50000 and
1902+ # ((HasIsSolvableGroup(G) and IsSolvableGroup(G)) or IsAbelian(G))
1903+ IsSolvableGroup(G)
1904+ and Length(gens)> 3 then
1905+ return MinimalGeneratingSet(G);
1906+ fi ;
1907+
1908+ # remove obvious redundancies
18991909 o:= List(gens,Order);
19001910 SortParallel(o,gens,function (a,b ) return a> b;end );
19011911 sel:= Filtered([ 1 .. Length(gens)] ,x-> o[ x] > 1 );
@@ -1920,26 +1930,32 @@ local i, j, U, gens,o,v,a,sel,min;
19201930 od ;
19211931 gens:= gens{ sel} ;
19221932
1923- # try pc methods first
1924- if Length(MovedPoints(G))< 1000 and HasIsSolvableGroup(G)
1925- and IsSolvableGroup(G) and Length(gens)> 3 then
1926- return MinimalGeneratingSet(G);
1927- fi ;
1928-
1933+ # store orbit data
1934+ orb:= Set(List(Orbits(G,MovedPoints(G)),Set));
1935+ orp:= Filtered([ 1 .. Length(orb)] ,x-> IsPrimitive(Action(G,orb[ x] )));
19291936
19301937 min:= 2 ;
19311938 if Length(gens)> 2 then
19321939 # minimal: AbelianInvariants
19331940 min:= Maximum(List(Collected(Factors(Size(G)/ Size(DerivedSubgroup(G)))),x-> x[ 2 ] ));
1941+ if min= Length(GeneratorsOfGroup(G)) then return GeneratorsOfGroup(G);fi ;
19341942 i:= Maximum(2 ,min);
19351943 while i<= min+ 1 and i< Length(gens) do
19361944 # try to find a small generating system by random search
19371945 j:= 1 ;
19381946 while j<= 5 and i< Length(gens) do
19391947 U:= Subgroup(G,List([ 1 .. i] ,j-> Random(G)));
1948+ ok:= true ;
1949+ # first test orbits
1950+ if ok then
1951+ ok:= Length(orb)= Length(Orbits(U,MovedPoints(U))) and
1952+ ForAll(orp,x-> IsPrimitive(U,orb[ x] ));
1953+ fi ;
1954+
1955+
19401956 StabChainOptions(U).random:= 100 ; # randomized size
19411957# Print("A:",i,",",j," ",Size(G)/Size(U),"\n");
1942- if Size(U)= Size(G) then
1958+ if ok and Size(U)= Size(G) then
19431959 gens:= Set(GeneratorsOfGroup(U));
19441960 fi ;
19451961 j:= j+ 1 ;
@@ -1955,6 +1971,14 @@ local i, j, U, gens,o,v,a,sel,min;
19551971 while i <= Length(gens) and Length(gens)> min do
19561972 # random did not improve much, try subsets
19571973 U:= Subgroup(G,gens{ Difference([ 1 .. Length(gens)] ,[ i] )} );
1974+
1975+ ok:= true ;
1976+ # first test orbits
1977+ if ok then
1978+ ok:= Length(orb)= Length(Orbits(U,MovedPoints(U))) and
1979+ ForAll(orp,x-> IsPrimitive(U,orb[ x] ));
1980+ fi ;
1981+
19581982 StabChainOptions(U).random:= 100 ; # randomized size
19591983# Print("B:",i," ",Size(G)/Size(U),"\n");
19601984 if Size(U)< Size(G) then
0 commit comments