80 likes | 97 Views
Learn about the importance of variable, value, and constraint ordering in backtracking algorithms. Discover heuristics for choosing variables, values, and propagating constraints effectively to minimize search space and improve algorithm efficiency.
E N D
Heuristics for backtracking algorithms • Variable ordering (important) • what variable to branch on next • Value ordering (not yet so important) • given a choice of variable, what order to try values • Constraint ordering (not so important) • what order to propagate constraints • most likely to fail or cheapest propagated first
Variable ordering • Domain dependent heuristics • Domain independent heuristics • Static variable ordering • fixed before search starts • Dynamic variable ordering • chosen during search
Variable ordering: Possible goals • Minimize the underlying search space • static ordering example: Suppose x1, x2, x3, x4 with domain sizes 2, 4, 8, 16. Compare static ordering x1, x2, x3, x4 vs x4, x3, x2, x1 • Minimize expected depth of any branch • Minimize expected number of branches • Minimize size of search space explored by backtracking algorithm • intractable to find “best” variable
Basic idea • Assign a heuristic value to a variable that estimates how difficult it is to find a satisfying value for that variable • Principle: most likely to fail first • or don’t postpone the hard part
Some variable ordering heuristics • minimum domain size (dom) • maximum degree (deg) • most constraining • plus: combining — tie break strategies • e.g., dom + deg, dom / deg
Open questions • Dynamic variable ordering heuristics for non-binary CSPs
Value ordering • All solutions • value ordering not so important • One solution • if a solution exists, there exists a perfect value ordering
Value ordering: Intuition • Goal: minimize size of search space explored • Principle: • given that we have already chosen the next variable to instantiate, choose first the values that are most likely to succeed