added two possible solutions for partitioning items equally to a number of bags to my Python training material:
https://github.com/hofmannedv/training-python/tree/master/usecases/knapsack-or-basket
added two possible solutions for partitioning items equally to a number of bags to my Python training material:
https://github.com/hofmannedv/training-python/tree/master/usecases/knapsack-or-basket
added three possible solutions for the Knapsack problem to my Python training material:
https://github.com/hofmannedv/training-python/tree/master/usecases/knapsack-or-basket
Всё про динамическое программирование 1 (гайд, трюки, оптимизации, dynamic programming)

Approximately Counting Knapsack Solutions in Subquadratic Time
Weiming Feng, Ce Jin
https://arxiv.org/abs/2410.22267 https://arxiv.org/pdf/2410.22267 https://arxiv.org/html/2410.22267
arXiv:2410.22267v1 Announce Type: new
Abstract: We revisit the classic #Knapsack problem, which asks to count the Boolean points $(x_1,\dots,x_n)\in\{0,1\}^n$ in a given half-space $\sum_{i=1}^nW_ix_i\le T$. This #P-complete problem admits $(1\pm\epsilon)$-approximation. Before this work, [Dyer, STOC 2003]'s $\tilde{O}(n^{2.5}+n^2{\epsilon^{-2}})$-time randomized approximation scheme remains the fastest known in the natural regime of $\epsilon\ge 1/polylog(n)$. In this paper, we give a randomized $(1\pm\epsilon)$-approximation algorithm in $\tilde{O}(n^{1.5}{\epsilon^{-2}})$ time (in the standard word-RAM model), achieving the first sub-quadratic dependence on $n$. Such sub-quadratic running time is rare in the approximate counting literature in general, as a large class of algorithms naturally faces a quadratic-time barrier.
Our algorithm follows Dyer's framework, which reduces #Knapsack to the task of sampling (and approximately counting) solutions in a randomly rounded instance with poly(n)-bounded integer weights. We refine Dyer's framework using the following ideas:
- We decrease the sample complexity of Dyer's Monte Carlo method, by proving some structural lemmas for typical points near the input hyperplane via hitting-set arguments, and appropriately setting the rounding scale.
- Instead of running a vanilla dynamic program on the rounded instance, we employ techniques from the growing field of pseudopolynomial-time Subset Sum algorithms, such as FFT, divide-and-conquer, and balls-into-bins hashing of [Bringmann, SODA 2017].
We also need other ingredients, including a surprising application of the recent Bounded Monotone (max,+)-Convolution algorithm by [Chi-Duan-Xie-Zhang, STOC 2022] (adapted by [Bringmann-D\"urr-Polak, ESA 2024]), the notion of sum-approximation from [Gawrychowski-Markin-Weimann, ICALP 2018]'s #Knapsack approximation scheme, and a two-phase extension of Dyer's framework for handling tiny weights.
We revisit the classic #Knapsack problem, which asks to count the Boolean points $(x_1,\dots,x_n)\in\{0,1\}^n$ in a given half-space $\sum_{i=1}^nW_ix_i\le T$. This #P-complete problem admits $(1\pmε)$-approximation. Before this work, [Dyer, STOC 2003]'s $\tilde{O}(n^{2.5}+n^2{ε^{-2}})$-time randomized approximation scheme remains the fastest known in the natural regime of $ε\ge 1/polylog(n)$. In this paper, we give a randomized $(1\pmε)$-approximation algorithm in $\tilde{O}(n^{1.5}{ε^{-2}})$ time (in the standard word-RAM model), achieving the first sub-quadratic dependence on $n$. Such sub-quadratic running time is rare in the approximate counting literature in general, as a large class of algorithms naturally faces a quadratic-time barrier. Our algorithm follows Dyer's framework, which reduces #Knapsack to the task of sampling (and approximately counting) solutions in a randomly rounded instance with poly(n)-bounded integer weights. We refine Dyer's framework using the following ideas: - We decrease the sample complexity of Dyer's Monte Carlo method, by proving some structural lemmas for typical points near the input hyperplane via hitting-set arguments, and appropriately setting the rounding scale. - Instead of running a vanilla dynamic program on the rounded instance, we employ techniques from the growing field of pseudopolynomial-time Subset Sum algorithms, such as FFT, divide-and-conquer, and balls-into-bins hashing of [Bringmann, SODA 2017]. We also need other ingredients, including a surprising application of the recent Bounded Monotone (max,+)-Convolution algorithm by [Chi-Duan-Xie-Zhang, STOC 2022] (adapted by [Bringmann-Dürr-Polak, ESA 2024]), the notion of sum-approximation from [Gawrychowski-Markin-Weimann, ICALP 2018]'s #Knapsack approximation scheme, and a two-phase extension of Dyer's framework for handling tiny weights.
Approximately Counting Knapsack Solutions in Subquadratic Time http://arxiv.org/abs/2410.22267v1
Authors: Weiming Feng, Ce JinWe revisit the classic #Knapsack problem, which asks to count the Boolean
points $(x_1,dots,x_n)in{0,1}^n$ in a given half-space
$sum_{i=1}^nW_ix_ile T$. This #P-complete problem admits
$(1pmepsilon)$-approximation. Before this work, [Dyer, STOC 2003]'s
$tilde{O}(n^{2.5}+n^2{epsilon^{-2}})$-time randomized approximation scheme
remains the fastest known in the
We revisit the classic #Knapsack problem, which asks to count the Boolean points $(x_1,\dots,x_n)\in\{0,1\}^n$ in a given half-space $\sum_{i=1}^nW_ix_i\le T$. This #P-complete problem admits $(1\pmε)$-approximation. Before this work, [Dyer, STOC 2003]'s $\tilde{O}(n^{2.5}+n^2{ε^{-2}})$-time randomized approximation scheme remains the fastest known in the natural regime of $ε\ge 1/polylog(n)$. In this paper, we give a randomized $(1\pmε)$-approximation algorithm in $\tilde{O}(n^{1.5}{ε^{-2}})$ time (in the standard word-RAM model), achieving the first sub-quadratic dependence on $n$. Such sub-quadratic running time is rare in the approximate counting literature in general, as a large class of algorithms naturally faces a quadratic-time barrier. Our algorithm follows Dyer's framework, which reduces #Knapsack to the task of sampling (and approximately counting) solutions in a randomly rounded instance with poly(n)-bounded integer weights. We refine Dyer's framework using the following ideas: - We decrease the sample complexity of Dyer's Monte Carlo method, by proving some structural lemmas for typical points near the input hyperplane via hitting-set arguments, and appropriately setting the rounding scale. - Instead of running a vanilla dynamic program on the rounded instance, we employ techniques from the growing field of pseudopolynomial-time Subset Sum algorithms, such as FFT, divide-and-conquer, and balls-into-bins hashing of [Bringmann, SODA 2017]. We also need other ingredients, including a surprising application of the recent Bounded Monotone (max,+)-Convolution algorithm by [Chi-Duan-Xie-Zhang, STOC 2022] (adapted by [Bringmann-Dürr-Polak, ESA 2024]), the notion of sum-approximation from [Gawrychowski-Markin-Weimann, ICALP 2018]'s #Knapsack approximation scheme, and a two-phase extension of Dyer's framework for handling tiny weights.
Köln | Im Chemiepark Knapsack in Hürth ist es in der Nacht von Dienstag auf Mittwoch, 9. und 10. Mai 2024, zu einer Fackeltätigkeit gekommen. Zwischen 22:30 Uhr und 00:30 Uhr verbrannte bei LyondellBasell einen Stoff kontrolliert als Sicherheitsmaßnahme, teilte der Chemiepark mit.
Dabei war ein Feuerschein und Ruß sichtbar sowie ein Geräusch zu vernehmen. Die zuständigen Behörden seien informiert worden, so das Notfallmanagement des Chemieparks.
Die Anlage verarbeitet Propylen, einen gasförmigen Kohlenwasserstoff, zu Kunststoffgranulaten und Pulver. Daraus werden alltägliche Gegenstände wie Folien, Verpackungen, Wasserrohre oder Autoteile hergestellt.
https://www.bachhausen.de/fackeltaetigkeit-im-chemiepark-knapsack-in-huerth/
This photo was taken in the old cemetery in #Hürth #Knapsack. It depicts one of dozens of bells affixed to a holly. Each bell represents a child who was lost to the community during the Second World War.
@norberteder
#photography #Fotografie #EOS5DMKIV
#52weekphotochallenge2024 #52wochenfotochallenge2024
#52weekphotochallenge
#52wochenfotochallenge
#silentsunday