A Faster Pseudopolynomial Time Algorithm for Subset Sum

preprint2016arXivOpen access

Abstract

Given a multiset SS of nn positive integers and a target integer tt, the subset sum problem is to decide if there is a subset of SS that sums up to tt. We present a new divide-and-conquer algorithm that computes all the realizable subset sums up to an integer uu in O~ ⁣(min⁡{nu,u4/3,σ})\widetilde{O}\!\left(\min\{\sqrt{n}u,u^{4/3},σ\}\right), where σσ is the sum of all elements in SS and O~\widetilde{O} hides polylogarithmic factors. This result improves upon the standard dynamic programming algorithm that runs in O(nu)O(nu) time. To the best of our knowledge, the new algorithm is the fastest general algorithm for this problem. We also present a modified algorithm for cyclic groups, which computes all the realizable subset sums within the group in O~ ⁣(min⁡{nm,m5/4})\widetilde{O}\!\left(\min\{\sqrt{n}m,m^{5/4}\}\right) time, where mm is the order of the group.

Explore this paper’s authors, topics and related work.

Building this map preview

BZPEER is loading the nearby papers, people, topics and institutions for this page.

Reviews 0

Write a reviewWrite

No reviews yet.

Discussion 0

Add a commentWrite

No comments yet.