Quantum Algorithm for Dynamic Programming Approach for DAGs. Applications for Zhegalkin Polynomial Evaluation and Some Problems on DAGs

  • Kamil KhadievEmail author
  • Liliya Safina
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11493)


In this paper, we present a quantum algorithm for dynamic programming approach for problems on directed acyclic graphs (DAGs). The running time of the algorithm is \(O(\sqrt{\hat{n}m}\log \hat{n})\), and the running time of the best known deterministic algorithm is \(O(n+m)\), where n is the number of vertices, \(\hat{n}\) is the number of vertices with at least one outgoing edge; m is the number of edges. We show that we can solve problems that use OR, AND, NAND, MAX and MIN functions as the main transition steps. The approach is useful for a couple of problems. One of them is computing a Boolean formula that is represented by Zhegalkin polynomial, a Boolean circuit with shared input and non-constant depth evaluating. Another two are the single source longest paths search for weighted DAGs and the diameter search problem for unweighted DAGs.


Quantum computation Quantum models Quantum algorithm Query model Graph Dynamic programming DAG Boolean formula Zhegalkin polynomial DNF AND-OR-NOT formula NAND Computational complexity Classical vs. quantum Boolean formula evaluation 



This work was supported by Russian Science Foundation Grant 17-71-10152.

A part of work was done when K. Khadiev visited University of Latvia. We thank Andris Ambainis, Alexander Rivosh and Aliya Khadieva for help and useful discussions.


  1. 1.
    Ablayev, F., Ablayev, M., Khadiev, K., Vasiliev, A.: Classical and quantum computations with restricted memory. In: Böckenhauer, H.-J., Komm, D., Unger, W. (eds.) Adventures Between Lower Bounds and Higher Altitudes. LNCS, vol. 11011, pp. 129–155. Springer, Cham (2018). Scholar
  2. 2.
    Ablayev, F., Ambainis, A., Khadiev, K., Khadieva, A.: Lower bounds and hierarchies for quantum memoryless communication protocols and quantum ordered binary decision diagrams with repeated test. In: Tjoa, A.M., Bellatreche, L., Biffl, S., van Leeuwen, J., Wiedermann, J. (eds.) SOFSEM 2018. LNCS, vol. 10706, pp. 197–211. Springer, Cham (2018). Scholar
  3. 3.
    Ablayev, F., Gainutdinova, A., Khadiev, K., Yakaryılmaz, A.: Very narrow quantum OBDDs and width hierarchies for classical OBDDs. Lobachevskii J. Math. 37(6), 670–682 (2016)MathSciNetCrossRefGoogle Scholar
  4. 4.
    Ablayev, F., Gainutdinova, A., Khadiev, K., Yakaryılmaz, A.: Very narrow quantum OBDDs and width hierarchies for classical OBDDs. In: Jürgensen, H., Karhumäki, J., Okhotin, A. (eds.) DCFS 2014. LNCS, vol. 8614, pp. 53–64. Springer, Cham (2014). Scholar
  5. 5.
    Ablayev, F., Vasilyev, A.: On quantum realisation of boolean functions by the fingerprinting technique. Discrete Math. Appl. 19(6), 555–572 (2009)MathSciNetCrossRefGoogle Scholar
  6. 6.
    Ambainis, A., Nahimovs, N.: Improved constructions of quantum automata. Theoret. Comput. Sci. 410(20), 1916–1922 (2009)MathSciNetCrossRefGoogle Scholar
  7. 7.
    Ambainis, A.: A nearly optimal discrete query quantum algorithm for evaluating NAND formulas. arXiv preprint arXiv:0704.3628 (2007)
  8. 8.
    Ambainis, A.: Quantum algorithms for formula evaluation. (2010)
  9. 9.
    Ambainis, A.: Understanding quantum algorithms via query complexity. arXiv preprint arXiv:1712.06349 (2017)
  10. 10.
    Ambainis, A., Childs, A.M., Reichardt, B.W., Špalek, R., Zhang, S.: Any and-or formula of size N can be evaluated in time \(N^{1/2}+o(1)\) on a quantum computer. SIAM J. Comput. 39(6), 2513–2530 (2010)MathSciNetCrossRefGoogle Scholar
  11. 11.
    Ambainis, A., Špalek, R.: Quantum algorithms for matching and network flows. In: Durand, B., Thomas, W. (eds.) STACS 2006. LNCS, vol. 3884, pp. 172–183. Springer, Heidelberg (2006). Scholar
  12. 12.
    Arora, S., Barak, B.: Computational Complexity: A Modern Approach. Cambridge University Press, New York (2009)CrossRefGoogle Scholar
  13. 13.
    Boyer, M., Brassard, G., Høyer, P., Tapp, A.: Tight bounds on quantum searching. Fortschritte der Physik 46(4–5), 493–505 (1998)CrossRefGoogle Scholar
  14. 14.
    Brassard, G., Høyer, P., Mosca, M., Tapp, A.: Quantum amplitude amplification and estimation. Contemp. Math. 305, 53–74 (2002)MathSciNetCrossRefGoogle Scholar
  15. 15.
    Bun, M., Kothari, R., Thaler, J.: Quantum algorithms and approximating polynomials for composed functions with shared inputs. arXiv preprint arXiv:1809.02254 (2018)
  16. 16.
    Childs, A.M., Kimmel, S., Kothari, R.: The quantum query complexity of read-many formulas. In: Epstein, L., Ferragina, P. (eds.) ESA 2012. LNCS, vol. 7501, pp. 337–348. Springer, Heidelberg (2012). Scholar
  17. 17.
    Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 2nd edn. McGraw-Hill, New York (2001)zbMATHGoogle Scholar
  18. 18.
    De Wolf, R.: Quantum computing and communication complexity (2001)Google Scholar
  19. 19.
    Dörn, S.: Quantum complexity of graph and algebraic problems. Ph.D. thesis, Universität Ulm (2008)Google Scholar
  20. 20.
    Dörn, S.: Quantum algorithms for matching problems. Theory Comput. Syst. 45(3), 613–628 (2009)MathSciNetCrossRefGoogle Scholar
  21. 21.
    Dürr, C., Heiligman, M., Høyer, P., Mhalla, M.: Quantum query complexity of some graph problems. In: Díaz, J., Karhumäki, J., Lepistö, A., Sannella, D. (eds.) ICALP 2004. LNCS, vol. 3142, pp. 481–493. Springer, Heidelberg (2004). Scholar
  22. 22.
    Dürr, C., Heiligman, M., Høyer, P., Mhalla, M.: Quantum query complexity of some graph problems. SIAM J. Comput. 35(6), 1310–1328 (2006)MathSciNetCrossRefGoogle Scholar
  23. 23.
    Durr, C., Høyer, P.: A quantum algorithm for finding the minimum. arXiv preprint arXiv:quant-ph/9607014 (1996)
  24. 24.
    Gindikin, S.G., Gindikin, S., Gindikin, S.G.: Algebraic Logic. Springer, New York (1985)CrossRefGoogle Scholar
  25. 25.
    Grover, L.K.: A fast quantum mechanical algorithm for database search. In: Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing, pp. 212–219. ACM (1996)Google Scholar
  26. 26.
    Grover, L.K., Radhakrishnan, J.: Is partial quantum search of a database any easier? In: Proceedings of the Seventeenth Annual ACM Symposium on Parallelism in Algorithms and Architectures, pp. 186–194. ACM (2005)Google Scholar
  27. 27.
    Ibrahimov, R., Khadiev, K., Prūsis, K., Yakaryılmaz, A.: Error-free affine, unitary, and probabilistic OBDDs. In: Konstantinidis, S., Pighizzini, G. (eds.) DCFS 2018. LNCS, vol. 10952, pp. 175–187. Springer, Cham (2018). Scholar
  28. 28.
    Jordan, S.: Bounded Error Quantum Algorithms Zoo.
  29. 29.
    Khadiev, K., Khadieva, A.: Reordering method and hierarchies for quantum and classical ordered binary decision diagrams. In: Weil, P. (ed.) CSR 2017. LNCS, vol. 10304, pp. 162–175. Springer, Cham (2017). Scholar
  30. 30.
    Khadiev, K., Khadieva, A., Mannapov, I.: Quantum online algorithms with respect to space and advice complexity. Lobachevskii J. Math. 39(9), 1210–1220 (2018)MathSciNetCrossRefGoogle Scholar
  31. 31.
    Le Gall, F.: Exponential separation of quantum and classical online space complexity. Theory Comput. Syst. 45(2), 188–202 (2009)MathSciNetCrossRefGoogle Scholar
  32. 32.
    Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information. Cambridge University Press, New York (2010)CrossRefGoogle Scholar
  33. 33.
    Yablonsky, S.V.: Introduction to Discrete Mathematics: Textbook for Higher Schools. Mir Publishers, Moscow (1989)Google Scholar
  34. 34.
    Zhegalkin, I.: On the technique of calculating propositions in symbolic logic (sur le calcul des propositions dans la logique symbolique). Matematicheskii Sbornik 34(1), 9–28 (1927). (in Russian and French)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  1. 1.Smart Quantum Technologies Ltd.KazanRussia
  2. 2.Kazan Federal UniversityKazanRussia

Personalised recommendations