Abstract
Graph comparison is an established NP-hard problem. In this paper, we present an efficiently scaling quantum algorithm which finds the size of the maximum common edge subgraph for any pair of unlabelled graphs and thus provides a meaningful measure of graph similarity. The algorithm makes use of a two-part quantum dynamic process: in the first part, we obtain information crucial for the comparison of two graphs through linear quantum computation. However, this information is hidden in the quantum system with such a vanishingly small amplitude that even quantum algorithms such as Grover’s search are not fast enough to distil it efficiently. In order to extract the information, we call upon techniques in nonlinear quantum computing to provide the speed-up necessary for an efficient algorithm. The linear quantum circuit requires \(\mathcal {O}(n^3 \log ^3 (n) \log \log (n))\) elementary quantum gates, and the nonlinear evolution under the Gross–Pitaevskii equation has a time scaling of \(\mathcal {O}(\frac{1}{g} n^2 \log ^3 (n) \log \log (n))\), where n is the number of vertices in each graph and g is the strength of the Gross–Pitaevskii nonlinearity. Through this example, we demonstrate the power of nonlinear quantum search techniques to solve a subset of NP-hard problems.
Similar content being viewed by others
References
Koutra, D., Vogelstein, J.T., Faloutsos, C.: DELTACON: A Principled Massive-Graph Similarity Function. ArXiv e-prints (2013)
Baláž, V., Koča, J., Kvasnička, V., Sekanina, M.: A metric for graphs. Časopis pro pěstování matematiky 111(4), 431–433 (1986)
Umeyama, S.: An eigendecomposition approach to weighted graph matching problems. IEEE Trans. Pattern Anal. Mach. Intell. 10(5), 695–703 (1988)
Jiang, T., Wang, L., Zhang, K.: Alignment of trees—an alternative to tree edit. Theor. Comput. Sci. 143(1), 137–148 (1995)
Dehmer, M., Emmert-Streib, F., Kilian, J.: A similarity measure for graphs with low computational complexity. Appl. Math. Comput. 182(1), 447–459 (2006)
Rossi, R., Torsello, A., Hancock, E.R.: Measuring graph similarity through continuous-time quantum walks and the quantum Jensen–Shannon divergence. Phys. Rev. E 91(2), 2 (2015)
Abrams, D.S., Lloyd, S.: Nonlinear quantum mechanics implies polynomial-time solution for np-complete and# p problems. Phys. Rev. Lett. 81(18), 3992 (1998)
Childs, A.M., Young, J.: Optimal state discrimination and unstructured search in nonlinear quantum mechanics. Phys. Rev. A 93(2), 022314 (2016)
Bokhari, S.H.: On the mapping problem. IEEE Trans. Comput. 30(3), 207–214 (1981)
Bahiense, L., Manić, G., Piva, B., De Souza, C.C.: The maximum common edge subgraph problem: a polyhedral investigation. Discrete Appl. Math. 160(18), 2523–2541 (2012)
Sanfeliu, A., King-Sun, F.: A distance measure between attributed relational graphs for pattern recognition. IEEE Trans. Syst. Man. Cybern. 3, 353–362 (1983)
Durr, C., Hoyer, P.: A quantum algorithm for finding the minimum. arXiv preprint arXiv:quant-ph/9607014 (1996)
Baritompa, W.P., Bulger, D.W., Wood, G.R.: Grover’s quantum algorithm applied to global optimization. SIAM J. Optim. 15(4), 1170–1184 (2005)
Abrams, D.S., Lloyd, S.: Simulation of many-body fermi systems on a universal quantum computer. Phys. Rev. Lett. 79, 2586–2589 (1997)
Sedgewick, R.: Permutation generation methods. ACM Comput. Surv. 9(2), 137–164 (1977)
Brassard, G., Hoyer, P., Mosca, M., Tapp, A.: Quantum Amplitude Amplification and Estimation. eprint arXiv:quant-ph/0005055 (2000)
Cleve, R., Ekert, A., Macchiavello, C., Mosca, M.: Quantum algorithms revisited. Proc. R. Soc. Lond. A Math. Phys. Eng. Sci. 454, 339–354 (1998)
Lee, C.M., Selby, J.H.: Generalised phase kick-back: the structure of computational algorithms from physical principles. New J. Phys. 18(3), 033023 (2016)
Barenco, A., Bennett, C.H., Cleve, R., et al.: Elementary gates for quantum computation. Phys. Rev. A 52(5), 3457 (1995)
Berry, D.W., Kieferová, M., Scherer, A., Sanders, Y.R., Guang, H.L., Wiebe, N., Gidney, C., Babbush, R.: Improved techniques for preparing eigenstates of fermionic hamiltonians. NPJ Quantum Inf 4, 1–7 (2018)
Vedral, V., Barenco, A., Ekert, A.: Quantum networks for elementary arithmetic operations. Phys. Rev. A 54, 147–153 (1996)
Meyer, D.A., Wong, T.G.: Nonlinear quantum search using the Gross–Pitaevskii equation. New J. Phys. 15(6), 063014 (2013)
Meyer, D.A., Wong, T.G.: Quantum search with general nonlinearities. Phys. Rev. A 89(1), 012312 (2014)
Kahou, M.E., Feder, D.L.: Quantum search with interacting Bose–Einstein condensates. Phys. Rev. A 88(3), 032310 (2013)
de Lacy, K., Noakes, L.: Controlled Quantum Search. ArXiv e-prints (2017)
Maeda, M., Sasaki, H., Segawa, E., Suzuki, A., Suzuki, K.: Scattering and inverse scattering for nonlinear quantum walks. ArXiv e-prints (2018)
Maeda, M., Sasaki, H., Segawa, E., Suzuki, A., Suzuki, K.: Weak limit theorem for a nonlinear quantum walk. Quantum Inf. Process. 17, 215 (2018)
Maeda, M., Sasaki, H., Segawa, E., Suzuki, A., Suzuki, K.: On nonlinear scattering for quantum walks. ArXiv e-prints (2017)
Alberti, A., Wimberger, S.: Quantum walk of a Bose–Einstein condensate in the Brillouin zone. Phys. Rev. A 96(2), 023620 (2017)
Lucas, A.: Ising formulations of many NP problems. Front. Phys. 2, 5 (2014)
Acknowledgements
We thank Jason Twamley and Lyle Noakes for valuable comments and discussions.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendices
Appendix A: Proofs
Proof of Theorem 1
Theorem
For any n and any \(1 \le s \le n!\), we can find a value k such that the \(\lfloor ks \rfloor \)the candidate state is suitable for zooming. Specifically,
-
(a)
For \(1 \le n \le 5\), we can determine candidate states suitable for zooming on a case-by-case basis.
-
(b)
For \(n \ge 5\) and \(2 \le s \le n!\), the \(\lfloor s/2 \rfloor \)th candidate state is always suitable for zooming.
Proof
Consider the candidate state number as a continuous variable. That is, define the sth candidate state to be the point along the candidate state arc which has inner product with the 0th candidate state equal to
even if s is not an integer.
Lower bound. Consider the candidate states immediately prior to nonlinear evolution, at time \(t=0\) (refer to the left diagram in Fig. 7). Immediately after production by the circuit in Fig. 5, the inner product of the 0th and sth candidate states is
Similarly, the inner product of the 0th and (ks)th candidate states is
Define \(\mu _0/2\) to be the angle subtended by the ksth candidate state and its projection when reflected about the midpoint of the arc between the 0th and sth candidate states. Via simple trigonometry, we have
Due to the orientation of the candidate state arc imposed in Fig. 6, candidate states will move to opposite poles of the Bloch sphere depending on whether they are closer to the 0th candidate state or the sth. All angles and figures defined in this section thus far have intuitively assumed that the (ks)th candidate state is closer to the 0th candidate state than the sth. With the assistance of Lemma 2, we have found and imposed the upper limit of 1 / 2 on k in order to ensure the consistency of all figures and angles in this section.
Lemma 2
If \(k \le 1/2\), then the (ks)th candidate state is closer to the 0th candidate state than the sth for all \(1 \le s \le n!\).
Proof
The (ks)th candidate state is closer to the 0th candidate state than the sth—so it subtends an angle of at most \(\alpha _0/4\) with the 0th candidate state. The inner product with the 0th candidate state of such a point is
The candidate state having this inner product, the \(s'\)th, is such that
giving
Therefore, the (ks)th candidate state is guaranteed to be closer to the 0th candidate state than the sth as long as \(k \le 1/2\). \(\square \)
Lemma 2 also tells us that \(\cos (\theta (T(s/n!))/2) \ge 1/\sqrt{2}\) as long as \(k \le 1/2\), because the minimum possible value of \(\cos (\alpha _0/2)\) is \(1/\sqrt{2}\) (and the angle cannot increase throughout the evolution). For this result to be meaningful, we must restore the status of s as a discrete variable. In Measurements 1 and 2, we take the \(\lfloor ks \rfloor \)th candidate state. In doing so, we pick either the (ks)th or \((ks-1)\)th candidate state. In the latter case, we are effectively using \(\tilde{k}=k-\frac{1}{s}\) as our k value, which is less than 1 / 2 and so our result still holds.
Upper bound. Aside: First, let us make it abundantly clear that the position of the (ks)th candidate after nonlinear evolution for time T(s / n!) discussed throughout this section (and in all figures referring to the position of the (ks)th candidate state after time T(s / n!)) is not the actual position of the (ks)th candidate state, but an approximation. The true position of the (ks)th candidate state after nonlinear evolution for time T(s / n!) is some distance away from the arc connecting the 0th and sth candidate states, as the evolution distorts the arc from its initial shape (see Fig. 8). This displacement need not cause concern, as we are in pursuit of an upper bound for \(\cos (\theta (T(s/n!))/2)\), not a lower bound. This aside and Fig. 8 justify this statement and are the only parts of the proof that make reference to this true position of the (ks)th candidate state.
Consider the assortment of candidate states after nonlinear evolution for time T(s / n!). Recall that the nonlinear evolution is corrected by a linear amount (see Eq. 30) such that only the endpoints (and midpoint) of S remain along the extension of the arc S. The orientation of S was such that along this arc, points separate more quickly than if they were aligned along any other arc of the Bloch sphere (see Fig. 6). Therefore, any non-endpoint, non-midpoint candidate state will leave this arc and drag behind it as the 0th and sth candidate states are separated. After nonlinear evolution for time T(s / n!) as per Procedure B, this leads to the distortion as displayed in the dark curve in Fig. 8.
There is a subarc of S with the (ks)th candidate state as one endpoint and the other chosen symmetrically about the midpoint of S. Let the angle subtended by its endpoints in Hilbert space be \(\mu (t)\), and let \(\mu _0 =\mu (0)\). Consider the result if we performed Procedure B upon this subarc instead of S, but maintained the nonlinear evolution time of T(s / n!). In this instance, Eq. (28) would become
and the nonlinear evolution, previously Eq. (30), would instead be
The nonlinear evolution time of T(s / n!), however, is not long enough to force the endpoints of this smaller arc all the way to opposite poles of the Bloch sphere. Recalling that \(T(s/n!) = 2\ln (\cot (\alpha _0/4))/g\), we have
In this hypothetical scenario, at the end of nonlinear evolution, this “approximate” (ks)th candidate state would necessarily lie closer to \(|0\rangle \) than the actual (ks)th candidate state does—so the angle \(\mu (T(s/n!))/2\) is greater than the angle subtended by the true (ks)th state and its symmetric point after nonlinear evolution for time T(s / n!). Again, this works in our favour for proving Theorem 1. End aside.
Consider the assortment of candidate states after nonlinear evolution for time T(s / n!). We orient this curve with the measurement basis \(\{|0\rangle ,|1\rangle \}\) by aligning the 0th and sth candidate states with \(|0\rangle \) and \(|1\rangle \), respectively. The curve is no longer an arc after nonlinear evolution, but for our purposes—namely, the impending measurement of the qubit—we need only consider the components of the candidate states in the \(|0\rangle \) and \(|1\rangle \) directions. The candidate state curve is then a quarter circle when projected onto the measurement basis, as visualised in the right diagram in Fig. 7. Via simple trigonometry, we have
which is a decreasing function of \(\cos (\mu (T(s/n!))/2)\). Recall Eq. (A6):
which, using Eqs. (A1) and (A3) and basic trigonometry,
Note that, for \(k=1/2\), this has a minimum of \(2\sqrt{2}/3\) at \(s=n!/2\). We substitute Eqs. (A11) into (A8) to obtain a large expression for \(\cos (\theta (T(s/n!))/2)\). At this stage, it is convenient to restore the status of s as a discrete variable by replacing ks with \(\lfloor s/2\rfloor \). Figure 9 shows the values of \(\cos (\theta (T(s/n!))/2)\) with \(1 \le s \le n!\) for graphs of size \(n=3,4,5\) and 6, alternating between smooth functions which serve as upper and lower bounds:
Inspired by Fig. 9, we consider only graphs with five or more vertices and show that \(\cos (\theta (T(s/n!))/2)\) is always less than \(\sqrt{2/3}+\epsilon \) (for a known quantity \(\epsilon \)) when \(7 \le s \le n! \). When s is even, \(\cos (\theta (T(s/n!))/2)\) appears on the lower bound function (blue curve) in Fig. 9, which has a maximum of \(\sqrt{2/3}\) (using the fact that \(\cos (\mu (T(s/n!))/2)\) from Eq. (A11) has a minimum of \(2\sqrt{2}/3\) at \(s=n!/2\) when \(k=1/2\)). Therefore, for all even s,
and so we have shown that the \(\lfloor s/2 \rfloor \)th candidate state is suitable for zooming (via Definition 1) when s is even.
When s is odd, take the expression for \(\cos (\theta (T(s/n!))/2)\) for fixed values of s and varying values of n to observe that
and that, for \(n \ge 5\),
As s is odd, \(\cos (\theta (T(s/n!))/2)\) lands on the upper bound function (red curve in Fig. 9). For \(n \ge 5\), the upper bound function has a maximum value, slightly above \(\sqrt{2/3}\), occurring somewhere between \(s = n!/2-1\) and \(s=n!/2-2\). Equation (A14) assures us that the value of \(\cos (\theta (T(s/n!))/2)\) is less than whatever this maximum is, as long as \(s \ge 7\). We evaluate \(\cos (\theta (T(s/n!))/2)\) at \(s=n!/2-2\) to approximate the maximum as
For the first two values of n for which this maximum exists, we obtain
We can calculate \(\epsilon _n\) for any graph size n by calculating the difference between (A15) and \(\sqrt{2/3}\). However, as seen in Fig. 10, \(\epsilon _n\) is a decreasing function of n and so, for any \(n \ge 5\), it suffices to use \(\sqrt{2/3}+ \epsilon _5\) as an upper bound for \(cos(\theta (T(s/n!))/2)\).
Therefore, we have shown that for \(n \ge 5\) and odd \(s \ge 7\) that the \(\lfloor s/2 \rfloor \)th candidate state is suitable for zooming (via Definition 1). The results in Eqs. (A12) and (A13) show that for \(s=3\) and \(s=5\), the \(\lfloor s/2 \rfloor \)th candidate state is also suitable for zooming. This completes the proof of part (b) of Theorem 1. Part (a) of Theorem 1 is trivial: as there are only 153 pairs (s, n) for \(n \le 4\), all different values of \(\cos (\theta (T(s/n!))/2)\) will not draw arbitrarily close to 1. We can draw from a list of these 153 different values to determine which candidate states are suitable for zooming on a case-by-case basis.
To summarise, for \( n \ge 5\), we have
\(\square \)
Proof of Lemma 1
Proof
Using Eqs. (27) and (29), we have
Treating s / n! as a continuous variable, we can take the Taylor series of T(s / n!) about 0 to give us an expression which is strictly less than or equal to T(s / n!):
By taking the series to the fifth order in s / n!, the above inequality holds. Then,
discarding the infinitesimal polynomial terms. \(\square \)
Comment on Theorem 2: suitable choices for the ensemble size \(\omega \)
Recall the proof of Theorem 2. Procedure A has the highest chance of failure when \(s=3\), as shown in Appendix 2.. During the course of an entire run-through of Algorithm 2, the iterations of Procedure B when \(s = 3\) are infrequent enough that we will neglect their slight lowering of the success probability of Algorithm 2, and instead estimate the overall probability of success as
Using this definition, we observe the pattern shown in Fig. 11. Most notably, the probability of Algorithm 2 performing successfully is greater than 1 / 2 for \(\omega \ge 10 \log (\log (n))\).
Rights and permissions
About this article
Cite this article
Chiew, M., de Lacy, K., Yu, C.H. et al. Graph comparison via nonlinear quantum search. Quantum Inf Process 18, 302 (2019). https://doi.org/10.1007/s11128-019-2407-2
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s11128-019-2407-2