• Aucun résultat trouvé

Working with Base Images

Dans le document This page intentionally left blank (Page 94-103)

Further Low-Level Algorithms

5.2. Working with Base Images

Given abase B for someG ≤ Sym(), the images of base points uniquely determine the elements ofG. Namely, ifBg=Bhfor someg,hGthengh1 fixesBpointwise and sog =h. Therefore, aset AGmay be described by storing only the images ofBunder the elements ofA. If, as usually happens in practical situations,|B|is significantly smaller than||then this method saves memory compared to the storage of permutations.

We need, however, amethod to recover the elements of G from the base images. Given an SGS forGrelative toB, this task can be readily accomplished.

Lemma 5.2.1. Let S be an SGS for G≤Sym()relative to B and let t denote the sum of depths of Schreier trees coding the coset representative sets along the point stabilizer chain of G. Then, given an injection f:B, it is possible to find a permutation gG with Bg= f(B)or determine that no such element of G exists in O(t||)time, by a deterministic algorithm.

Proof. Let B = (β1, . . . , βm) be the base ofG and letG = G[1] ≥ · · · ≥ G[m+1] =1 be the corresponding point stabilizer chain. The element gG with the required property can be obtained by a modification of the standard sifting procedure for permutations. If f1) is in the orbitβ1G[1]then, taking the product of edge labels along the path from f(β1) toβ1in the first Schreier tree, we obtain a permutationr1Gsuch that f1)r1 =β1. Hence, the function f2:Bdefined by f2i) := fi)r1 fixesβ1. If f22)∈β2G[2]then, as a product of edge labels in the second Schreier tree, we obtainr2Gsuch that the function f3:Bdefined by f3i) := fi)r1r2fixes the first two base points. Continuing this process, we obtain someg=r1r2· · ·rmGsuch that f(B)=B(g−1). The number of permutation multiplications in the procedure is at mostt. If, for somei∈[1,m], we have fi(βi) ∈βiG[i] then we conclude that

there is nogGwith f(B)=Bg.

A possible application of this method is when we have to store numerous elements ofGor generators for numerous subgroups ofG. For example, this is the case when we need to store conjugacy class representatives ofGor the subgroup lattice ofG. It is enough to store the base images of the conjugacy class representatives or the base images of the generators of the subgroups and, when the group elements are actually needed, Lemma 5.2.1 can be invoked. We shall describe another applications of Lemma 5.2.1 in Sections 6.1.3 and 6.1.4.

Lemma 5.2.1 can be sped up significantly in the case when we do not need the permutationgwithBg= f(B) explicitly but only need to establish the existence of suchgor it is enough to havegwritten as a word in the strong generators.

For simplicity, let us assume that the SGS Sof Gis closed for inverses (i.e., S=S1). This assumption is automatically satisfied if, as inGAP, the Schreier trees are constructed by the algorithm in the proof of Lemma 4.4.2.

Lemma 5.2.2. Given an injection f :B, it is possible to either find a wordwof length at most t in the strong generators whose product is the unique gG with Bg = f(B)or to determine that no such element of G exists, in O(|B|t)time.

Proof. We modify the algorithm described in the proof of Lemma 5.2.1 by not computing the inversesr1, . . . ,rm of transversal elements explicitly, but by writing them only as words in the strong generators. Namely, if f1) is in the orbitβ1G[1] then we take the sequence of edge labels along the path from f1) to β1 in the first Schreier tree. In this way, we obtain a word w1 in the strong generators such that f1)w1 = β1. Then we define the function f2:Bby f2i) := fi)w1. Iterating this process, eventually we obtain awordw1w2· · ·wm such thatw := (w1w2· · ·wm)−1 satisfies f(B) = Bw. SinceS=S−1, we can writewas a word in the strong generators as well. As before, if fii) ∈ βiG[i] for somei ∈ [1,m] then we conclude that there is no

gGwith f(B)=Bg.

We shall refer to the procedure described in Lemma 5.2.2 assifting as a word.

The first important application of sifting as words is the following theorem.

