Getting Started with algorithms 7: branch-and-gauge method

Source: Internet
Author: User

As already mentioned in the previous retrospective, the thought of backtracking is depth-first search plus pruning, in contrast, the idea of branch-bound method is breadth-first search plus pruning.

1. Branch-bound method – breadth-First search

1. Simple Overview

The simple description of the branch-and-bound method is that the solution space of the problem is transformed into the structure representation of the graph or tree, and then the traversal is performed using the breadth-first search strategy, and all feasible solutions or optimal solutions are recorded and searched.

The basic idea is similar to:

Breadth-first traversal of graphs

Sequence traversal of binary tree

That is: for the current node, expand all of its viable child nodes at once.

It is easy to understand the breadth-first traversal of the control graph.

2. Detailed Description

The detailed description is:

1) First, the solution space of the problem is transformed into the structure representation of a graph or a tree, and then a live node table is maintained.

2) Initially, add the root node to the Live node table

3) When the live node table is not empty, a node is removed from the live node table and becomes the current expansion node. If the table is empty, skip to step 6 to the end.

4) Determine whether the current expansion node has obtained a feasible solution or better solution, if yes, record or update the solution of the problem.

5) All viable child nodes of the current expansion node are generated at once and added to the Live node table. Skip to Step 3

6) End of algorithm

The data structure of a live node table can be a FIFO queue or a priority queue.

3. Backtracking method Application

The branch-bound method is usually used to solve the problem of a feasible solution or an optimal solution.

2. Classic Questions

(1) Loading problem

(2) 0-1 knapsack problem

(3) Travel salesman problem

(4) Eight Queen's question

(5) Maze problem

(6) The M coloring problem is similar to the backtracking method, but it is different in the search mode of the spatial tree (a depth optimization, a breadth first).

The specific classical problems of the branch-bound method are not described here. One of the classic cases, "travel salesman problem", can be found in one of my previous articles.

The branch-bound method----The problem of traveling salesman


Reprint this article please indicate the author and source

Author: Jarvischu

Source: Http://blog.csdn.net/jarvischu



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.