Skip to content

Commit

Permalink
Update 04.Knapsack-Problem-04.md
Browse files Browse the repository at this point in the history
  • Loading branch information
itcharge committed May 14, 2024
1 parent e11bc80 commit a995573
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
>
> 请问在总重量不超过背包载重上限的情况下,能装入背包的最大价值是多少?
![](https://qcdn.itcharge.cn/images/20230329095653.png)
![混合背包问题](https://qcdn.itcharge.cn/images/20240514111727.png)

#### 思路 1:动态规划

Expand Down Expand Up @@ -82,7 +82,7 @@ class Solution:

> **分组背包问题**:有 $n$ 组物品和一个最多能装重量为 $W$ 的背包,第 $i$ 组物品的件数为 $group\underline{\hspace{0.5em}}count[i]$,第 $i$ 组的第 $j$ 个物品重量为 $weight[i][j]$,价值为 $value[i][j]$。每组物品中最多只能选择 $1$ 件物品装入背包。请问在总重量不超过背包载重上限的情况下,能装入背包的最大价值是多少?
![](https://qcdn.itcharge.cn/images/20230329095729.png)
![分组背包问题](https://qcdn.itcharge.cn/images/20240514111745.png)

### 6.1 分组背包问题基本思路

Expand Down Expand Up @@ -202,7 +202,7 @@ class Solution:

> **二维费用背包问题**:有 $n$ 件物品和有一个最多能装重量为 $W$、容量为 $V$ 的背包。第 $i$ 件物品的重量为 $weight[i]$,体积为 $volume[i]$,价值为 $value[i]$,每件物品有且只有 $1$ 件。请问在总重量不超过背包载重上限、容量上限的情况下,能装入背包的最大价值是多少?
![](https://qcdn.itcharge.cn/images/20230329095857.png)
![二维费用背包问题](https://qcdn.itcharge.cn/images/20240514111802.png)

### 7.1 二维费用背包问题基本思路

Expand Down

0 comments on commit a995573

Please sign in to comment.