Theorem 5.2.3. Given a base B for some G= S ≤Sym(),with|| =n, an SGS for G can be computed in O(n|B|2|S|log3|G|)time, by a deterministic algorithm. In particular, if a nonredundant base is known then an SGS can be obtained by a nearly linear-time deterministic algorithm.

Proof. We modify the basic Schreier–Sims algorithm, described in Section 4.2, as follows: Coset representatives for the stabilizer chain of G are stored in Schreier trees, computed by the algorithm in the proof of Lemma 4.4.2. This ensures that the depth of each tree is at most 2 log|G|. The time-critical part of the procedure is the sifting of Schreier generators. We construct and sift Schreier generators as words. If the sifting produces a nontrivial residue then we compute this residue as a permutation ofand add it to the strong generating set. Nontrivial residues occur at most|B|log|G|times.

We leave for the reader to check the details that the modified procedure

satisfies the claimed time bound.

In practice, it occurs frequently that we know a base in advance. In a number of cases, we compute an SGS for some group G, and then the bulk of the computation deals with various subgroups ofG. In these cases, the base ofG can be used as a base for all of its subgroups. This will play an important role in Chapter 6. Of course, a known base can be used in a combination with the randomized methods of Chapter 4 as well.

Base image computations can be utilized at the construction of an SGS even in the case when a base forGis not known in advance. We finish this section with such an application from [Babai et al., 1991], which, with high probability,

constructs an SGS of a small-base group faster than the version described in Theorem 4.5.5.

The following lemma is folklore; it seems to appear first in print in [Cameron et al., 1984].

Lemma 5.2.4. Let G≤Sym(), with|| =n, be transitive. Suppose that the minimal base size of G is b. Then, for all gG\{1}, we have|supp(g)| ≥n/b.

Proof. Let B be a minimal base for G (considered as asubset of , not a sequence) and letbe the support of someg = 1,|| =d. We define two hypergraphs onwith edge setsB = {Bh|hG}andD= {h|hG}, respectively. Both hypergraphs are uniform and, sinceG is transitive, each element ofis contained in the same number of edges ofBandD. Let deg(B) and deg(D) denote the valencies of vertices in these hypergraphs. Counting the number of pairs (B, β) withBBandβBtwo ways, we obtain deg(B)n= b|B|. Similarly, deg(D)n = d|D|. Moreover, because the elements ofB are bases forGand the elements ofDare supports of group elements,B = ∅ for allBB, D. A simple double counting argument gives

deg(B) deg(D)n= |{(B, , β)|BB, D, βB}| ≥ |B||D|.

Substituting deg(B)=b|B|/nand deg(D)=d|D|/nyieldsbdn.

The speedup of the nearly linear-time SGS construction for small-base groups may proceed as follows. We warn the reader in advance that this is a theoretical exercise: TheGAPimplementation also uses base image computations, but the implemented version is much simpler than the algorithm presented here. We shall describe how base images are used in the implementation after the proof of Theorem 5.2.6.

We first handle the case of transitive groups. Please note the distinction in the statement of the next theorem between themaximumrunning time, which we never exceed, and thetypicalrunning time, which happens with high probability.

Such distinction occurs frequently in Las Vegas algorithms, where we can check the correctness of the output with certainty, but it is quite unusual in the case of Monte Carlo algorithms.

Theorem 5.2.5. Suppose that G= T ≤Sym(), with|| =n, is transitive, and let d>0be a constant. There is a Monte Carlo algorithm that constructs an SGS for G in O(nlognlog4|G| + |T|nlog|G|)time. With probability greater than1−1/nd, the algorithm terminates in O(log5|G|logn+nlognlog3|G|+

|T|nlog|G|)time. In any case, the output is correct with probability greater than1−1/nd. The memory requirement is O(nlog2|G| + |T|n).

