A. Gál, Jing-Tang Jang, N. Limaye, M. Mahajan, Karteek Sreenivasaiah
{"title":"子集和的空间效率逼近","authors":"A. Gál, Jing-Tang Jang, N. Limaye, M. Mahajan, Karteek Sreenivasaiah","doi":"10.1145/2894843","DOIUrl":null,"url":null,"abstract":"SubsetSum is a well-known NP-complete problem: given t ∈ Z+ and a set S of m positive integers, output YES if and only if there is a subset S′⊆S such that the sum of all numbers in S′ equals t. The problem and its search and optimization versions are known to be solvable in pseudopolynomial time in general. We develop a one-pass deterministic streaming algorithm that uses space O(log t / ε) and decides if some subset of the input stream adds up to a value in the range {(1 ± ϵ)t}. Using this algorithm, we design space-efficient fully polynomial-time approximation schemes (FPTAS) solving the search and optimization versions of SubsetSum. Our algorithms run in O(1 / ϵ m2) time and O(1 / ϵ) space on unit-cost RAMs, where 1 + ϵ is the approximation factor. This implies constant space quadratic time FPTAS on unit-cost RAMs when ϵ is a constant. Previous FPTAS used space linear in m. In addition, we show that on certain inputs, when a solution is located within a short prefix of the input sequence, our algorithms may run in sublinear time. We apply our techniques to the problem of finding balanced separators, and we extend our results to some other variants of the more general knapsack problem. When the input numbers are encoded in unary, the decision version has been known to be in log space. We give streaming space lower and upper bounds for unary SubsetSum (USS). If the input length is N when the numbers are encoded in unary, we show that randomized s-pass streaming algorithms for exact SubsetSum need space Ω (√N/s) and give a simple deterministic two-pass streaming algorithm using O(√N log N) space. Finally, we formulate an encoding under which USS is monotone and show that the exact and approximate versions in this formulation have monotone O(log2t) depth Boolean circuits. We also show that any circuit using ε-approximator gates for SubsetSum under this encoding needs Ω(n/logn) gates to compute the disjointness function.","PeriodicalId":198744,"journal":{"name":"ACM Transactions on Computation Theory (TOCT)","volume":"22 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2016-06-29","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"5","resultStr":"{\"title\":\"Space-Efficient Approximations for Subset Sum\",\"authors\":\"A. Gál, Jing-Tang Jang, N. Limaye, M. Mahajan, Karteek Sreenivasaiah\",\"doi\":\"10.1145/2894843\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"SubsetSum is a well-known NP-complete problem: given t ∈ Z+ and a set S of m positive integers, output YES if and only if there is a subset S′⊆S such that the sum of all numbers in S′ equals t. The problem and its search and optimization versions are known to be solvable in pseudopolynomial time in general. We develop a one-pass deterministic streaming algorithm that uses space O(log t / ε) and decides if some subset of the input stream adds up to a value in the range {(1 ± ϵ)t}. Using this algorithm, we design space-efficient fully polynomial-time approximation schemes (FPTAS) solving the search and optimization versions of SubsetSum. Our algorithms run in O(1 / ϵ m2) time and O(1 / ϵ) space on unit-cost RAMs, where 1 + ϵ is the approximation factor. This implies constant space quadratic time FPTAS on unit-cost RAMs when ϵ is a constant. Previous FPTAS used space linear in m. In addition, we show that on certain inputs, when a solution is located within a short prefix of the input sequence, our algorithms may run in sublinear time. We apply our techniques to the problem of finding balanced separators, and we extend our results to some other variants of the more general knapsack problem. When the input numbers are encoded in unary, the decision version has been known to be in log space. We give streaming space lower and upper bounds for unary SubsetSum (USS). If the input length is N when the numbers are encoded in unary, we show that randomized s-pass streaming algorithms for exact SubsetSum need space Ω (√N/s) and give a simple deterministic two-pass streaming algorithm using O(√N log N) space. Finally, we formulate an encoding under which USS is monotone and show that the exact and approximate versions in this formulation have monotone O(log2t) depth Boolean circuits. We also show that any circuit using ε-approximator gates for SubsetSum under this encoding needs Ω(n/logn) gates to compute the disjointness function.\",\"PeriodicalId\":198744,\"journal\":{\"name\":\"ACM Transactions on Computation Theory (TOCT)\",\"volume\":\"22 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2016-06-29\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"5\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"ACM Transactions on Computation Theory (TOCT)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/2894843\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"ACM Transactions on Computation Theory (TOCT)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2894843","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 5
摘要
SubsetSum是一个著名的np完全问题:给定t∈Z+,有一个m个正整数的集合S,当且仅当存在一个子集S’≥t且S’中所有数的和等于t时,输出YES。该问题及其搜索优化版本已知在一般伪多项式时间内可解。我们开发了一种单遍确定性流算法,它使用空间O(log t / ε),并决定输入流的某个子集是否加起来等于{(1±λ)t}范围内的值。利用该算法,我们设计了空间高效的全多项式时间近似方案(FPTAS)来解决SubsetSum的搜索和优化版本。我们的算法在单位成本ram上运行在O(1 /御柱m2)时间和O(1 /御柱)空间中,其中1 +御柱是近似因子。这意味着当λ为常数时,单位成本ram上的常数空间二次时间FPTAS。以前的FPTAS在m中使用空间线性。此外,我们表明,在某些输入上,当一个解位于输入序列的短前缀内时,我们的算法可能在亚线性时间内运行。我们将我们的技术应用于寻找平衡分隔符的问题,并将我们的结果扩展到更一般的背包问题的一些其他变体。当输入数字以一元编码时,决策版本已知在日志空间中。我们给出一元SubsetSum (USS)的流空间下界和上界。如果输入长度为N,当数字以一元编码时,我们证明了精确SubsetSum的随机s-pass流算法需要Ω(√N/s)空间,并给出了一个简单的确定性两通道流算法,使用O(√N log N)空间。最后,我们给出了USS为单调的编码,并证明了该编码的精确和近似版本具有单调的O(log2t)深度布尔电路。我们还证明,在这种编码下,任何对SubsetSum使用ε-近似门的电路都需要Ω(n/logn)门来计算不相交函数。
SubsetSum is a well-known NP-complete problem: given t ∈ Z+ and a set S of m positive integers, output YES if and only if there is a subset S′⊆S such that the sum of all numbers in S′ equals t. The problem and its search and optimization versions are known to be solvable in pseudopolynomial time in general. We develop a one-pass deterministic streaming algorithm that uses space O(log t / ε) and decides if some subset of the input stream adds up to a value in the range {(1 ± ϵ)t}. Using this algorithm, we design space-efficient fully polynomial-time approximation schemes (FPTAS) solving the search and optimization versions of SubsetSum. Our algorithms run in O(1 / ϵ m2) time and O(1 / ϵ) space on unit-cost RAMs, where 1 + ϵ is the approximation factor. This implies constant space quadratic time FPTAS on unit-cost RAMs when ϵ is a constant. Previous FPTAS used space linear in m. In addition, we show that on certain inputs, when a solution is located within a short prefix of the input sequence, our algorithms may run in sublinear time. We apply our techniques to the problem of finding balanced separators, and we extend our results to some other variants of the more general knapsack problem. When the input numbers are encoded in unary, the decision version has been known to be in log space. We give streaming space lower and upper bounds for unary SubsetSum (USS). If the input length is N when the numbers are encoded in unary, we show that randomized s-pass streaming algorithms for exact SubsetSum need space Ω (√N/s) and give a simple deterministic two-pass streaming algorithm using O(√N log N) space. Finally, we formulate an encoding under which USS is monotone and show that the exact and approximate versions in this formulation have monotone O(log2t) depth Boolean circuits. We also show that any circuit using ε-approximator gates for SubsetSum under this encoding needs Ω(n/logn) gates to compute the disjointness function.