# A Symmetry-Breaking Node Equivalence for Pruning the Search Space in Backtracking Algorithms

^{*}

^{†}

## Abstract

**:**

## 1. Introduction

- The definition of a novel vertex equivalence on graphs, which is simple to use in various backtracking algorithms and, even more importantly, very lightweight, i.e., it introduces very little computational overhead on the existing backtracking algorithms.
- Even though we start with the subgraph isomorphism, we show that exploratory equivalence can be applied to a broader set of search problems. Whenever the goal of the problem in question is to find an injective mapping between a given pair of sets that satisfies a certain predicate, exploratory equivalence can be used to speed up the backtracking-based search approach. Furthermore, the EE-based performance improvement technique that we describe in this paper can be employed in addition to other search-space pruning methods, not just instead of them.
- We analyze the computational complexity of the defined optimization problem. More precisely, we show that the verifier for the optimization problem is at least as hard as the graph isomorphism problem and at most as hard as the setwise stabilizer problem. As a consequence, the decision version of MaxEE at present cannot be classified as a member of $\mathcal{NP}$.
- We develop a heuristic method for solving the MaxEE problem. We were able to see the practicality of this method in our practical assessment on a set of realistic graphs.
- For two families of graphs, namely trees and cycles, we provide exact and efficient methods for finding the optimal exploratory efficient partition. For the trees we devise a quadratic algorithm and for cycles we provide an analytic solution that gives a formula for the optimal solution for any cycle.

## 2. Related Work

**Graph theory.**The basic problem when dealing with symmetries is the graph isomorphism (or more precisely graph automorphism) problem, which is the cornerstone of theoretical computer science. Even though it is still not known to be in $\mathcal{P}$, highly efficient implementations [13] made this problem practical quite some time ago. Even more encouragingly, recent advances by Babai [14] brought this problem much closer to $\mathcal{P}$ also in theory. The practicality of the graph isomorphism problem is highly important in this context, since we heavily rely on existing solvers to produce graph automorphisms and we strive for immediate practical use of the algorithms presented in this paper as well.

**CSP, IP, and SAT**Symmetry-breaking is a common technique in constraint satisfaction problems, integer programming, and satisfiability [23,24]. Similar to the distinguishing coloring for graphs, Crawford et al. [25] tried to capture all symmetries in any propositional satisfiability problem and demonstrated how it can be used in constraint satisfaction problem. The symmetries are described as a tree of symmetry-breaking predicates that can be used as a preprocessing step for speeding up of search algorithms. However, there are many drawbacks to this approach, most notably: (1) the intractability of producing such a tree; and (2) the potentially exponential size of the resulting tree. Again, our goals are different; we do not wish to capture all the symmetries, but instead strive for the simplicity of the devised mechanism. In addition, we always work with the compact representation of the symmetries, i.e., the polynomial-size generating set of the automorphism group. The resulting exploratory equivalence produces extremely simple symmetry breaking predicates, thus inducing almost no overhead during the search process.

## 3. Preliminaries

## 4. Framework for Backtracking Search Algorithms

**Definition**

**1.**

- A partial monomorphism m: The current mapping from A to B, where only some of the elements of A are mapped.
- The index $idx$ of an element of A: The depth of the search tree, which also represents the index of the element $a\in A$ currently being mapped to B.
- An ordering of the set A: A bijective function $or{d}_{A}:A\to \{1,\dots ,|A\left|\right\}$, which represents the order in which the elements of A are being assigned to the elements of B. We use $or{d}_{A}\left(a\right)$ to find the order of the element a, and $or{d}_{A}^{-1}\left(idx\right)$ to find the element having rank $idx$. As a shorthand, when dealing with sets of elements (sets of indices), we use $or{d}_{A}\left(S\right)$ to denote the set of indices of the elements $a\in S$ and $or{d}_{A}^{-1}\left(S\right)$ to denote the set of elements at the indices $i\in S$.
- An ordering of the set B: A bijective function $or{d}_{B}:B\to \{1,\dots ,|B\left|\right\}$, which represents the order in which the elements of B are selected as the images of $a\in A$.
- An exploratory equivalent partition of the set A: A set of disjoint sets $\{{P}_{1},{P}_{2},\dots ,{P}_{k}\}$ covering the set A. We use $e{q}_{A}\left(a\right)$ to denote the class ${P}_{i}$ that contains the element a.
- A predicate $P:(A\to B)\to \{true,false\}$ that defines the goal of the search problem. It describes the problem-specific structure that we are searching for.

