• No results found

The automorphism group of the PDG,Aut(G(Π)), is identified by solving an undirected graph isomorphism problem. The action of a subgroup ofAut(G(Π))onV(G(Π))induces apartition, called theorbits, ofV(G(Π)). We can now define ourquotientstructures based on partitionsvs1..n

ofD(Π).

Definition 29 (Quotient Undirected Graph). For graph G and a partition P of its vertices, the quotientG/P is the digraph:

(i) V(G/P) =P, and

(ii) E(G/P) ={{U, W} |U, W ∈P∧ ∃u2 ∈U, u3 ∈W.{u2, u3} ∈E(G)}.

Definition 30(Quotient Problem). Given partitionvs1..nofD(Π), letQmap members ofD(Π)

to their equivalence class invs1..n. The descriptive quotient isΠ/vs1..n = QLΠM, the image of ΠunderQ. This is well-defined ifvs1..nis a set of orbits. We assume that quotient problems are

well-defined.

Example 22. Consider the planning problemΠ1from Example 21, and the partitionvs1..n. The

descriptive quotient associated withvs1..nis as follows. (Π1/vs1..n).I = {p1, p2, p3}

(Π1/vs1..n).δ = {({p1, p2},{p2, p3}),(∅,{p2})} (Π1/vs1..n).G = {p3}

The largest component of the minorG((Π1/vs1..n).δ)is shown in Figure 4.3. It is clearly smaller

than the orginal state space shown in Figure 4.1 as well as the quotient system shown in Figure 4.2. To ensure correspondence between PDG symmetries and problem symmetries, we must ensure incompatible descriptive elements do not coalesce in the same orbit. For example, we cannot have action precondition vertices and state-variables in the same orbit.

Definition 31(Well-formed Partitions). A partition ofV(G(Π))iswell-formediff:

(i) Positive (u1>) and negative (u1⊥) variable assignment vertices only coalesce with ones of

the same parity;

(ii) Precondition (ap) and effect (ae) vertices only coalesce with preconditions and effects re-

spectively, and

(iii) Bothu1Iandu1Gare always in a singleton.

A well-formed partition Pˆ defines a corresponding partitionvs1..n ofD(Π), so that G(Π)/Pˆ = G(Π/vs1..n)

To ensure well-formedness, vertex symmetry is calculated using the coloured graph- isomorphism procedure (CGIP). Vertices of distinct colour cannot coalesce in the same orbit. Vertices ofG(Π)are coloured to ensure the orbits correspond to a well-formed partition.

4.5

Computing the Set of Instantiations

Recapping, symmetries in Πare the basis of a partition vs1..n of its domain D(Π) into orbits.

to orbits of concrete symbols. Our task now is to compute a set ofinstantiationsof the quotient which cover all the goal variablesD(G). Called a covering set of isomorphic subproblems, by instantiating a quotient plan for each subproblem and concatenating the results we intend to arrive at a concrete plan. We describe a pragmatic approach to obtaining that covering set. We establish that a covering set is not guaranteed to exist, and give an approach torefiningpartitions to mitigate that fact. We derive a theoretical bound on the necessary size of a covering set, and prove that a general graph formulation of the problem of computing a covering instantiation is NP-complete. Definition 32(Transversals, Instantiations). A transversaltis an injective choice function over a set of sets S such thatt(c) ∈ c for every equivalence classc ∈ S. A transversalcoversv if v∈ R(t). Ifvs1..nis a partition ofD(Π), we refer to a transversaltofvs1..nas aninstantiation

of Π/vs1..n. An instantiation t is consistent with a concrete problem Π if tLΠ/vs1..nM ⊆ Π.

When we use the term “problem” discussing an instantiationt, we intendtLΠ/vs1..nM. Note that D(tLΠ/vs1..nM) =R(t).

Example 23. Consider the sets = {a, b, c, d, e, f}, and the equivalence classesc1 = {a, b},

c2 ={c, d}andc3 ={e, f}of its members. For the partitionP ={c1, c2, c3}ofs,t1={a, c, e}

andt2={b, c, f}are two transversals.