Proof. We assume familiarity with the nearly linear-time SGS construction in Section 4.5, which we briefly summarize here. Recall that we work with an initial segmentB =(β1, . . . , βk) of a nonredundant base and an approximation Si for agenerating set ofG[i] :=G1,...,βi−1), for 1≤ ik. We maintain the property that, for alli ∈[1,k],Si ≥ Si+1, and we say that the data structure is up to date below level j if Siβi= Si+1 holds for all i with j<ik andthe sum of depths of the Schreier trees for levels j +1, . . . ,kis at most 6 log|Sj+1|.

In the case when the data structure is up to date below levelj, we compute a Schreier tree forSjmodSjβjand check whetherSjβj = Sj+1by sifting Schreier generators composed from random cosets forSjmodSjβjand short and long random subproducts fromSj. IfSjβj = Sj+1then we compute a shallower Schreier tree forSjmodSjβj; if not then we add a new generator toSj+1.

As asserted in Remark 4.5.2, the total time spent in Schreier tree computations isO(nlognlog3|G|). Hence, to achieve the running time stated in this theorem, we have to speed up the sifting of Schreier generators.

The idea is that we form the short and long random subproducts only as words, without multiplying out the permutations, and sift the Schreier generators as words in the Schreier tree data structure of Sj+1. If aSchreier generator does not sift through as a word then we multiply out the siftee and obtain apermutation inSjβj\Sj+1. If aSchreier generator sifts through then we have to establish that the sifteew, which is aword fixingBpointwise, is really the identity. We would like to check this property by establishing that some randomly chosen points inare fixed byw.

By Lemma5.2.4, ifbis the minimal base size of Gandbrandomly cho-sen points of are fixed by w then w=1 with probability greater than 1−(1−1/b)b>1/2. The problem is that we do not know the value of b in advance. Therefore, weguess an upper bound M for log|G| and run the entire algorithm under the assumption that log|G| ≤ M. We shall check each siftee by computing the image ofM randomly chosen points. If our guess for M is correct thenbM, and we detect a nontrivial siftee with probability greater than 1/2.

We know thatGis transitive onand so|G| ≥ n. Therefore, our initial guess forM is the smallest power of 2 greater than logn,M=2l≥logn. We abort the algorithm immediately if we obtain some evidence that our guess

for M is incorrect: Either

jjSj|>2M or the deterministic Schreier tree computation of Lemma 4.4.2 produces a Schreier tree of depth greater than 2M, or a randomized Schreier tree computation does not return a shallow Schreier tree as required in Remark 4.4.7.

We claim that the running time of the SGS construction with a guessM as an upper bound for log|G|is

O(n M3logn+M5logn+ |T|M2). (5.1) The Schreier tree computations run in O(n M3logn) time, since we do not encounter more than M base points (otherwise the algorithm aborts), each Sj increases at most M times, and by Remark 4.5.2, the invocations of the algorithm in the proof of Lemma 4.4.2 on each fixed level run inO(n M2) total time. Hence all log|G|factors in the original timing estimate in Remark 4.5.2 can be replaced byM.

The other part of the algorithm, the sifting of Schreier generators, can be done inO(n M3logn+M5logn) time: We have at mostM base points, each Sjincreases at mostMtimes, and after each increase ofSj, we siftO(Mlogn) Schreier generators as words. Note that we have to sift twice as many Schreier generators as in the version in Section 4.5, since we have to compensate for the fact that we detect a nontrivial siftee only with probability between 1/2 and 1.

The handling of each Schreier generator takes O(M2) time: This is the time requirement of sifting as a word by Lemma 5.2.2, as well as the required time to compute the images ofMrandomly chosen points in the siftee. We detect a nontrivial siftee at mostM2times (at mostM times at each of at mostMbase points) and multiplying out a nontrivial siftee takesO(Mn) time. Finally, the termO(|T|M2) in (5.1) comes from the sifting of the input generators as words.

If our guess forMis correct then the error probability analysis in Section 4.5 is valid (note again that we have compensated for the fact that not all non-trivial siftees are detected by sifting twice as many Schreier generators as in Section 4.5) and we obtain a correct SGS with probability greater than 1−1/nd. However, it is possible that, although the algorithm did not abort, the output is incorrect because our estimate forM was too low and we missed too many nontrivial siftees. Hence, after termination, we use the strong generating test described in Lemma4.5.6 to check whether the result is correct. IfR1, . . . ,Rk