Algorithm 1: Backtracking algorithm find for the monomorphism search problem. |

## 5. Exploratory Equivalence and Maximum Exploratory Equivalence

#### 5.1. Exploratory Equivalence

**Definition**

**2.**

**3**4

**5**6, where $a\left(3\right)=3$ and $a\left(5\right)=5$, as well as 21

**5**6

**3**4, where $a\left(3\right)=5$ and $a\left(5\right)=3$.

**Definition**

**3.**

**Definition**

**4.**

#### 5.2. Maximum Exploratory Equivalence

**Definition**

**5.**

## 6. Computational Complexity

**Definition**

**6.**

**Theorem**

**1.**

**Proof.**

**Definition**

**7.**

**Lemma**

**1.**

**Proof.**

**Theorem**

**2.**

**Proof.**

**Lemma**

**2.**

**Proof.**

**Theorem**

**3.**

**Proof.**

Algorithm 2: Algorithm for computing VerifyEE. |

## 7. Algorithms

#### 7.1. Heuristics for General Graphs

Algorithm 3: Heuristics for the MaxEE problem. |

- The set ${P}_{k}$ is augmented by a single element (the call to augment computes the best candidate for augmentation; see Lines 10 and 13).
- ${P}_{k}$ is finalized, a new pair of elements is selected as the set ${P}_{k+1}$, and A is pointwise stabilized on ${P}_{k}$ (bestEEPair returns the pair of elements that exhibit the best potential; see Lines 11 and 15).

Algorithm 4: The definition of two auxiliary functions |

#### Time Complexity

#### 7.2. Exact Algorithm on Trees

**Lemma**

**3.**

**Lemma**

**4.**

**Proof.**

**Lemma**

**5.**

- (1)
- If the tree has a single center, then $d(u,c)=d(v,c)$.
- (2)
- If the tree has two distinct centers, then $d(u,{c}_{1})=d(v,{c}_{1})$ if $d(u,v)$ is even and $d(u,{c}_{1})=d(v,{c}_{2})$ if $d(u,v)$ is odd.
- (3)
- $\mathit{CS}\left(u\right)\simeq \mathit{CS}\left(v\right)$.

**Proof.**