For each goal variable in the problem, our approach shall need to find a consistent instantiation of the quotient which covers that. We thus face the following problem.

Problem 1. GivenΠand a partitionvs1..nofD(Π), is there an instantiation ofΠ/vs1..nconsistent

withΠthat covers a variablev ∈ D(Π)?

Example 24. Consider the planning problem Π1 from Example 22. Let instantiation t be {p1 7→ v3, p2 7→ v1, p3 7→ v4}. Then, t covers v4, and tLΠ1/vs1..nM has I = {v3,v1,v4},

A = {({v3,v1},{v4,v3}),(∅,{v3})} andG = {v4}. Thus, tLΠ1/vs1..nM ⊆ Π1, making t a

consistent instantiation and so a solution to Problem 1 with inputsΠ1,P andv4.

4.5.1 Finding Instantiations: Practice

We now describe how we obtain a set of isomorphic subproblems ofΠthat covers the goal vari- ables. We compute a set of instantiations, ∆, of the quotientΠ/vs1..n. Our algorithm first ini-

tialises that set of instantiations,∆ := ∅. Every iteration of themain loopcomputes a consistent instantiation that covers at least one variable v ∈ D(Π.G). This is done as follows: we create a new (partial) instantiationt = pv 7→ v, wherepv is the set invs1..n containingv. Then we

determine whether tcan be completed, to instantiate every set invs1..n, while being consistent

at the same time. This determination is achieved by posing the problem in the theory of uninter- preted functions, and using a satisfiability modulo theory (SMT) solver. Our encoding in SMT is constructive, and if a completion oftis possible the solver provides it. If successful, we set

∆ := ∆∪ {t}andG := G\ R(t), and loop. In the case the SMT solver reports failure, the concrete problem cannot be covered by instantiations of the descriptive quotient, and we report failure. In the worst case ofD(Π.G) =D(Π), ourmain loopexecutesΣp∈vs1..n|p| − |vs1..n|+ 1 times, and hence we have that many instantiations.

Scenarios need not admit a consistent instantiation. Example 25. TakeΠ2with

Π2.I = {v1,v2,v3}

Π2.δ = {({v1},{v2,v3}),({v2},{v1,v3})} Π2.G = {v3,v1,v2}

§4.5 Computing the Set of Instantiations 57

Letvs1..n={p1={v1,v2}, p2 ={v3}}. The quotientΠ2/vs1..nhas (Π2/vs1..n).I = {p1, p2}

2/vs1..n).δ = {({p1},{p1, p2})} (Π2/vs1..n).G = {p1, p2}

There are no consistent instantiations ofΠ2/vs1..nbecausev1andv2are in the same equivalence

class and also occur together in the same action.

Our example demonstrates a common scenario in the IPC benchmarks, where a partitionvs1..n

ofD(Π)does not admit a consistent instantiation because variables that occur in the same action coalesce in the same member ofvs1..n. We resolve this situation by refining the partition produced

using CGIP to avoid having such variables coalesce in the same orbit. For avs ∈vs1..n, consider

the graph G(vs) with vertices vs and edges {{v1,v2} | ∃π ∈ Π.δ∧ {v1,v2} ⊆ D(π) ∧v1 6=

v2}. The chromatic number N of G(vs) gives us the number of colours needed to colour the

corresponding verticesvsˆ in the PDG. Where two variables occur in the same action, their vertices in vsˆ are coloured differently. For everyvs ∈ vs1..n, we use an SMT solver to calculate the

required chromatic numbersN and graph colourings forG(vs), then we colour the corresponding vertices in the PDG according to the computed N-colouring of G(vs). Lastly, we again pass the PDG to a CGIP after it is recoloured. In 4benchmark sets the thus-revised partition admits a consistent instantiation where the initial partition does not. Although the chromatic number problem is NP-complete, this step is not a bottleneck in practice because the size of the instances that need to be solved is bounded above by the largest number of literals stated in any action. 4.5.2 Finding Instantiations: Theory

We first develop a theoretical bound on the number of required instantiations—by treating abstract covering transversals—that is tight compared to our pragmatic solution above. To characterise the complexity of our instantiation problem, we then study the general problem of computing covering transversals.

