I was confused by the branch and bound method recently. There are three searching strategies in branch-and-bound method: deepth-first-search, breadth-first-search and best-first-search. All the books and literatures state that the breadth-first and best-first will take more memory of the computer used. How to understand this? Take a binary tree as an example, when take a node (father node) from the live node list to process, two sub-nodes (or son nodes) are generated and inserted into the live node list, but the father node should be deleted, thus, there is only one node's memory increase. From this point of view, all the three searching strategies take the same memories of the computer. Am I right? It has been confused me for long. Could anyone give me some advice?
1 Answers
Well,
You could think about data structures:
Breadth-first-search: It´s implemented as a queue. When you expand a node (father node) you include son nodes in the queue. The father node is deleted. Let´s make an example:
Expand 45: We include 20 and 70 in the queue and delete 45 so:
20 | 70
Expand 20: We expand the first node from the queue and include his sons:
70 | 10 | 28
Expand 70: We expand the first node from the queue and include his sons:
10 | 28 | 60 | 85
And so on...
As you can see space complexity is exponential: O() (b = branching factor ; d = depth, initially 0)
Deepth-first-search: It´s implemented as a stack:
Expand 45: We include 20 and 70 in the stack and delete 45 so:
20 | 70
Expand 20: We expand the first node from the top of the stack and include his sons:
10 | 28 | 70
Expand 10: We expand the first node from the top of the stack and include his sons:
1 | 18 | 28 |70
And so on...
Now space complexity is linear: O(d). Time complexity is O() in both algorithms.
Best-first-search: Sorts the queue according to a heuristic evaluation function f(n) and expands the succesor with the best f(n). Space complexity is linear: O(d).
Hope this helps.

- 130
- 1
- 11