- (1)
- By Lemma 4, a tree with a single center c contains distinct vertices ${u}^{\prime}$ and ${v}^{\prime}$ such that $d(c,{u}^{\prime})=d(c,{v}^{\prime})=e$ and the paths from c to ${u}^{\prime}$ and from c to ${v}^{\prime}$ are disjoint. Without loss of generality, we may assume that $d(u,c)<d(v,c)$ and that the vertex v does not lie on the path from c to ${u}^{\prime}$ (if it does, we can swap ${u}^{\prime}$ and ${v}^{\prime}$). The distance from v to ${u}^{\prime}$ is $D=d(v,c)+d(c,{u}^{\prime})=d(v,c)+e$. However, the most distant vertex from u can be at most $d(u,c)+e\le D-1$ edges away from u. Therefore, the tree ${\mathit{NS}}_{D}\left(v\right)$ has more vertices than ${\mathit{NS}}_{D-1}\left(v\right)$, but the tree ${\mathit{NS}}_{D}\left(u\right)$ is the same as ${\mathit{NS}}_{D-1}\left(u\right)$. Consequently, u and v cannot be automorphically mapped to each other and hence cannot belong to the same orbit.
- (2)
- Lemma 4 ensures the existence of vertices ${u}^{\prime}$ and ${v}^{\prime}$ such that $d({c}_{1},{u}^{\prime})=d({c}_{2},{v}^{\prime})=e-1$ and the paths from ${c}_{1}$ to ${u}^{\prime}$ and from ${c}_{2}$ to ${v}^{\prime}$ are disjoint. Let the vertices u and v belong to the same orbit, and let us assume that $d(u,v)$ is even. If u and v belong to the centrifugal subtrees of different centers (say, u belongs to $\mathit{CS}\left({c}_{1}\right)$ and v to $\mathit{CS}\left({c}_{2}\right)$), then $d(u,{c}_{1})\ne d(v,{c}_{2})$, contradicting our assumption that u and v are both part of the same orbit: $d(u,{c}_{1})<d(v,{c}_{2})$ implies that the vertex ${u}^{\prime}$ is located $d(v,{c}_{2})+e$ edges away from v but there is no such vertex at the same distance from u, and a symmetrical conclusion follows from $d(u,{c}_{1})>d(v,{c}_{2})$. Therefore, an even value of $d(u,v)$ means that u and v both belong to either $\mathit{CS}\left({c}_{1}\right)$ or $\mathit{CS}\left({c}_{2}\right)$ and (by applying a distance-based argument once again) that $d(u,{c}_{1})=d(v,{c}_{1})$. In a similar fashion, we can show that an odd value of $d(u,v)$ means that u belongs to $\mathit{CS}\left({c}_{1}\right)$ and v to $\mathit{CS}\left({c}_{2}\right)$ (or the other way around) and that $d(u,{c}_{1})=d(v,{c}_{2})$.
- (3)
- If the subtrees $\mathit{CS}\left(u\right)$ and $\mathit{CS}\left(v\right)$ are non-isomorphic, there exists some distance d at which the neighborhood subtrees of u and v are non-isomorphic. Therefore, no automorphism can map u to v and vice versa, and so these two vertices do not belong to the same orbit.

**Lemma**

**6.**

- (1)
- for each $i\in \{1,\dots ,s\}$, all vertices in ${P}_{i}$ belong to the same orbit of T;
- (2)
- for each $i\in \{2,\dots ,s\}$ and for all pairs $u,v\in {P}_{i}$, we have $d(u,v)=2$;
- (3)
- either (i) $d(u,v)=2$ for all pairs $u,v\in {P}_{1}$ or (ii) ${P}_{1}=\{{c}_{1},{c}_{2}\}$ and ${c}_{1}\ne {c}_{2}$;
- (4)
- if $i\ne j$ and there exists a vertex $v\in {P}_{i}$ such that ${P}_{j}\subseteq \mathit{CS}\left(v\right)$, then $j>i$.

**Proof.**

**Theorem**

**4.**

**Proof.**

Algorithm 5: A polynomial-time algorithm to find a maximum EE partition for a tree T. |

#### 7.3. Exact Algorithm on Cycles

**Lemma**

**7.**

**Proof.**

**Lemma**

**8.**

**Proof.**

**Lemma**

**9.**

**Proof.**

**Lemma**

**10.**

**Proof.**

**Lemma**

**11.**

**Proof.**

**Lemma**

**12.**

**Proof.**

**Theorem**

**5.**

- $\{n/3,\phantom{\rule{0.166667em}{0ex}}2n/3,\phantom{\rule{0.166667em}{0ex}}n\mid singletons\}$ if $n=3k$;
- $\{1,\phantom{\rule{0.166667em}{0ex}}3\mid 2,\phantom{\rule{0.166667em}{0ex}}n/2+2\mid singletons\}$ if $n=6k-4$ or $n=6k-2$; and
- $\{1,\phantom{\rule{0.166667em}{0ex}}2\mid singletons\}$ if $n=6k-5$ or $n=6k-1$.

## 8. Application to the Subgraph Isomorphism Problem

## 9. Conclusions and Discussion

