Summary
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(n k+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.
Similar content being viewed by others
References
Knuth, D.E.: Estimating the efficiency of backtrack programs. Math. Comp. 29, 121–136 (1975)
Bitner, J.R., Reingold, E.M.: Backtrack programming techniques. CACM 18, 651–655 (1975)
Knuth, D.E.: Mathematics and computer science: Coping with finiteness. Science 194, 1235–1242 (1976)
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)
Parker, E.T.: Computer investigations of orthogonal latin squares of order ten. Proc. Symp. Appl. Math. 15. Amer. Math. Soc. 73 (1963)
Waltz, D.: Understanding line drawings of scenes with shadows. In: The psychology of computer vision. (P.H. Winston, ed.). New York: McGraw-Hill 1975
Cook, S.A.: The complexity of theorem-proving procedures. Third Annual ACM Symposium on Theory of Computing (1971), pp. 151–158
Purdom, P.: Tree size by partial backtracking. SIAM J. Comp. 7, 481–491 (1978)
Davis, M., Putnam, H.: A computational procedure for quantification theory. JACM 7, 201–215 (1960)
Schaefer, J.: The complexity of the satisfiability problem. Tenth Annual ACM Symposium on Theory of Computing, 216–226 (1978)
Johnson, D.S.: Approximation algorithms for combinatorial problems. J. Comput. Systems Sci. 9, 256–278 (1974)
Zobrist, A.L.: A hashing method with application to game playing. Tech. Report 88, Computer Sci.. Dept., U. of Wisconsin, Madison, Wis. (1970)
Brown, C.A., Purdom, Jr., P.W.: An average time analysis of backtracking. To appear in SIAM J. Comp.
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Purdom, P.W., Brown, C.A. & Robertson, E.L. Backtracking with multi-level dynamic search rearrangement. Acta Informatica 15, 99–113 (1981). https://doi.org/10.1007/BF00288958
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF00288958