English

A Polynomial-Time Algorithm for Special Cases of the Unbounded Subset-Sum Problem

Data Structures and Algorithms 2021-03-17 v1

Abstract

The Unbounded Subset-Sum Problem (USSP) is defined as: given sum ss and a set of integers W{p1,,pn}W\leftarrow \{p_1,\dots,p_n\} output a set of non-negative integers {y1,,yn}\{y_1,\dots,y_n\} such that p1y1++pnyn=sp_1y_1+\dots+p_ny_n=s. The USSP is an NP-complete problem that does not have any known polynomial-time solution. There is a pseudo-polynomial algorithm for the USSP problem with O((p1)2+n)O((p_{1})^{2}+n) time complexity and O(p1)O(p_{1}) memory complexity, where p1p_{1} is the smallest element of WW \cite{PH}. This algorithm is polynomial in term of the number of inputs, but exponential in the size of p1p_1. Therefore, this solution is impractical for the large-scale problems. In this paper, first we propose an efficient polynomial-time algorithm with O(n)O(n) computational complexity for solving the specific case of the USSP where s>i=1k1qiqi+1qiqi+1 s> \sum_{i=1}^{k-1}q_iq_{i+1}-q_i-q_{i+1}, qiq_i's are the elements of a small subset of WW in which gcdgcd of its elements divides ss and 2kn2\le k \le n. Second, we present another algorithm for smaller values of ss with O(n2)O(n^2) computational complexity that finds the answer for some inputs with a probability between 0.50.5 to 11. Its success probability is directly related to the number of subsets of WW in which gcdgcd of their elements divides ss. This algorithm can solve the USSP problem with large inputs in the polynomial-time, no matter how big inputs are, but, in some special cases where ss is small, it cannot find the answer.

Keywords

Cite

@article{arxiv.2103.09080,
  title  = {A Polynomial-Time Algorithm for Special Cases of the Unbounded Subset-Sum Problem},
  author = {Majid Salimi and Hamid Mala},
  journal= {arXiv preprint arXiv:2103.09080},
  year   = {2021}
}

Comments

19 pages

R2 v1 2026-06-24T00:14:15.810Z