- Since it was empirically established in [49], symmetries arise surprisingly often in real graphs, which makes it a compelling argument to finally introduce a symmetry-breaking method into state-of-the-art solvers.
- As mentioned above, one of the goals to design a lightweight mechanism, which would induce a minimal overhead in the backtracking algorithm. We achieved this goal, since after the exploratory equivalent partition is detected (as part of the preprocessing), the backtracking algorithm just utilizes the induced constraints which follow from the partition.
- As a downside, the method might become unfeasible when very large graphs are being mapped. However, in such cases, other methods might also fail to find solutions in reasonable time.

## Author Contributions

## Funding

## Conflicts of Interest

## Abbreviations

EE | Exploratory Equivalence |

GI | Graph Isomorphism |

MaxEE | Maximum Exploratory Equivalence |

MaxEEDec | Decision version of MaxEE |

VerifyEE | problem of checking if a partition is EE |

## References

- Leach, A.R.; Gillet, V.J. An Introduction to Chemoinformatics; Springer: Berlin, Germany, 2007. [Google Scholar]
- Rekers, J.; Schürr, A. Defining and Parsing Visual Languages with Layered Graph Grammars. J. Vis. Lang. Comput.
**1997**, 8, 27–55. [Google Scholar] [CrossRef] - Fürst, L.; Mernik, M.; Mahnič, V. Improving the graph grammar parser of Rekers and Schürr. IET Softw.
**2011**, 5, 246–261. [Google Scholar] [CrossRef] - Cook, S.A. The complexity of theorem-proving procedures. In Proceedings of the 3rd Annual ACM Symposium on Theory of Computing (STOC), Shaker Heights, OH, USA, 3–5 May 1971; pp. 151–158. [Google Scholar] [CrossRef]
- Arora, S.; Barak, B. Computational Complexity: A Modern Approach; Cambridge University Press: Cambridge, UK, 2009. [Google Scholar]
- Fomin, F.V.; Kratsch, D. Exact Exponential Algorithms; Springer: Berlin, Germany, 2011. [Google Scholar]
- Ullmann, J.R. An Algorithm for Subgraph Isomorphism. J. Assoc. Comput. Mach.
**1976**, 23, 31–42. [Google Scholar] [CrossRef] [Green Version] - Cordella, L.P.; Foggia, P.; Sansone, C.; Vento, M. A (sub)graph isomorphism algorithm for matching large graphs. IEEE Trans. Pattern Anal. Mach. Intell.
**2004**, 26, 1367–1372. [Google Scholar] [CrossRef] - Čibej, U.; Mihelič, J. Improvements to Ullmann’s Algorithm for the Subgraph Isomorphism Problem. Int. J. Pattern Recognit. Artif. Intell.
**2015**, 29, 1550025. [Google Scholar] [CrossRef] - Bonnici, V.; Giugno, R.; Pulvirenti, A.; Shasha, D.; Ferro, A. A subgraph isomorphism algorithm and its application to biochemical data. BMC Bioinform.
**2013**, 14, S13. [Google Scholar] [CrossRef] - Kotthoff, L.; McCreesh, C.; Solnon, C. Portfolios of Subgraph Isomorphism Algorithms. In Learning and Intelligent Optimization; Festa, P., Sellmann, M., Vanschoren, J., Eds.; Springer International Publishing: Cham, Switzerland, 2016; pp. 107–122. [Google Scholar] [Green Version]
- Carletti, V.; Foggia, P.; Saggese, A.; Vento, M. Introducing VF3: A New Algorithm for Subgraph Isomorphism. In Graph-Based Representations in Pattern Recognition; Foggia, P., Liu, C.L., Vento, M., Eds.; Springer International Publishing: Cham, Switzerland, 2017; pp. 128–139. [Google Scholar]
- McKay, B.D. Practical Graph Isomorphism. Congr. Numer.
**1981**, 30, 45–87. [Google Scholar] [CrossRef] - Babai, L. Graph Isomorphism in Quasipolynomial Time. In Proceedings of the forty-eighth annual ACM Symposium on Theory of Computing, Portland, OR, USA, 14–17 June 2015; pp. 684–697. [Google Scholar]
- Albertson, M.O.; Collins, K.L. Symmetry breaking in graphs. Electron. J. Combin.
**1996**, 3, R18. [Google Scholar] - Cheng, C.T. On computing the distinguishing numbers of trees and forests. Electron. J. Combin.
**2006**, 13, R11. [Google Scholar] - Imrich, W.; Klavžar, S. Distinguishing Cartesian powers of graphs. J. Graph Theory
**2006**, 53, 250–260. [Google Scholar] [CrossRef] - Russell, A.; Sundaram, R. A note on the asymptotics and computational complexity of graph distinguishability. Electron. J. Combin.
**1998**, 5, R23. [Google Scholar] - Arvind, V.; Cheng, C.T.; Devanur, N.R. On computing the distinguishing numbers of planar graphs and beyond: A counting approach. SIAM J. Discret. Math.
**2008**, 22, 1297–1324. [Google Scholar] [CrossRef] - Everett, M.G.; Borgatti, S.P. Regular equivalence: General theory. J. Math. Sociol.
**1994**, 19, 29–52. [Google Scholar] [CrossRef] - Everett, M.G.; Borgatti, S.P. Computing Regular Equivalence: Practical and Theoretical Issues. Metodološki Zvezki
**2002**, 17, 31–42. [Google Scholar] - Sailer, L.D. Structural Equivalence: Meaning and Definition, Computation and Application. Soc. Netw.
**1978**, 1, 73–90. [Google Scholar] [CrossRef] - Knuth, D.E. The Art of Computer Programming. Volume 4B. Combinatorial Algorithms: Part 2; The Art of Computer Programming; Addison-Wesley Professional: Boston, MA, USA, 2016. [Google Scholar]
- Junttila, T.; Karppa, M.; Kaski, P.; Kohonen, J. An Adaptive Prefix-Assignment Technique for Symmetry Reduction. In Theory and Applications of Satisfiability Testing—SAT 2017; Gaspers, S., Walsh, T., Eds.; Springer International Publishing: Cham, Switzerland, 2017; pp. 101–118. [Google Scholar] [Green Version]
- Crawford, J.; Ginsberg, M.; Luks, E.; Roy, A. Symmetry-Breaking Predicates for Search Problems. In Proceedings of the Fifth International Conference Principles of Knowledge Representation and Reasoning, (KR ’96), Cambridge, MA, USA, 5–8 November 1996. [Google Scholar]
- Margot, F. Symmetry in Integer Linear Programming. In 50 Years of Integer Programming 1958–2008: From the Early Years to the State-of-the-Art; Jünger, M., Liebling, M.T., Naddef, D., Nemhauser, L.G., Pulleyblank, R.W., Reinelt, G., Rinaldi, G., Wolsey, A.L., Eds.; Springer: Berlin/Heidelberg, Germany, 2010; pp. 647–686. [Google Scholar]
- Gent, I.P.; Petrie, K.E.; Puget, J.F. Symmetry in constraint programming. Handbook of Constraint Programming; Elsevier Science: Amsterdam, The Netherlands, 2006; Volume 10, pp. 329–376. [Google Scholar]
- Petrie, K.E.; Smith, B.M. Comparison of symmetry breaking methods in constraint programming. Proc. SymCon05
**2005**. [Google Scholar] - The GAP Group. GAP—Groups, Algorithms, and Programming, Version 4.8.3; The GAP Group: Glasgow, UK, 2016. [Google Scholar]
- Gent, I.P.; Harvey, W.; Kelsey, T. Groups and constraints: Symmetry breaking during search. In Principles and Practice of Constraint Programming—CP 2002; Springer: Berlin/Heidelberg, Germany, 2002; pp. 415–430. [Google Scholar]
- Brown, C.A.; Finkelstein, L.; Purdom, P.W. Backtrack searching in the presence of symmetry. In Applied Algebra, Algebraic Algorithms and Error-Correcting Codes, Proceedings of the 6th International Conference, AAECC-6, Rome, Italy, 4–8 July 1988; Mora, T., Ed.; Springer: Berlin/Heidelberg, Germany, 1989; pp. 99–110. [Google Scholar] [CrossRef]
- Puget, J.F. Symmetry Breaking Revisited. In Principles and Practice of Constraint Programming—CP 2002, Proceedings of the 8th International Conference, CP 2002, Ithaca, NY, USA, 9–13 September 2002; Hentenryck, P., Ed.; Springer: Berlin/Heidelberg, Germany, 2002; pp. 446–461. [Google Scholar] [CrossRef] [Green Version]
- Fahle, T.; Schamberger, S.; Sellmann, M. Symmetry Breaking. In Principles and Practice of Constraint Programming—CP 2001, Proceedings of the 7th International Conference, CP 2001, Paphos, Cyprus, 26 November–1 December 2001; Walsh, T., Ed.; Springer: Berlin/Heidelberg, Germany, 2001; pp. 93–107. [Google Scholar] [CrossRef]
- Margot, F. Exploiting orbits in symmetric ILP. Math. Program.
**2003**, 98, 3–21. [Google Scholar] [CrossRef] - Bodlaender, H.L.; Fomin, F.V.; Koster, A.M.C.A.; Kratsch, D.; Thilikos, D.M. A Note on Exact Algorithms for Vertex Ordering Problems on Graphs. Theory Comput. Syst.
**2011**, 50, 420–432. [Google Scholar] [CrossRef] [Green Version] - Garey, M.R.; Graham, R.L.; Johnson, D.S.; Knuth, D.E. Complexity results for bandwidth minimization. SIAM J. Appl. Math.
**1978**, 34, 477–495. [Google Scholar] [CrossRef] - Bodlaender, H.L.; Fomin, F.V.; Koster, A.M.C.A.; Kratsch, D.; Thilikos, D.M. On Exact Algorithms for Treewidth. ACM Trans. Algorithms
**2012**, 9, 12:1–12:23. [Google Scholar] [CrossRef] - Luks, E.M. Permutation groups and polynomial-time computation. In Groups and Computation: Workshop on Groups and Computation, October 7–10, 1991; American Mathematical Society: Providence, RI, USA, 1993; Volume 11, p. 139. [Google Scholar]
- Seress, Á. Permutation Group Algorithms; Cambridge Tracts in Mathematics; Cambridge University Press: Cambridge, MA, USA, 2003. [Google Scholar]
- Arvind, V.; Torán, J. Isomorphism Testing: Perspective and Open Problems. Bull. EATCS
**2005**, 86, 66–84. [Google Scholar] - Knuth, D.E. The Art of Computer Programming, Volume 1: Fundamental Algorithms, 3rd ed.; Addison-Wesley Professional: Boston, MA, USA, 1997. [Google Scholar]
- Colbourn, C.J.; Booth, K.S. Linear Time Automorphism Algorithms for Trees, Interval Graphs, and Planar Graphs. SIAM J. Comput.
**1981**, 10, 203–225. [Google Scholar] [CrossRef] - Fürst, L.; Čibej, U.; Mihelič, J. Iskanje vzorčnih grafov s pomočjo iskalnega načrta ob prisotnosti avtomorfizmov [Searching for pattern graphs using a search plan in the presence of automorphisms]. Elektrotehniški Vestnik
**2018**, 85, 162–168. [Google Scholar] - Kunegis, J. KONECT: The Koblenz network collection. In Proceedings of the International Conference on World Wide Web Companion, Rio de Janeiro, Brazil, 13–17 May 2013; pp. 1343–1350. [Google Scholar] [CrossRef]
- Leskovec, J.; Krevl, A. SNAP Datasets: Stanford Large Network Dataset Collection. 2014. Available online: http://snap.stanford.edu/data (accessed on 5 October 2019).
- McKay, B.D.; Piperno, A. Practical graph isomorphism, II. J. Symb. Comput.
**2014**, 60, 94–112. [Google Scholar] [CrossRef] - Melckenbeeck, I.; Audenaert, P.; Colle, D.; Pickavet, M. Efficiently counting all orbits of graphlets of any order in a graph using autogenerated equations. Bioinformatics
**2017**, 34, 1372–1380. [Google Scholar] [CrossRef] - McCreesh, C.; Prosser, P.; Solnon, C.; Trimble, J. When subgraph isomorphism is really hard, and why this matters for graph databases. J. Artif. Intell. Res.
**2018**, 61, 723–759. [Google Scholar] [CrossRef] - Ball, F.; Geyer-Schulz, A. How Symmetric Are Real-World Graphs? A Large-Scale Study. Symmetry
**2018**, 10, 29. [Google Scholar] [CrossRef]