denote the transversals constructed by the algorithm then, by Lemma 4.5.6, sifting O(Mlogn) elements ofT and of D := Rk· · ·R1 in Ddetects if the output is incorrect with probability greater than 1−1/nd. We sift the elements of DandT as permutations, not only as words, and the time requirement for each sift isO(Mn).

If something bad happens (the algorithm aborts or the final strong generating test reveals that the output SGS is incorrect) then we double our guessM and repeat the entire algorithm.

When our guess exceeds the actual value of log|G|for the first time, the SGS construction succeeds with probability greater than 1−1/ndand the algorithm terminates. Since this last guess satisfies log|G| ≤M <2 log|G|, the running time estimate of the last run is O(log5|G|logn+nlognlog3|G| + |T|log2

|G|). Also, because we double our guesses forM, the running time estimate of the last run dominates the sum of running time estimates for all previous runs.

What happens if, owing to a sequence of unlucky random bits, the algorithm does not terminate whenMexceeds log|G|? When the algorithm is run with a guessM >log|G|, the running time is

O(nlog3|G|logn+Mlog4|G|logn+ |T|Mlog|G|), (5.2) since we do not encounter more than log|G| base points, eachSj increases at most log|G|times, the sum of depths of Schreier trees is O(log|G|), and on each level we constructO(log|G|logn) Schreier generators (note that this number depended on the sum of depths of trees). Hence all factors M in the estimate (5.1) can be replaced by log|G|, except one: The number of points whose images are traced in the siftees of Schreier generators. Note also that if the guessMexceedsnthen the factorsMcan be replaced bynin (5.2), because we never trace the images of more thannpoints.

We continue the doubling of our guessM at most untilM exceeds log(n!).

Hence the run with the last estimate forM terminates inO(nlog4|G|logn+

|T|nlog|G|) time, and this time estimate dominates the sum of running time

estimates for all previous runs.

Theorem 5.2.6. Given G = T ≤Sym(), with || = n, and a constant d>0, there is a Monte Carlo algorithm that computes an SGS for G in O(log6|G|logn+nlog4|G|logn+ |T|nlog|G|) time. With probability greater than 1−1/nd, the algorithm terminates in O(log6|G|logn + nlog3|G|logn+ |T|nlog|G|) time. In any case, the output is correct with probability greater than1−1/nd. The memory requirement is O(nlog2|G| +

|T|n).

Proof. We start by computing the orbits ofGonand choosing an orbit1

of size greater than 1. We compute a base and SGS for theG-action on1, by the algorithm described in Theorem 5.2.5. The Schreier tree computations and

multiplying out nontrivial siftees as permutations are carried out with permu-tations of, not only with their restriction to1. This computation is the base case of the following recursive procedure.

Suppose that a baseB=(β1, . . . , βk) and generating setsSiand transversals Ri for 1 ≤ ik are already computed for the G-action G|1∪···∪j−1 on 1∪ · · · ∪j1, for some orbits1, . . . , j1ofG. As in the base case, the strong generators and the labels in Schreier trees are computed as permutations of. Then we perform the following three steps:

(a) Decide whetherG(1∪···∪j−1) = 1; if not, then find an orbitj where G(1∪···∪j−1)acts nontrivially.

(b) Compute a nonredundant base for theG-action onj. (c) Compute a base and SGS for theG-action on1∪ · · · ∪j.

The recursion terminates when Step (a) reports thatG(1∪···∪j−1) = 1, or 1∪ · · · ∪j =.

Step (a) is simply calling the strong generating test of Lemma 4.5.6, with the setD:=Rk· · ·R1.

If an orbitjis output by Step (a) then we call the algorithm of Theorem 5.2.5 to compute a nonredundant base:=(γ1, . . . , γl) (and an SGS, which we shall discard) forG|j. We carry out this computation using only the restrictions of permutations toj. SinceG|1∪···∪jG|1∪···∪j−1×G|j, the concatenation ofBandis a (possibly redundant) base forG(1∪···∪j).

