## Abstract

Given a set W = (w_{1}, . . ., w_{n}) of non-negative integer weights and an integer C, the #Knapsack problem asks to count the number of distinct subsets of W whose total weight is at most C. In the more general integer version of the problem, the subsets are multisets. That is, we are also given a set (u_{1}, . . ., u_{n}) and we are allowed to take up to u_{i} items of weight w_{i}. We present a deterministic FPTAS for #Knapsack running in O(n^{2.5}ε^{−} ^{1.5} log(nε^{−} ^{1}) log(nε)) time. The previous best deterministic algorithm [FOCS 2011] runs in O(n^{3}ε^{−} ^{1} log(nε^{−} ^{1})) time (see also [ESA 2014] for a logarithmic factor improvement). The previous best randomized algorithm [STOC 2003] runs in O(n^{2.5}log(nε^{−} ^{1}) + ε^{−} ^{2}n^{2}) time. Therefore, for the case of constant ε, we close the gap between the O(n^{2.5}) randomized algorithm and the O(n^{3}) deterministic algorithm. For the integer version with U = max_{i} (u_{i}), we present a deterministic FPTAS running in O(n^{2.5}ε^{−} ^{1.5} log(nε^{−} ^{1} log U) log(nε) log^{2} U) time. The previous best deterministic algorithm [TCS 2016] runs in O(n^{3}ε^{−} ^{1} log(nε^{−} ^{1} log U) log^{2} U) time.

Original language | English |
---|---|

Title of host publication | 45th International Colloquium on Automata, Languages, and Programming, ICALP 2018 |

Editors | Christos Kaklamanis, Daniel Marx, Ioannis Chatzigiannakis, Donald Sannella |

Publisher | Schloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing |

ISBN (Electronic) | 9783959770767 |

DOIs | |

State | Published - 1 Jul 2018 |

Event | 45th International Colloquium on Automata, Languages, and Programming, ICALP 2018 - Prague, Czech Republic Duration: 9 Jul 2018 → 13 Jul 2018 |

### Publication series

Name | Leibniz International Proceedings in Informatics, LIPIcs |
---|---|

Volume | 107 |

ISSN (Print) | 1868-8969 |

### Conference

Conference | 45th International Colloquium on Automata, Languages, and Programming, ICALP 2018 |
---|---|

Country/Territory | Czech Republic |

City | Prague |

Period | 9/07/18 → 13/07/18 |

### Bibliographical note

Funding Information:Supported in part by Israel Science Foundation grant 592/17 2 Supported in part by Israel Science Foundation grant 592/17

Publisher Copyright:

© Paweł Gawrychowski, Liran Markin, and Oren Weimann;.

## Keywords

- Approximate counting
- Functions
- K-approximating sets
- Knapsack

## ASJC Scopus subject areas

- Software