Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitefecea8

Browse files
authored
Merge pull request#1387 from virinci/patch-1
Fix the remainder group size in binary grouping solution of the multiple knapsack problem
2 parents820fc4a +e92615f commitefecea8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/dynamic_programming/knapsack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Let $A_{i, j}$ denote the $j^{th}$ item split from the $i^{th}$ item. In the tri
116116

117117
The grouping is made more efficient by using binary grouping.
118118

119-
Specifically, $A_{i, j}$ holds $2^j$ individual items ($j\in[0,\lfloor \log_2(k_i+1)\rfloor-1]$).If $k_i + 1$ is not an integer power of $2$, another bundle of size $k_i-2^{\lfloor \log_2(k_i+1)\rfloor-1}$ is used to make up for it.
119+
Specifically, $A_{i, j}$ holds $2^j$ individual items ($j\in[0,\lfloor \log_2(k_i+1)\rfloor-1]$).If $k_i + 1$ is not an integer power of $2$, another bundle of size $k_i-(2^{\lfloor \log_2(k_i+1)\rfloor}-1)$ is used to make up for it.
120120

121121
Through the above splitting method, it is possible to obtain any sum of $\leq k_i$ items by selecting a few $A_{i, j}$'s. After splitting each item in the described way, it is sufficient to use 0-1 knapsack method to solve the new formulation of the problem.
122122

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp