In the algorithm in the section "0-1 Knapsack - Dynamic Programming", the inner loop can be parallelized. The execution of the loop's body for different values of jw
can be executed in parallel as the calculation of the value for m[i][jw]
does not require values m[i][jw']
where jw'!=jw
, i.e. any iteration does not depend on previous iterations.
1/0 Knapsack, how to make it parallel with priority queue [closed]
Вопрос
In 1/0 Knapsack Problem, one can implement it dynamically with two for loops, like on this site: http://www.bogotobogo.com/Algorithms/knapsack.php
How can i implement it with a priority queue and optimize it with multithreading?
Решение
Не связан с StackOverflow