In Step (c), we augment the already known SGS forG|(1∪···∪j−1), modifying the nearly linear-time algorithm of Section 4.5 by executing all sifts only as words and checking whether a siftee is trivial by computing the images of all points inB and. Initially, we declare that the already known data structure is up to date below levelk. Note that, although the Schreier trees at the base pointsβ1, . . . , βkdo not change, we may have to add new generators to some Sifor someik.

Now we address the time requirement of the algorithm. The base case, the computation of an SGS for G|1, runs in O(|1|log4|G|logn + nlog3|G|logn+ |T||1|log|G|) maximum time and, with probability greater than 1−1/nd+2, the algorithm terminates in

O(min{log|G|,|1|}log4|G|logn+nlog3|G|logn + |T|min{log|G|,|1|}log|G|)

time. Recursion is called at most log|G|times, since the order ofG|1∪···∪j is at least twice the order ofG|1∪···∪j−1.

One call of Step (a) takesO(nt2logn) time, wheretis the sum of depths of Schreier trees at the time of the call. This sum is always at most 6 log|G|, so the total cost of calls of Step (a) during the entire recursion isO(nlog3|G|logn).

Calling Step (b) on the orbit j runs in time O(|j|log4|G|logn +

|T||j|log|G|) and, with probability greater than 1−1/nd+2, this call ter-minates in

O(min{log|G|,|j|}log4|G|logn+ |j|log3|G|logn + |T|min{log|G|,|j|}log|G|)

time.

In Step (c), the cost of Schreier tree computations and multiplying out non-trivial siftees isO(nlog3|G|logn) during theentirealgorithm, since the usual estimates (at most log|G|base points, eachSjincreases at most log|G|times, etc.) are valid and we do not duplicate work at the different calls of Step (c).

Sifting one Schreier generator and deciding whether the siftee is trivial can be done in O(log2|G|) time, since we evaluate siftees on|B| + || ≤ 2 log|G| points. During one call of Step (c), Schreier generators are sifted O(log3|G|logn) times because there are at most log|G|base points, eachSj

increases at most log|G| times, andO(log|G|logn) generators are sifted at the processing of a level. Consequently, during all calls of Step (c), we spend O(log6|G|logn) time handling Schreier generators.

If an element of the generating setT sifts through as a word inG|1∪···∪j−1

with trivial sifteew(i.e.,wfixes all base points in1∪ · · · ∪j−1), then we storewand sift it along the base points injat the next call of Step (c). In this way, we can achieve that the total time requirement of siftingT during calls of Step (c) isO(|T|log2|G|).

Summarizing, we obtain that the maximum time requirement of the entire algorithm isO(log6|G|logn+nlog4|G|logn+ |T|nlog|G|). Note that we ensured that each call of the base case and of Steps (a), (b), and (c) succeeds with probability greater than 1−1/nd+2, so the probability of a correct output is greater than 1−3 log|G|/nd+2>1−1/ndand the algorithm terminates in O(log6|G|logn+nlog3|G|logn+|T|nlog|G|) time with probability greater

than 1−log|G|/nd+2 >1−1/nd.

Remark 5.2.7. As mentioned in Section 4.5.1,GAPemploys aheuristic version of the nearly linear-time Monte Carlo SGS construction. At the processing of a level of the Schreier tree data structure, we form only one Schreier generatorg from a random coset and a random subproduct of generators on this level. Then gis sifted as a word, and the siftee is evaluated at each point in orbits of size

at most 50, and at five randomly chosen points in orbits of size greater than 50.

Although Lemma 5.2.4 cannot be sharpened (cf. Exercise 5.3), five randomly chosen points have a decent chance to detect that a word does not represent the

Although Lemma 5.2.4 cannot be sharpened (cf. Exercise 5.3), five randomly chosen points have a decent chance to detect that a word does not represent the

Dans le document This page intentionally left blank (Page 94-103)