Acta Informatica

, Volume 15, Issue 2, pp 99–113 | Cite as

Backtracking with multi-level dynamic search rearrangement

  • Paul Walton PurdomJr.
  • Cynthia A. Brown
  • Edward L. Robertson


The order in which the variables are tested in a backtrack program can have a major effect on its running time. The best search order usually varies among the branches of the backtrack tree, so the number of possible search orders can be astronomical. We present an algorithm that chooses a search order dynamically by investigating all possibilities for k levels below the current level, extending beyond k levels wherever possible by setting the variables that have unique forced values. The algorithm takes time O(nk+1) to process a node. For k=2 and binary variables the analysis for selecting the next variable to introduce into the backtrack tree makes complete use of the information contained in the two-level investigations. For larger k or variables of higher degree there is no polynomial-time algorithm that makes complete use of the k-level investigations to limit searching (unless P=NP). The search rearrangement algorithm is closely related to constraint propagation. Experimental studies on conjunctive normal form predicates confirm that 1-level search rearrangement saves a great deal of time compared to 0-level (ordinary backtracking), and show that 2-level saves time over 1-level on large problems. For such problems with 256 variables 2-level is better than 1-level by a factor of two.


Computational Mathematic Computer System Normal Form System Organization Major Effect 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Knuth, D.E.: Estimating the efficiency of backtrack programs. Math. Comp. 29, 121–136 (1975)Google Scholar
  2. 2.
    Bitner, J.R., Reingold, E.M.: Backtrack programming techniques. CACM 18, 651–655 (1975)Google Scholar
  3. 3.
    Knuth, D.E.: Mathematics and computer science: Coping with finiteness. Science 194, 1235–1242 (1976)Google Scholar
  4. 4.
    Tompkins, C: Machine attacks on problems whose variables are permutations. Proc. Symp. Appl. Math. 6. Amer. Math. Soc. 195 (1956) Paige, L.J., Tompkins, C.: The size of the 10×10 latin square problem, ibid 10, 71 (1960)Google Scholar
  5. 5.
    Parker, E.T.: Computer investigations of orthogonal latin squares of order ten. Proc. Symp. Appl. Math. 15. Amer. Math. Soc. 73 (1963)Google Scholar
  6. 6.
    Waltz, D.: Understanding line drawings of scenes with shadows. In: The psychology of computer vision. (P.H. Winston, ed.). New York: McGraw-Hill 1975Google Scholar
  7. 7.
    Cook, S.A.: The complexity of theorem-proving procedures. Third Annual ACM Symposium on Theory of Computing (1971), pp. 151–158Google Scholar
  8. 8.
    Purdom, P.: Tree size by partial backtracking. SIAM J. Comp. 7, 481–491 (1978)Google Scholar
  9. 9.
    Davis, M., Putnam, H.: A computational procedure for quantification theory. JACM 7, 201–215 (1960)Google Scholar
  10. 10.
    Schaefer, J.: The complexity of the satisfiability problem. Tenth Annual ACM Symposium on Theory of Computing, 216–226 (1978)Google Scholar
  11. 11.
    Johnson, D.S.: Approximation algorithms for combinatorial problems. J. Comput. Systems Sci. 9, 256–278 (1974)Google Scholar
  12. 12.
    Zobrist, A.L.: A hashing method with application to game playing. Tech. Report 88, Computer Sci.. Dept., U. of Wisconsin, Madison, Wis. (1970)Google Scholar
  13. 13.
    Brown, C.A., Purdom, Jr., P.W.: An average time analysis of backtracking. To appear in SIAM J. Comp.Google Scholar

Copyright information

© Springer-Verlag 1981

Authors and Affiliations

  • Paul Walton PurdomJr.
    • 1
  • Cynthia A. Brown
    • 1
  • Edward L. Robertson
    • 1
  1. 1.Computer Science DepartmentIndiana UniversityBloomingtonUSA

Personalised recommendations