The General Branch and Bound Method
Our general technique for branch and bound algorithms involves modeling the solution space as a tree and then traversing the tree exploring the most promising subtrees first. This is continued until either there are no subtrees into which to further break the problem, or we have arrived at a point where, if we continue, only inferior solutions will be found. A general algorithm for branch and bound searching is presented in figure 1.

Figure 1 - General Branch and Bound Searching
Let's examine this technique more closely and find out what is needed to solve problems with the branch and bound method using the chromatic number and knapsack algorithms from the 'Intelligent Search' section of this chapter.
We need first to define the objects that make up the original problem and possible solutions to it.
An essential rule to be followed in defining solution spaces for branch and bound algorithms is the following.
If a solution tree vertex is not part of a feasible solution, then the subtree for which it is the root cannot contain any feasible solutions.
This rule guarantees that if we cut off search at a vertex due to unfeasibility, then we have not ignored any optimum solutions.
Now, we present the definitions for bounds used in the above algorithm.
Lower bound at a vertex.
The smallest value of the objective function for any node of the subtree rooted at the vertex.Upper bound at a vertex.
The largest value of the objective function for any node of the subtree rooted at the vertex.For chromatic number we used the number of colors for the lower bound of a partial or complete solution. The lower bound for knapsack vertices was the current load, while the upper bound was the possible weight of the knapsack in the subtree.
Next we must have the following methods (or algorithms) which operate upon and help us to analyze the objects.
At this point complexity should be mentioned. Computing these for the knapsack problem is easy because they all involve summing the weights. A good strategy is to record the knapsack loads as each vertex in the search tree is visited so that the objective and upper bound functions require one addition and the feasibility check utilizes one comparison.
Chromatic numbering involves more work when solution candidates are checked for feasibility. In the worst case, all of the graph edges must be examined, and this possibly requires O(
n2) steps. One way to reduce this a little is to use partial solutions where the children of a vertex have one more node colored than their parent.Let us now turn our attention to two interrelated topics: solution space design and searching the space. Creative designers build a space that can be searched without too much complexity - either in the bounding computations or in the space required to hold the solution candidates under consideration and those about to be considered. Some helpful techniques are the following.
Our last note involves correctness. Two things must be shown. First, an optimum solution exists in the solution space tree. And secondly, the optimum solution is found by the branch and bound search algorithm.