Theorem 15 (B. McKay, 2014). Let −be a group acting on a set V (e.g., D(Π)). Suppose t is a transversal of O, a set of orbits induced by the action of−on V. Take S = Σo∈O|o|and

M =maxo∈O|o|. Where•is composition, there will always be a set of transversalsT with size ≤Mln(S)such that

(i) Each elementt0 ∈ T satisfiest0=σ•tfor someσ∈ −, and (ii) For everyu1∈V, it has an elementt0 that coversu1.

Proof. TakeN = Mln(S)and letH be a subset of−obtained by drawingN permutations of V independently at random with replacement. For any orbito∈O, the probability for av ∈ois not inR(σ•t)for a randomly drawnσ ∈His1−1/|o|. LetT ={σ•t|σ ∈ H}andR =

S(RLTM

). DrawingN times from−to constructH, the probability thatv 6∈Ris(1−1/|o|)N.

Consider the random quantityZ = |V \R|with expected valueE(Z) = Σo∈O|o|(1−1/|o|)N.

Since 1−x < e−x forx > 0, we obtainE(Z) < Σo∈O|o|e(−N/|o|) ≤ Se−N/M = Se−ln(S). Fromxe−ln(x)= 1, it follows thatE(Z)<1. SinceZ ∈N, then probabilityZ = 0is more than

We conjecture that a much smaller number of transversals is actually required, and in all our experimentation have found that the following conjecture is not violated:

Conjecture 1. Let−be a group acting on a setV (e.g.,D(Π)). Supposetis a transversal ofO, a set of orbits induced by the action of−onV. TakeM =maxo∈O|o|. Where•is composition,

there will always be a set of transversalsT with size≤M such that (i) Each elementt0∈ T satisfiest0=σ•tfor someσ∈ −, and (ii) For everyu1∈V, it has an elementt0that coversu1.

We are left to formulate and study a general problem of instantiation, treating it as one of finding graph transversals.

Definition 33 (Consistent Graph Transversals). For a graph G and a partition P of V(G), a transversaltofP is consistent withGwhen an edge betweenp1andp2inE(G/P)exists iff there

is an edge betweent(p1)andt(p2)inE(G).

Example 26. Take G to be the hexagon that we have illustrated twice below in order to depict partitionsP1 ={{a, b},{c, d},{e, f}}andP2 ={p0 ={a, b, f}, p00={c, d, e}}on the left and

right respectively. a b c d e f a b c d e f

The vertices ofG/P1(a 3-clique) andG/P2(a 2-clique) are indicated above by red outlines. There

is no consistent transversal ofP1(LHS) because there is no 3-clique subgraph ofGwith one vertex

from each set inP1. ForG/P2(RHS),t1 ={p0 7→ f, p00 7→ e}is a transversal ofP2 consistent

withG, because the subgraph ofGinduced by{e, f}is a 2-clique with one vertex from each ofp0 andp00.

A transversal of a well-formed Pˆ consistent with G(Π) is isomorphic to an instantiation of

Π/vs1..nconsistent withΠ. Accordingly, Problem 1 is an instance of the following.

Problem 2. GivenG, a partitionP ofV(G)andu1 ∈V(G), is there a consistent transversal of

P which coversu1?

We now derive the complexity of Problem 2. We first show that the following problem is NP- complete, and use that result to show that Problem 2 is also NP-complete.

Problem 3. Given graphGand a partitionP ofV(G), is there a transversal ofP consistent with

G?

Lemma 7. Problem 3 is NP-complete.

Proof. Membership in NP is given because a transversal’s consistency can clearly be tested in polynomial-time. We then show the problem is NP-hard by demonstrating a polynomial-time reduction from SAT. Consider SAT problems given by formulae ϕin conjunctive normal form. Assume every pair of clauses is mutually satisfiable—i.e., for clausesc1, c2 ∈ϕ, for two literals

`1 ∈c1 and`2 ∈c2 we have`1 6= ¬`2 (when this assumption is violated, unsatisfiability can be