**Figure 2.**The Hasse diagram of all EE partitions of the graph G in Figure 1. (The four partitions on the right-hand side are actually four separate vertices in the diagram.)

**Figure 6.**An illustration of the proof of Lemma 6: (

**Left**) $\mathrm{Aut}\left(T\right)$ covers ${P}_{1}=\{{u}_{11},\dots ,{u}_{1{k}_{1}}\}$ provided that $\mathit{CS}\left({u}_{11}\right)\simeq \dots \simeq \mathit{CS}\left({u}_{1{k}_{1}}\right)$; and (

**Right**) $\mathrm{Aut}\left(T\right)$ covers ${P}_{2}=\{{u}_{21},\dots ,{u}_{2{k}_{2}}\}$ even after $\mathrm{Aut}\left(T\right)$ is pointwise-stabilized with respect to ${P}_{1}$.

**Figure 7.**An illustration of the situation in which the class $\{{v}_{1},\dots ,{v}_{k}\}$ in an EE partition can be replaced by the class $\{{v}_{1}^{\prime},\dots ,{v}_{k}^{\prime}\}$. It holds that $\mathit{CS}\left({v}_{1}\right)\simeq \dots \simeq \mathit{CS}\left({v}_{k}\right)$ and consequently also $\mathit{CS}\left({v}_{1}^{\prime}\right)\simeq \dots \simeq \mathit{CS}\left({v}_{k}^{\prime}\right)$.

**Figure 8.**The maximum EE partition produced by Algorithm 5 for a sample tree. Different equivalence classes are highlighted by different colors. The uncolored vertices (1, 4, 5, 6, and 7) occur in the maximum EE partition as singletons.

**Figure 9.**The ratio ${t}_{\mathrm{naive}}/{t}_{\mathrm{EE}}$ when searching for the occurrences of ${K}_{4}$ in ${K}_{n}$.

**Table 2.**Pattern graphs used in our experiments. In the same fashion as in Figure 8, different colors indicate different equivalence classes in the optimal EE partition, and the uncolored vertices constitute the singleton classes.

Pattern Graph (G) | ${\mathit{L}}_{4}$ | ${\mathit{C}}_{4}$ | ${\mathit{K}}_{4}$ |
---|---|---|---|

Structure and maximum EE partition | |||

$\left|\mathrm{Aut}\right(G\left)\right|$ | 2 | 8 | 24 |

Score of max. EE part. | 2 | 4 | 24 |

Search plan used in the experiments | $[1]$ $[1\to 2]$ $[2\to 3]$ $[3\to 4]$ | $[1]$ $[1\to 2]$ $[2\to 3]$ $[3\to 4]$ $[1?4]$ | $[1]$ $[1\to 2]$ $[2\to 3]$ $[1?3]$ $[3\to 4]$ $[1?4]$ $[2?4]$ |

