# 分支限界算法

## :pencil2: 1、分支限界法

### :pen\_fountain: 1.1、**算法原理**

分支限界法（branch and bound method）按广度优先策略搜索问题的解空间树，在搜索过程中，对待处理的节点根据限界函数估算目标函数的可能取值，从中选取使目标函数取得极值（极大或极小）的结点优先进行广度优先搜索，从而不断调整搜索方向，尽快找到问题的解。分支限界法适合求解最优化问题。

### :pen\_fountain: 1.2、**分支限界法与回溯法**

1. 求解目标：回溯法的求解目标是找出解空间树中满足约束条件的所有解，而分支限界法的求解目标则是找出满足约束条件的一个解，或是在满足约束条件的解中找出在某种意义下的最优解。
2. 搜索方式的不同：回溯法以深度优先的方式搜索解空间树，而分支限界法则以广度优先或以最小耗费优先的方式搜索解空间树。

### :pen\_fountain: 1.3、**分支限界法思想**

分支限界法首先要确定一个合理的限界函数（`bound funciton`），并根据限界函数确定目标函数的界`[down ,up]`，按照广度优先策略搜索问题的解空间树，在分直结点上依次扩展该结点的孩子结点，分别估算孩子结点的目标函数可能值，如果某孩子结点的目标函数可能超出目标函数的界，则将其丢弃；否则将其加入待处理结点表（简称PT表），依次从表PT中选取使目标函数取得极值的结点成为当前扩展结点，重复上述过程，直到得到最优解。

### :pen\_fountain: 1.4、**常见的两种分支限界法**

1. 队列式(FIFO)分支限界法\
   按照队列先进先出（FIFO）原则选取下一个结点为扩展结点。
2. 优先队列式分支限界法\
   按照优先队列中规定的优先级选取优先级最高的结点成为当前扩展结点。

## :pencil2: 2、题型

### :pen\_fountain: 2.1、0-1背包

{% tabs %}
{% tab title="回溯" %}

```
```

{% endtab %}

{% tab title="分支限界" %}

```
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mqjyl2012.gitbook.io/algorithm/algorithm-thinking/branch-and-bound.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
