Algorithm Search⌘K

Proofs: Iterative broadening

These are the human proofs of Iterative broadening, at full length.

Iterative broadening is sound and complete on finite trees, with a bounded overhead in the worst case full

This proof shows: correctness, termination, complexity.

We use the pseudocode of the page. The search tree from s0s_0 is finite, and BB is the largest number of children of a node, with B=0B = 0 when s0s_0 has no child.

Lemma 1 (soundness). If BOUNDED(s,c)(s, c) returns a list, the list is a path of the tree from ss to a goal.

Proof. By induction on the height of ss in the finite tree. A list is returned at line L6, where it is [s][s] and ss is a goal, or at line L11, where it is [s][s] followed by the list of a call BOUNDED(s′,c)(s', c) for a child s′s' of ss, which by induction is a path from s′s' to a goal. □\square

Lemma 2 (a run without pruning is a full search). If a run of BOUNDED(s0,c)(s_0, c) returns failure and leaves pruned false, then no node of the tree is a goal.

Proof. We show by induction on the height of ss: if BOUNDED(s,c)(s, c) returns failure and sets no flag, then no node of the subtree of ss is a goal. The call returned at line L12, so ss is not a goal by line L6. No flag was set at line L8, so ss has at most cc children and line L9 calls BOUNDED on each of them. Each of these calls returned failure, or line L11 would have returned, and none set the flag. By induction their subtrees hold no goal. □\square

Lemma 3 (each run stops). Each call BOUNDED(s0,c)(s_0, c) stops.

Proof. The calls follow the edges of a finite tree from the root, and each call makes at most one call per child. So the number of calls is at most the number of nodes. □\square

Theorem 4 (correctness and termination). The search stops after at most max⁡(1,B−1)\max(1, B - 1) runs. It returns a path from s0s_0 to a goal if the tree has a goal, and failure otherwise.

Proof. In the run with c≥Bc \ge B, no node has more than cc children, so line L8 never sets the flag. That run returns a path or, by line L5, failure. The first such run has c=max⁡(2,B)c = \max(2, B), which is run number max⁡(2,B)−1\max(2, B) - 1. Each run stops by Lemma 3. A returned path is a path to a goal by Lemma 1. Failure is returned only by a run that left the flag false, and then the tree has no goal by Lemma 2. If the tree has a goal, the search therefore cannot return failure, so it returns a path. □\square

Theorem 5 (worst-case cost). In the uniform tree of branching factor b≥2b \ge 2 and depth d≥1d \ge 1, the leaves visited by all runs together number less than (1+b/(d+1)) bd(1 + b/(d+1))\, b^d.

Proof. The run with cutoff c≤bc \le b visits at most the cdc^d leaves of the tree cut to breadth cc, and there are runs only for c=2,…,bc = 2, \ldots, b. For 1≤c≤b−11 \le c \le b - 1, the function xdx^d is increasing on [c,c+1][c, c+1], so cd≤∫cc+1xd dxc^d \le \int_c^{c+1} x^d\,dx. Hence

∑c=2bcd≤bd+∑c=2b−1∫cc+1xd dx≤bd+∫1bxd dx<bd+bd+1d+1.\sum_{c=2}^{b} c^d \le b^d + \sum_{c=2}^{b-1} \int_c^{c+1} x^d\,dx \le b^d + \int_1^b x^d\,dx < b^d + \frac{b^{d+1}}{d+1}.

The internal nodes of the run with cutoff cc number (cd−1)/(c−1)<cd(c^d - 1)/(c - 1) < c^d, so the total number of nodes is less than twice this bound. ■\blacksquare

Back to Iterative broadening