**Table 3.**Subgraph isomorphism search using a search-plan-based algorithm: comparing a naïve version and a version that employs exploratory equivalence. All the times are in milliseconds.

H | G | N | ${\mathit{t}}_{\mathbf{naive}}$ | ${\mathit{t}}_{\mathbf{EE}}$ | ${\mathit{t}}_{\mathbf{naive}}/{\mathit{t}}_{\mathbf{EE}}$ |
---|---|---|---|---|---|

Les Misérables | ${L}_{4}$ | 26,784 | 3.47 | 1.94 | 1.8 |

$\left|V\right|=77$ | ${C}_{4}$ | 2672 | 8.88 | 3.71 | 2.4 |

$\left|E\right|=254$ | ${K}_{4}$ | 639 | 7.62 | 0.77 | 9.9 |

US Power Grid | ${L}_{4}$ | 52,556 | 13.1 | 8.49 | 1.5 |

$\left|V\right|=4941$ | ${C}_{4}$ | 979 | 11.6 | 4.51 | 2.6 |

$\left|E\right|=6594$ | ${K}_{4}$ | 90 | 6.63 | 2.36 | 2.8 |

David Copperfield | ${L}_{4}$ | 61,254 | 7.86 | 4.53 | 1.7 |

$\left|V\right|=112$ | ${C}_{4}$ | 2579 | 9.36 | 2.92 | 3.2 |

