Branch and bound
Branch and bound
1. **Initialization**:
- Start with an initial solution and calculate its objective function value.
2. **Branching**:
3. **Bounding**:
- For each subproblem, compute a bound on the best possible solution that
can be obtained from it.
4. **Pruning**:
5. **Selection**:
- Select the next subproblem to explore. This can be done using various
strategies, such as best-first search, depth-first search, or breadth-first
search.
6. **Iteration**:
- Repeat the branching, bounding, and pruning steps until all subproblems
have been explored or pruned.
7. **Termination**:
- The current best known solution is then declared as the optimal solution.
1. **Initialization**:
- Calculate the value of the empty knapsack (initial best known solution).
2. **Branching**:
3. **Bounding**:
4. **Pruning**:
- Discard subproblems that cannot yield a better solution than the current
best.
### Applications
- Knapsack Problem
- Job Scheduling
The TSP is a classic optimization problem where a salesman must visit a set
of cities exactly once and return to the starting city, minimizing the total
travel distance.
1. **Initialization**:
- Calculate a lower bound for the initial tour using a heuristic, like the
minimum spanning tree or the nearest neighbor method.
2. **Branching**:
- Each subproblem represents a partial tour extending from the current city
to the next unvisited city.
3. **Bounding**:
- Calculate a lower bound for each subproblem. This bound estimates the
minimum cost of completing the tour from the current partial tour.
4. **Pruning**:
- If the lower bound of a subproblem is greater than the current best known
tour cost, discard that subproblem.
5. **Selection**:
- Select the next subproblem to explore based on the lowest bound value.
6. **Completion**:
- The algorithm terminates when all potential tours have been either
pruned or explored.
- The best tour found during the process is the optimal solution to the TSP.
### Example
1. **Start**:
- Initial city is A.
2. **Branch**:
- From A, generate subproblems for tours starting with AB, AC, and AD.
3. **Bound**:
4. **Prune**:
- If the bound for AC and AD is higher than a known solution, prune these
subproblems.
5. **Select**:
- Continue with the lowest bound subproblem, e.g., AB, then generate
subproblems ABA, ABB, ABC, etc.
6. **Repeat**:
- Repeat branching, bounding, and pruning until all paths are explored or
pruned.
7. **Result**:
- The optimal tour might be ABDCA with the minimum travel distance.
1. What are the common heuristics used in branch and bound algorithms?