$\left|E\right|=425$ | ${K}_{4}$ | 58 | 5.80 | 0.94 | 6.2 |

Jazz Musicians | ${L}_{4}$ | 3,850,915 | 483 | 256 | 1.9 |

$\left|V\right|=198$ | ${C}_{4}$ | 406,441 | 866 | 245 | 3.5 |

$\left|E\right|=2742$ | ${K}_{4}$ | 78,442 | 667 | 42.6 | 15.7 |

ca-HepTh | ${L}_{4}$ | 4,207,311 | 545 | 305 | 1.8 |

$\left|V\right|=9877$ | ${C}_{4}$ | 239,081 | 627 | 198 | 3.2 |

$\left|E\right|=$ 25,973 | ${K}_{4}$ | 65,592 | 364 | 35.8 | 10.2 |

ca-CondMat | ${L}_{4}$ | 50,543,325 | 6390 | 3520 | 1.8 |

$\left|V\right|=$ 23,133 | ${C}_{4}$ | 1,505,383 | 9920 | 2570 | 3.9 |

$\left|E\right|=$ 93,439 | ${K}_{4}$ | 294,008 | 3720 | 266 | 14.0 |

**Table 4.**Empirical evaluation of MaxEE on the set of all connected simple graphs of sizes 4–10 nodes. We counted the cumulative number of all symmetries on these sets ($\mathrm{sym}.$), the sum of all optimal goal values for MaxEE ($\mathrm{opt}.$), and the sum of all goal values obtained by the greedy heuristics ($\mathrm{greedy}$).

Size | # of Graphs | sym. | opt. | $\frac{\mathbf{opt}.}{\mathbf{sym}.}$ | Greedy | $\frac{\mathbf{greedy}}{\mathbf{opt}.}$ |
---|---|---|---|---|---|---|

4 | 6 | 46 | 42 | 0.91 | 42 | 1.0 |

5 | 21 | 242 | 226 | 0.93 | 226 | 1.0 |

6 | 112 | 1650 | 1522 | 0.92 | 1490 | 0.97 |

7 | 853 | 11,338 | 10,910 | 0.96 | 10,850 | 0.99 |

8 | 11,117 | 100,648 | 96,896 | 0.96 | 96,588 | 0.99 |

9 | 261,080 | 1,154,556 | 1,133,514 | 0.98 | 1,131,216 | 0.99 |

10 | 11,716,571 | 24,724,920 | 24,529,766 | 0.99 | 24,515,292 | 0.99 |

© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Čibej, U.; Fürst, L.; Mihelič, J.
A Symmetry-Breaking Node Equivalence for Pruning the Search Space in Backtracking Algorithms. *Symmetry* **2019**, *11*, 1300.
https://doi.org/10.3390/sym11101300

**AMA Style**

Čibej U, Fürst L, Mihelič J.
A Symmetry-Breaking Node Equivalence for Pruning the Search Space in Backtracking Algorithms. *Symmetry*. 2019; 11(10):1300.
https://doi.org/10.3390/sym11101300

**Chicago/Turabian Style**

Čibej, Uroš, Luka Fürst, and Jurij Mihelič.
2019. "A Symmetry-Breaking Node Equivalence for Pruning the Search Space in Backtracking Algorithms" *Symmetry* 11, no. 10: 1300.
https://doi.org/10.3390/sym11101300