Abstract 1 Introduction 2 Preliminaries 3 An FPTAS for k-Subset Sum Ratio 4 An FPTAS for k-way Number Partitioning Ratio 5 An FPTAS for k-SSR with linear dependence on n References

Approximation Schemes for k-Subset Sum Ratio and k-Way Number Partitioning Ratio

Sotiris Kanellopoulos111Equal Contribution ORCID National Technical University of Athens and Archimedes, Athena Research Center, Greece Giorgos Mitropoulos111Equal Contribution ORCID National Technical University of Athens and Archimedes, Athena Research Center, Greece Antonis Antonopoulos ORCID National Technical University of Athens, Greece Nikos Leonardos ORCID National Technical University of Athens, Greece Aris Pagourtzis ORCID National Technical University of Athens and Archimedes, Athena Research Center, Greece Christos Pergaminelis ORCID National Technical University of Athens and Archimedes, Athena Research Center, Greece Stavros Petsalakis ORCID National Technical University of Athens, Greece Kanellos Tsitouras ORCID National Technical University of Athens, Greece
Abstract

The Subset Sum Ratio problem (SSR) asks, given a multiset A of positive integers, to find two disjoint subsets of A such that the largest-to-smallest ratio of their sums is minimized. In this paper we study the k-version of SSR, namely k-Subset Sum Ratio (k-SSR), which asks to minimize the largest-to-smallest ratio of sums of k disjoint subsets of A. We develop an approximation scheme for k-SSR running in O(n2k/εk1) time, where n=|A| and ε is the error parameter. To the best of our knowledge, this is the first FPTAS for k-SSR for fixed k>2.

We also study the k-way Number Partitioning Ratio (k-PART) problem, which differs from k-SSR in that the k subsets must constitute a partition of A; this problem in fact corresponds to the objective of minimizing the largest-to-smallest sum ratio in the family of MultiwayNumberPartitioning problems. We present a more involved FPTAS for k-PART, also achieving O(n2k/εk1) time complexity. Notably, k-PART is also equivalent to the Minimum Envy-Ratio problem with identical valuation functions, which has been studied in the context of fair division of indivisible goods. Thus, for the case of identical valuations, our FPTAS represents a significant improvement over the O(n4k2+1/ε2k2) bound obtained by Nguyen and Rothe’s FPTAS [36] for Minimum Envy-Ratio with general additive valuations.

Lastly, we propose a second FPTAS for k-SSR, which employs carefully designed calls to the first one; the new scheme has a time complexity of O~(n/ε3k1), thus being much faster when n1/ε.

Keywords and phrases:
Fully polynomial-time approximation schemes, Subset Sum Ratio, Number Partitioning, Fair division, Envy minimization, Pseudo-polynomial time algorithms
Copyright and License:
[Uncaptioned image] © Sotiris Kanellopoulos, Giorgos Mitropoulos, Antonis Antonopoulos, Nikos Leonardos,
Aris Pagourtzis, Christos Pergaminelis, Stavros Petsalakis, and Kanellos Tsitouras; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Approximation algorithms analysis
Related Version:
Full Version: https://arxiv.org/abs/2503.18241 [24]
Funding:
Supported by project MIS 5154714 of the National Recovery and Resilience Plan Greece 2.0 funded by the European Union under the NextGenerationEU Program.
Editors:
Ho-Lin Chen, Wing-Kai Hon, and Meng-Tsung Tsai

1 Introduction

The Subset Sum and Partition problems are fundamental in combinatorial optimization, with numerous applications in fair resource allocation, cryptography and scheduling. The Equal Subset Sum (ESS) problem [43] asks for two disjoint subsets of a given set with equal sums, while its optimization counterpart, Subset Sum Ratio (SSR) [43, 4], asks to minimize the ratio of sums of two disjoint subsets. These NP-hard problems arise in bioinformatics [15, 14], game theory and economics [30, 18], and cryptography [44], among others. A special case of ESS belongs to PPP [37], which is a subclass of TFNP, further adding to the ongoing interest for these problems.

In this paper we consider variations involving multiple subsets, namely k-Subset Sum Ratio (k-SSR) and k-way Number Partitioning Ratio (k-PART)222This problem is usually referred to as “multiway”, but we call it “k-way” to emphasize that k is fixed.. In k-SSR, the goal is to find k disjoint subsets such that the largest-to-smallest ratio of their sums is minimized, while k-PART further requires these subsets to form a partition of the input. Since these problems are NP-hard, we consider approximation algorithms. In particular, we present fully polynomial-time approximation schemes (FPTASs) for both problems.

Our results apply, among others, to scheduling tasks across k processors (e.g. [39, 17, 22, 16]), as well as to fair division of indivisible goods, in particular the study of envy in discrete settings (e.g. [30, 36, 28] and more recently [2, 41, 45]). Specifically, k-PART is equivalent to the Minimum Envy-Ratio problem [30] with identical valuation functions, for which we achieve a significant improvement over (more general) earlier work [36].

Related work

Since Bellman’s seminal work on Subset Sum [5], no major improvement had occurred until a recent spike in interest culminated in various faster pseudo-polynomial algorithms [26, 7, 23, 12] and FPTASs [25, 20].

The ESS and SSR problems have seen recent advances, including FPTASs for SSR [35, 31, 1, 8] and an improved exact algorithm for ESS [33]. Notably, Bringmann [8] provided an SSR FPTAS running in time O(n/ε0.9386), which is faster than known Subset Sum lower bounds. He achieved this in part by considering two cases based on input density. If the input is dense, a pigeonhole argument guarantees two subsets with sums within 1+ε and removing their intersection yields an approximate solution. If the input is sparse, keeping only the polylog(1/ε) largest elements is proven to be sufficient for the approximation. Regarding variations of (Equal) Subset Sum involving k2 subsets, [3] extends the techniques of [26, 7] to provide both deterministic and randomized pseudo-polynomial algorithms.

For Partition, advances include a number of (very) recent FPTASs [34, 9, 11], with the latest work by Chen et al. [13] achieving an FPTAS running in time O~(n+1/ε), which is near optimal under the Strong Exponential Time Hypothesis. In MultiwayNumberPartitioning [6, 40, 27, 38], different objective functions define various approaches to distributing elements among subsets, such as minimizing the maximum sum, maximizing the minimum sum, minimizing the largest-to-smallest difference of sums, or minimizing the largest-to-smallest ratio of sums. These objectives are not comparable: there are instances showing that the corresponding optimal solutions differ; we discuss this in detail in Subsection 2.1, along with applications of each variation.

Bazgan et al. [4] provided the first FPTAS for SSR and demonstrated that Subset Sum Difference does not admit an FPTAS, unless 𝖯=𝖭𝖯. Similar arguments that apply to Partition have been further studied in [42]. Additionally, various related problems such as 3-Partition and Bin Packing are strongly NP-hard [19], implying that they do not admit an FPTAS or a pseudo-polynomial time algorithm unless 𝖯=𝖭𝖯. However, these problems involve a non-constant number of subsets. For our problems, we consider a fixed number k of disjoint subsets. This restriction is quite natural in applications, as it is more likely to distribute a great amount of items to a small number of agents.

Sahni presents an FPTAS for MultiwayNumberPartitioning in [39] that minimizes the largest sum. However, this technique does not seem applicable to minimize the ratio. In [30], Lipton et al. show a PTAS for Minimum Envy-Ratio with identical valuations and non-constant number k of agents, while claiming the existence of an FPTAS when k is constant. Furthermore, in [36] Nguyen and Rothe show an FPTAS running in O(n4k2+1/ε2k2) time for the same problem with fixed k and general additive valuation functions.

Our contribution

In this paper, we present two FPTASs for k-SSR achieving running times333O~ hides polylog(1/ε) factors. of O(n2k/εk1) and O~(n/ε3k1), and an FPTAS for k-PART running in time O(n2k/εk1). The latter represents a considerable improvement when compared to the FPTAS of [36], which is the best known bound for k-PART, although it concerns a more general setting. Note that the largest-to-smallest ratio of sums is the only objective function considered in the literature that both admits an FPTAS and is of interest to the study of envy. Our approach builds upon methods established for SSR [35, 31, 8], while introducing novel strategies to address the multi-subset setting and to comply with the partitioning constraint.

We present our first FPTAS for k-SSR in Section 3; to the best of our knowledge, this is the first ever FPTAS for this problem. To this end, we define a restricted version of k-SSR, for which we present a pseudo-polynomial time algorithm. Our approach relies on proving that the optimal solution of the restricted problem satisfies certain properties, while carefully handling edge cases involving large singleton sets.

Concerning k-PART, the partitioning constraint renders the application of our techniques more involved; we overcome this in Section 4 by identifying a perfect restriction parameter that ensures the existence of a well-behaved optimal solution. Interestingly, although this does not yield a pseudo-polynomial time algorithm for the respective restricted case, combining the aforementioned property with approximation techniques yields an FPTAS for k-PART.

Additionally, building on Bringmann’s work [8], we find that applying density arguments to k-SSR encounters an obstacle in the dense case: obtaining k subsets with approximately equal sums is unhelpful, since removing their intersection does not guarantee a feasible k-SSR solution. We resolve this in Section 5 by restricting our density argument to singletons and subsequently using our FPTAS from Section 3 as a subroutine on reduced instances.

2 Preliminaries

2.1 Objective functions for Multiway Number Partitioning

There are four objective functions commonly used for MultiwayNumberPartitioning, each one having applications in different fields.

  1. 1.

    Minimizing the largest sum. This is also known as makespan minimization and is used for the Minimum Finish Time problem in the context of identical machine scheduling [39, 22]. It is also used in problems related to bin packing [29].

  2. 2.

    Maximizing the smallest sum. This objective function has been studied in works related to scheduling [17] and bin packing [29]. It has also been studied in works related to the maximin share [21, 28, 10], which is a criterion for fair item allocation. Note that algorithms for objective function (2) can be modified to work for (1) and vice versa [27].

  3. 3.

    Minimizing the difference between the largest and the smallest sum. This objective function is less common, but it has been studied in works related to MultiwayNumberPartitioning, such as [32, 27]. No FPTAS exists for this objective [4, 42].

  4. 4.

    Minimizing the ratio between the largest and the smallest sum (e.g. [3]). Although this objective function is often overlooked in works regarding MultiwayNumberPartitioning (e.g. [27, 40]), it has been studied in the field of fair division, in the form of the Minimum Envy-Ratio problem [30, 36], as well as in the context of scheduling [16].

In this paper, we consider (4) as an objective function for k-way Number Partitioning. Observe that all four objectives are equivalent when k=2; this does not hold for k3. This is well known for the first three objectives [27], but, for the sake of completeness, we will provide some counterexamples that prove that (4) is not equivalent to any of the other three, for k3.

It is easy to find counterexamples for the first two. Consider input {1,2,3,10} for k=3. The partition ({1},{2,3},{10}) minimizes the largest sum, but does not have optimal ratio. Similarly, consider {5,5,5,10} for k=3. The partition ({5},{5},{5,10}) maximizes the smallest sum, but does not have optimal ratio.

Finally, consider input {16,16,18,20,24,27,29,40} for k=4. The following table compares the solution that minimizes the difference with the solution that minimizes the ratio.

Table 1: Comparison of Multiway  Number  Partitioning solutions.
Solution Sums Difference Ratio
{40},{16,16,18},{24,27},{29,20} {40,50,51,49} 11 1.275
{40,16},{24,20},{16,29},{18,27} {56,44,45,45} 12 1.27273

2.2 Notation and problem definitions

Let [n]={1,,n} for a positive integer n. We assume that the input A={a1,,an} of our problems is sorted444If the input is not sorted, an additional O(nlogn) time would be required. This does not affect the time complexity of any of our algorithms, assuming that O~ also hides polylog(n) factors., i.e. a1an.

Definition 1 (Sum of a subset of indices).

Given a multiset A={a1,,an} of positive integers and a set of indices S[n] we define:

Σ(S,A)=iSai
Definition 2 (Max and Min of k subsets).

Let A={a1,,an} be a multiset of positive integers and S1,,Sk be k disjoint subsets of [n]. We define the maximum and minimum sums obtained by these sets on A as:

M(S1,,Sk,A)=maxi[k]Σ(Si,A)andm(S1,,Sk,A)=mini[k]Σ(Si,A)
Definition 3 (Largest-to-smallest ratio of k subsets).

Let A={a1,,an} be a multiset of positive integers and S1,,Sk be k disjoint subsets of [n]. We define the largest-to-smallest ratio of these k subsets on A as:

(S1,,Sk,A)={M(S1,,Sk,A)m(S1,,Sk,A)if m(S1,,Sk,A)>0+if m(S1,,Sk,A)=0

Throughout the paper, we refer to the largest-to-smallest ratio of k subsets simply as ratio.

We define the k-Subset Sum Ratio (k-SSR) problem as follows.

Definition 4 (k-SSR).

Given a multiset A={a1,,an} of positive integers, find k disjoint subsets S1,,Sk of [n], such that (S1,,Sk,A) is minimized.

Observation 5.

Only the maximum and minimum sums affect the ratio function. If the remaining sets are altered without a sum becoming greater than the maximum or smaller than the minimum, the ratio remains unaffected. Additionally, if the minimum sum increases or the maximum sum decreases (while the other remains unchanged), the ratio decreases.

Note that multisets are allowed as input, since they are not a trivial case for k-SSR (in contrast to regular SSR), unless there is a number with multiplicity k or more. Throughout the paper, when referring to a solution S=(S1,,Sk), we will use the simplified notations (S,A),M(S,A),m(S,A) to denote ratio, maximum and minimum sums respectively.

We similarly define the k-way Number Partitioning Ratio (k-PART) problem.

Definition 6 (k-PART).

Given a multiset A={a1,,an} of positive integers, find k disjoint subsets S1,,Sk of [n] with i=1kSi=[n], such that (S1,,Sk,A) is minimized.

3 An FPTAS for k-Subset Sum Ratio

We define a restricted version of k-SSR, called k-SSRR, in which the largest element555Throughout the paper, the term element of a set refers to the index 1in instead of the value ai, unless explicitly stated otherwise. of the first set (S1) is forced to be the smallest among the maxima of all k sets and equal to a given number p. This definition generalizes the Semi-Restricted Subset-Sums Ratio of [31].

Definition 7 (k-SSRR).

Given a sorted multiset A={a1,,an} of positive integers and an integer p,1pnk+1, find k disjoint subsets S1,,Sk of [n] with max(S1)=p and max(Si)>p for 1<ik, such that (S1,,Sk,A) is minimized.666The case p>nk+1 would result in the instance having no feasible solution.

Most of this section is dedicated to producing an FPTAS for the restricted version k-SSRR, which is subsequently used as a subroutine to obtain an FPTAS for k-SSR, by iterating over all possible values of p. Similar reductions to a version with restricted largest elements have been used in approximation schemes for Subset Sum Ratio [35, 31, 8]. In our paper, this technique is used to guarantee that each set Si contains a sufficiently large element, which is critical to ensure that the algorithm is an FPTAS.

3.1 Properties of optimal solutions to k-SSRR instances

First, we want to guarantee that there is always an optimal solution to k-SSRR that satisfies a few important properties. Recall that the input is sorted. Define Q=i=1pai and q=max{iaiQ}. Since Q=Σ([p],A) and S1[p], the following is immediate by Def. 2.

Observation 8.

For all feasible solutions (S1,,Sk) to a k-SSRR instance (A,p)

m(S1,,Sk,A)Σ(S1,A)Q.

Observations 5 and 8 are used in the proof of the following theorem to transform solutions without increasing their ratio.

Theorem 9.

For any k-SSRR instance (A,p) there exists an optimal solution whose sets satisfy the following:

  1. 1.

    For all sets Si containing only elements j with ajQ it holds that Σ(Si,A)<2Q.

  2. 2.

    Every set containing an element j with aj>Q is a singleton.

  3. 3.

    The union of singleton sets {j} s.t. aj>Q is i=1x{q+i}, where x0 is the number of these singleton sets.

Proof.

Let S=(S1,,Sk) be an arbitrary feasible solution. If it violates property 1, i.e. there exists a set Si in S that only contains elements j with ajQ and has sum Σ(Si,A)2Q, we transform it as follows. For all jSi, we have

m(S,A)Σ(S1,A)QΣ(Si{j},A)<Σ(Si,A)M(S,A).

Thus, if we remove an element j from Si, the ratio cannot increase. We remove the smallest element from Si. As long as the solution still has a set Si violating property 1, we can apply the same process repeatedly, until there are no more such sets. Since we are only removing elements, no new sets violating property 1 may appear during this process. Note that the largest element of every set remains intact, therefore the k-SSRR restrictions max(S1)=p and max(Si)>p for 1<ik are satisfied.

If the new solution S violates property 2, i.e. it contains a set Si with an element j s.t. aj>Q and |Si|>1, we apply the following transformation. It holds that

m(S,A)Σ(S1,A)Q<Σ({j},A)<Σ(Si,A)M(S,A).

As such, replacing set Si with set {j} will result in equal or smaller ratio. We repeat this for every such set Si, thus yielding a solution in which every such set is a singleton. Note that the derived solution is a feasible k-SSRR solution and it still satisfies property 1, since we did not modify sets that contain only elements j with ajQ.

Finally, if the new solution S′′ violates property 3, i.e. it contains a singleton set {u} s.t. au>Q and there is an unselected777An element that is not in any set Si of the solution. element v such that q<v<u, we do the following. It holds that

m(S′′,A)Σ(S1,A)Q<Σ({v},A)Σ({u},A)M(S′′,A).

Thus, selecting v instead of u does not increase the ratio. Repeating this for all u and v satisfying the above mentioned property forces the union of these singleton sets to contain the smallest indices possible, yielding a feasible solution that satisfies all three properties.

In conclusion, for any feasible solution we can find another one that satisfies all properties 1, 2, 3 and has equal or smaller ratio. Thus, applying this to an arbitrary optimal solution proves the theorem.

3.2 A pseudo-polynomial time algorithm for k-SSRR

In this subsection we present an exact algorithm for k-SSRR, which runs in O(nQk1) time and returns an optimal solution satisfying the properties of Theorem 9. We present the algorithm in two parts for simplicity. Algorithm 1 picks certain singleton sets with large elements and calls Algorithm 2 to obtain candidate partial solutions for the remaining sets. We next describe both algorithms in detail; we refer the reader to the full version of this paper [24] for the respective pseudocode.

Algorithm 1 Exact_k-SSRR(A,p).

Algorithm 1 iterates over all possible values for the number x of singleton sets {j}, with aj>Q, specifically x{0,,min{k1,nq}}. To construct these x sets, it picks the smallest elements of A that are greater than Q, in accordance to property 3 of Theorem 9. For each x, Algorithm 1 then calls Algorithm 2 as a subroutine; the latter uses dynamic programming (DP) to output partial solutions for A={aiAaiQ} and k=kx. Note that Algorithm 2 is only called in cases where p|A|k+1=qk+x+1; otherwise, there is no feasible k-SSRR solution for that value of x (see Definition 7).

Algorithm 1 appends the x precalculated singletons to each partial solution returned by Algorithm 2 and compares the ratio of each solution in order to find the best one. The k-SSRR solution returned by Algorithm 1 is optimal, as will be shown in Theorem 12.

Algorithm 2 DP_k-SSRR(A,k,p).

Algorithm 2 draws from techniques of [31] and [35], while employing a more involved DP formulation to address the multi-subset setting. A DP table T is used to systematically construct partial solution sets, while ensuring that the constraints of k-SSRR are satisfied.

Each cell of the DP table stores a tuple (S1,,Sk,sum1), where Sj (1jk) are the sets associated with said cell and sum1=Σ(S1,A). The coordinates of a cell Ti[D][V] consist of the following components:

  1. 1.

    An index i, indicating the number of elements examined so far.

  2. 2.

    A difference vector D=[d2,d3,,dk] (sorted in nondecreasing order) that encodes the differences between the sum of S1 and the sums of the other sets, i.e. dj=Σ(S1,A)Σ(Sj,A).

  3. 3.

    A Boolean validity vector V=[v2,v3,,vk], where each vj is true iff max(Sj)>p.

The differences are used as coordinates in the DP table instead of the sums of the sets, in order to decrease the complexity of the algorithm by an order of Q (see Lemma 13). We also introduce V as a coordinate, which is crucial to ensure optimality without increasing the complexity of the algorithm; essentially, the ratio of two tuples can be compared only if all of their validity Booleans are equal (see Lemma 10).

We now describe the DP process in a bottom-up manner. All cells Ti[D][V] are initialized to empty tuples, except the cell T0[ap,,ap][false,,false], which is initialized to ({p},,,,ap), thus forcing p to be contained in S1. Every element i[q] is processed in increasing order. Assuming row Ti1 contains tuples constructed by using elements up to i1 (along with p, which is always in S1), the next row Ti is filled as follows. For each non-empty tuple C=(S1,,Sk,sum1) contained in some cell Ti1[D][V], D=[d2,,dk], V=[v2,,vk], we sequentially consider the cases below:

  • Element i is not added to any set of C. In this case, C is copied into Ti[D][V].

  • Element i is added to S1 (only if i<p). This produces a new tuple C=(S1{i},,Sk,sum1+ai) to be inserted into Ti[D][V], where D=[d2,,dk] is the appropriately updated difference vector, i.e. dj=dj+ai, 1<jk.

  • Element ip is added to each set Sj (1<jk), one at a time. This produces a new tuple (S1,,Sj{i},,Sk,sum1), a difference vector [d2,,dk] and a validity vector [v2,,vk]. Specifically, vj is set to true if i>p and dj is set to djai, while vu=vu and du=du for all uj. This difference vector is then sorted in nondecreasing order, while the sets and the validity vector are rearranged accordingly, thus producing a tuple C and vectors D,V. The tuple C is then inserted into Ti[D][V].

Algorithm 2 prevents the new tuple from being inserted into a cell in the following cases:

  1. 1.

    The cell already contains another tuple with equal or larger sum1 (see Lemma 10).

  2. 2.

    The updated vector D contains a difference smaller than or equal to 2Q. Such a tuple can be ignored, due to property 1 of Theorem 9.

In the end, Algorithm 2 returns all non-empty tuples contained in cells Tq[D][true,…,true] (for all D), thus ensuring that every partial solution returned to Algorithm 1 complies with the k-SSRR restrictions. This concludes the description of Algorithm 2.

We say that a conflict occurs when a tuple is to be stored in a cell Ti[D][V] which is already occupied by another (non-empty) tuple. Note that conflicting tuples must have the same difference and validity vectors and only use elements up to i. Since the DP process must minimize the overall ratio, including potential singletons not participating in said process, conflict resolution becomes more involved for k>2.

Lemma 10 (Conflict resolution).

Let C1=(S1,,Sk,sum1) and C2=(S1,,Sk,sum1) be two tuples that result in a conflict in a cell Ti[D][V] of the DP table of Algorithm 2, such that sum1<sum1. No optimal k-SSRR solution may use888In our dynamic programming framework, we say that a solution S uses a tuple C=(S1,,Sk,sum1) if C appears in an intermediate step of the construction of S. C1.

Proof.

Let S be a k-SSRR solution. Split S in two: Ssmall, containing the k sets returned by Algorithm 2, and Slarge, containing the singletons {j} s.t. aj>Q. Assume Ssmall uses C1.

By assumption, C1 and C2 have identical D and V vectors and their sets involve only elements from [i]. This implies that any combination of elements larger than i that can later be added to sets of C1 to construct a partial999We denote as partial a solution for which Slarge will be appended to obtain a feasible k-SSRR solution. solution with vectors D,V can also be added to the corresponding sets of C2 to construct a partial solution with the same vectors D,V. Let Ssmall be the partial solution obtained by using C2 instead of C1 and adding the same combination of elements that would have been used to obtain Ssmall from C1. Consider the solution S that is obtained by appending Slarge to Ssmall. Note that Ssmall and Ssmall have the same validity vector, hence S is also a feasible k-SSRR solution.

Let Ms,ms be the maximum and minimum sum of Ssmall respectively and Ms,ms those of Ssmall. Since sum1<sum1 and the difference vector D is the same for both solutions, it follows that Ms<Ms, ms<ms and Msms=Msms. From these, we obtain

Msms>Msms. (1)

Let {t}Slarge be the singleton set with the largest element. For all {i}Slarge such that it, we have

msΣ(S1,A)Q<Σ({i},A)Σ({t},A).

This implies that {i} (it) does not affect the ratio and {t} only affects the ratio if at>Ms. Thus, all the sets in Slarge can be ignored when calculating (S,A), except for {t} if at>Ms. The same holds for (S,A) and Ms. Consider three cases:

  1. 1.

    Ms<Ms<at. In this case, (S,A)=at/ms and (S,A)=at/ms. Since ms<ms: (S,A)>(S,A).

  2. 2.

    Ms<atMs. In this case, (S,A)=at/ms>Ms/ms and (S,A)=Ms/ms. By inequality (1): (S,A)>(S,A).

  3. 3.

    atMs<Ms. In this case, (S,A)=Ms/ms and (S,A)=Ms/ms. By inequality (1): (S,A)>(S,A).

In all cases (S,A)>(S,A), therefore S cannot be optimal.

Lemma 11 (Feasibility).

Every k-tuple of sets considered by Algorithm 1 is a feasible k-SSRR solution.

Proof.

The x singletons constructed by Algorithm 1 are disjoint and contain elements larger than q. In Algorithm 2, every element iq is processed in increasing order and added to at most one set at a time. As such, all sets are disjoint. Note that p is contained in S1 and S1 cannot receive a larger element. Recall that vi is set to true when Si receives an element j>p and Algorithm 2 only returns solutions with V=[true,,true]. Thus, all k-SSRR restrictions regarding the largest element of each set are satisfied.

The proof of the following theorem uses Lemmas 10 and 11. The main idea is to show that Algorithm 1 considers and therefore finds the optimal solution whose existence is guaranteed by Theorem 9.

Theorem 12 (Optimality).

Algorithm 1 returns an optimal solution for k-SSRR.

Proof.

Lemma 11 guarantees that Algorithm 1 returns a feasible k-SSRR solution, so we only need to prove that its ratio is optimal. Let S be the optimal k-SSRR solution guaranteed by Theorem 9. We split S in two: Slarge, which contains the singleton sets {j} s.t. aj>Q, and Ssmall, which contains the rest of the sets. Note that the number x of these singletons is bounded by k1 or by the amount of sufficiently large elements, i.e. nq. Thus, Algorithm 1 considers every Slarge that satisfies properties 2 and 3 of Theorem 9, including Slarge.

Recall that Algorithm 1 uses Algorithm 2 as a subroutine in order to obtain candidate partial solutions, to which Slarge will be appended. We would like Ssmall to be contained in the solutions returned by Algorithm 2.

Algorithm 2 prunes a solution if a difference dj would become lower than or equal to 2Q. Any Ssmall satisfying property 1 of Theorem 9 will not be affected by this. This includes Ssmall.

When there is a conflict in a cell Ti[D][V] between two tuples with different sum1 values, Ssmall cannot use the one with smaller sum1 (by Lemma 10), since S is a optimal. When there is a conflict in a cell Ti[D][V] between two tuples C1,C2 with equal sum1 values, observe that both tuples have exactly the same sums (but different sets), use only elements up to i and have the same validity vector. This implies that any combination of elements greater than i that can later be added to sets of C1 can also be added to the same sets of C2 and vice versa. Thus, any combination of sums that can be reached through C1 can also be reached through C2 and vice versa. This means that if one of these tuples leads to Ssmall, the other one leads to another partial solution Ssmall, which has exactly the same sums as Ssmall. Appending Slarge to Ssmall yields a solution with the same sums as S, i.e. another optimal solution.

It follows directly from the description of Algorithm 2 that it constructs every possible combination of disjoint sets S1,,Skx with max(S1)=p, apart from the ones pruned as explained in the previous paragraphs.

Therefore, the partial solutions returned by Algorithm 2 contain Ssmall or another partial solution with the same sums, which also leads to an optimal solution when appended with Slarge. In either case, Algorithm 1 will find an optimal solution when iterating to find the best ratio.

Lemma 13 (Complexity).

Algorithm 1 runs in time O(nQk1).

Proof.

Algorithm 1 calls Algorithm 2 once for each value of x in {0,,min{k1,nq}}, where x is the number of singleton sets {j} s.t. aj>Q. For a fixed x, Algorithm 2 is applied to an instance with k=kx sets and q=O(n) elements.

Due to the pruning done in Algorithm 2, it holds that j{2,,k}: 2Q<djQ, where the second inequality holds because Σ(S1,A)Q. Since the algorithm stores D in non-decreasing order (i.e., d2d3dk), there are O((3Q)k1/(k1)!) distinct difference vectors. Taking into account the validity vector V and all Ti’s, we obtain the following bound for the amount of DP cells: O(n(6Q)k1/(k1)!).

For constant k, this bound becomes O(nQk1). Note that all operations of Algorithm 2 on DP cells (such as sorting the difference vector after adding an element) run in time O(k), so the time complexity of Algorithm 2 is O(nQk1)=O(nQkx1). Hence, the time complexity of Algorithm 1 is bounded by:

x=0k1nQkx1=O(nQk1)

3.3 FPTASs for 𝒌-𝐒𝐒𝐑𝐑 and 𝒌-𝐒𝐒𝐑

By Theorem 12 and Lemma 13, Algorithm 1 solves k-SSRR in pseudo-polynomial time. To obtain an FPTAS for k-SSRR, we scale (and round down) the input set by a factor δ=εap3n (cf. [31, 35]).

This leads to Algorithm 3, which calls Algorithm 1 in order to find an optimal solution for the rounded input Ar, yielding a (1+ε)-approximation of the (largest-to-smallest) ratio of an optimal solution (S1,,Sk) of the original k-SSRR instance.

Algorithm 3 FPTAS_k-SSRR(A,p,ε).
Theorem 14 (k-SSRR approximation).

Let (S1,,Sk) be the sets returned by Algorithm 3 for a k-SSRR instance (A={a1,,an}, p) with error parameter ε. Let (S1,,Sk) be an optimal solution for the same k-SSRR instance. Then:

(S1,,Sk,A)(1+ε)(S1,,Sk,A)

The proof of Theorem 14 closely follows the proofs presented in section 5 of [31]. We include the proof in the full version of this paper [24].

By Lemma 13, Algorithm 3 solves k-SSRR in O(nQk1) (where Q=i=1pair). Since we scaled the input by δ, the values of Q are bounded as follows:

Qk1=(i=1pair)k1(napr)k1(napδ)k1=(3n2ε)k1=3k1n2k2εk1

Therefore, Algorithm 3 runs in time O(n2k1/εk1). To obtain an FPTAS for the (unrestricted) k-SSR problem, we run Algorithm 3 once for each possible value of p (1pnk+1) and pick the solution with the best ratio. Thus, we obtain the main theorem of this section.

Theorem 15.

There is an FPTAS for k-SSR that runs in O(n2k/εk1) time.

4 An FPTAS for k-way Number Partitioning Ratio

In this section we present an FPTAS for k-way Number Partitioning Ratio (k-PART) by extending and refining the techniques of Section 3. Recall that in the case of k-PART, every element needs to be assigned to a set. We define the following restricted version of k-PART, which is analogous to k-SSRR.

Definition 16 (k-PARTR).

Given a sorted multiset A={a1,,an} of positive integers and an integer p,1pnk+1, find k disjoint subsets S1,,Sk of [n] with i=1kSi=[n], max(S1)=p and max(Si)>p for 1<ik, such that (S1,,Sk,A) is minimized.

The main challenge in expanding our technique to k-PART stems from the fact that there exist instances (A,p) of k-PARTR where all optimal solutions violate one or more of the properties of Theorem 9. This is a problem, since the time complexity of our k-SSRR algorithm relies heavily on Theorem 9.

We overcome this by showing that there exists a p such that the corresponding optimal solution S to (A,p) is well-behaved (see Theorem 18). It suffices to guarantee that for p, the algorithm will consider S (or another equivalent solution) as a candidate solution for the rounded k-PARTR instance. Note that since S is not guaranteed to be optimal for the rounded k-PARTR instance, we obtain neither an exact algorithm nor an FPTAS for the restricted problem k-PARTR.

4.1 Properties of k-PARTR instances

Definition 17 (Perfect p).

Let A={a1,,an} be the input to the k-PART problem. We call a number p:1pnk+1 perfect for A if the optimal solution(s) for the k-PARTR instance (A,p) have the same (largest-to-smallest) ratio as the optimal solution(s) for the k-PART instance A.

We define Q=i=1pai and q=max{iaiQ}, in the same manner as we did for k-SSRR. The next theorem is analogous to Theorem 9, with a key difference: its properties are only guaranteed for some perfect p. Its proof uses arguments similar in spirit to the proof of Theorem 9. Special attention is required since elements that violate a property are reassigned to other sets rather than being removed entirely from the solution. This may cause some k-PARTR restriction to be violated, thus rendering the proof significantly more involved.

Theorem 18.

Given a k-PART instance A, there exists a perfect p for A, for which there is an optimal solution for the k-PARTR instance (A,p) satisfying the following properties:

  1. 1.

    For all sets Si containing only elements jq it holds that Σ(Si,A)<2Q.

  2. 2.

    All elements j>q are contained in singleton sets.

Proof.

For some arbitrary value of p, let S=(S1,,Sk) be an arbitrary feasible solution for the k-PARTR instance (A,p). If S breaks property 2, i.e. there exists a set Si in S with |Si|>1 containing an element j>q, we do the following. Let Sm be a set with minimum sum101010There could be multiple sets with the same (minimum) sum. and u the smallest element of Si. The following inequalities hold.

m(S,A)=Σ(Sm,A)Q<Σ(Si{u},A)
Σ(Sm{u},A)Q+au<Σ(Si,A)M(S,A)

From these we can infer that, by moving u from Si to Sm, the minimum sum cannot decrease and the maximum cannot increase. Thus, we move u as described, yielding a solution S with (S,A)(S,A). However, it might be the case that Sm is S1 and adding u to it breaks the restrictions of k-PARTR, so S might not be a feasible solution for (A,p). For the new solution S, define p as the minimum among the maxima of its k sets and call S1 the set that contains p. Note that S is a feasible solution for the k-PARTR instance (A,p).

If S still breaks property 2 for Q=i=1pai and q=max{iaiQ}, apply the same process. By doing this repeatedly, p cannot decrease and the ratio of the solution cannot increase. Note that p cannot exceed nk+1 with this process, so at some point p will stop increasing. Let pf be this final value and define Qf,qf accordingly for pf. Repeating the process will at some point yield a solution that satisfies property 2 for the k-PARTR instance (A,pf).

Let S′′ be the feasible solution for the k-PARTR instance (A,pf), derived from the process described in the previous paragraphs. S′′ satisfies property 2 for values Qf,qf. If S′′ breaks property 1, i.e. it contains a set Si consisting only of elements jqf and having sum Σ(Si,A)2Qf, we apply the following transformation. Let Sm be a set with minimum sum. Take the smallest element j from Si and move it to Sm. Observe that ajQf. Hence, the following inequalities hold.

m(S′′,A)=Σ(Sm,A)QfΣ(Si{j},A)
Σ(Sm{j},A)2QfΣ(Si,A)M(S′′,A)

From these we can infer that, by moving j from Si to Sm, the minimum sum cannot decrease and the maximum cannot increase. We repeatedly apply this process until we end up with a solution satisfying property 1, just like we did in the previous paragraphs for property 2, since the same arguments hold regarding the increment of p and the ratio not increasing. Furthermore, this transformation preserves property 2, as p cannot decrease through this process and we only add elements to the set with the smallest sum (which cannot be a set containing an element j>q).

In conclusion, for any feasible solution for a k-PARTR instance (A,p) that violates some property, we can find a feasible solution for another k-PARTR instance (A,pnew) that satisfies both properties and has equal or smaller ratio. Suppose we apply this to an optimal solution for a k-PARTR instance (A,p), with p being perfect111111Such a p always exists, by definition. for the k-PART instance A. Since the ratio of the solution does not increase throughout the constructions described in this proof, any new p obtained by the constructions must also be perfect and the solution obtained must be optimal for (A,p).

Let p be one of the perfect elements guaranteed to exist by Theorem 18 for A and S be a respective optimal solution for (A,p) satisfying properties 1 and 2. The following lemmas indicate that we can prune certain values of p, without missing S. We define x=nq. Intuitively, for (A,p), x is the number of large elements that must be contained in singleton sets in S, according to Theorem 18.

Lemma 19.

If for a k-PARTR instance (A,p) we have x>k1, then pp.

Proof.

Since S1 cannot contain elements j>q, there are k1 sets that can contain such elements. The number of these elements is x. If x>k1, by the pigeonhole principle, every feasible solution contains a set with two or more of these elements. This contradicts property 2 of Theorem 18, therefore pp.

Lemma 20.

If for a k-PARTR instance (A,p) we have x=k1 and p<q, then pp.

Proof.

Because p<q, S1 cannot contain q. Thus, there are at least x+1=k elements that cannot be contained in S1, with k1 of them being greater than q. By the pigeonhole principle, every feasible solution contains a set with two or more elements, one of which is greater than q. This contradicts property 2 of Theorem 18, therefore pp.

4.2 Obtaining an FPTAS for k-PART

We now present the main algorithm for k-PART. Its design is analogous to that of Algorithms 1 and 3, with two important differences:

  1. 1.

    There is no iteration for different amounts of singletons with elements j>q. Instead, we prune some values of p according to Lemmas 19 and 20 and fix x singletons for the rest.

  2. 2.

    In contrast to k-SSRR, we do not necessarily obtain the optimal solution to each rounded k-PARTR instance (Ar,p). Interestingly, we will later prove that the obtained solution is sufficient for the algorithm to be an FPTAS for k-PART.

Algorithm 4 FPTAS_k-PART(A,ε).

Algorithm 4 calls a dynamic programming subroutine for each value of p, in order to find candidate partial solutions for elements jq. This DP subroutine, DP_k-PARTR(Ar,k,p,Q), is a direct extension of Algorithm 2, with the following three differences.

  1. 1.

    The case of an element not being added to any set is skipped.

  2. 2.

    When a conflict occurs in a DP cell Ti[D][V], we do not use sum1 to resolve it. For k-PARTR every element is included in some set, thus conflicts can only occur between tuples with identical sums. Hence, it does not matter which tuple is preferred (as proven in Theorem 12 for conflicts with equal sums) and there is no need to ever consider sum1.

  3. 3.

    The bound for pruning large negative differences is chosen as 2Q/δ, where Q=i=1pai is calculated using the initial values ai instead of the scaled and rounded values air. This is necessary to avoid pruning edge case solutions. We will expand on this in Lemma 22.

The respective pseudocode is included in the full version of this work [24]. We now present the following lemma, whose proof is essentially identical to that of Lemma 11.

Lemma 21 (Feasibility).

Every k-tuple of sets whose (S1,,Sk,Ar) value is considered by Algorithm 4 is a feasible solution for the k-PARTR instance (Ar,p).

Recall that we defined p and S as a perfect p and a respective optimal solution for (A,p) whose existence is guaranteed by Theorem 18.

Lemma 22 (Near-optimality).

When Algorithm 4 iterates to compare the ratio of solutions for the k-PARTR instance (Ar,p), it will consider either S or another solution S=(S1,,Sk) with Σ(Si,Ar)=Σ(Si,Ar), i[k].

Proof.

According to Lemmas 19 and 20, we cannot have x>k1 or x=k1 and p<q for p=p. The singleton sets enforced by Algorithm 4 are exactly the singleton sets contained in S, according to property 2 of Theorem 18.

Recall that a solution in the DP subroutine is pruned if it has some difference dj2Q/δ. By property 1 of Theorem 18, it holds that Σ(Si,A)<2Q, i[kx]. Since Ar contains elements scaled by δ and rounded down, we infer that i[kx]

Σ(Si,Ar)Σ(Si,A)/δ<2Q/δ.

This implies that for S, there will be no dj2Q/δ (at any point in its dynamic programming construction).

As already explained, DP conflicts for k-PARTR occur only between tuples with identical sums. Recall that two conflicting tuples have the same vectors D,V and only use elements up to some element i, so any combination of elements that can be added to sets of one tuple can also be added to the respective sets of the other tuple. This is explained in more detail in the proof of Theorem 12. We infer that it is possible for S to be overwritten by another solution S=(S1,,Sk) with Σ(Si,Ar)=Σ(Si,Ar), i[k].

The DP subroutine constructs every possible combination of disjoint sets S1,,Skx with max(S1)=p and i=1kSi=[q], apart from the ones pruned by the cases mentioned in the previous paragraph. Thus, the lemma follows.

Theorem 23.

Algorithm 4 is an FPTAS for k-PART that runs in time O(n2k/εk1).

Proof.

We rely upon the observation that the proof of Theorem 14 does not necessarily require an optimal solution for the rounded k-SSRR instance Ar; it suffices for the algorithm to consider a k-SSRR solution S with (S,Ar)(Sopt,Ar), where Sopt is an optimal solution for the k-SSR instance A (prior to rounding).

First, consider the case pp. If the conditions of Lemma 19 or 20 are met, this p will be skipped. Otherwise, a k-tuple of sets will be found, which is a feasible solution for the k-PARTR instance (Ar,p), according to Lemma 21.

Second, consider the case p=p. By Lemma 22, Algorithm 4 will consider S or another solution S with (S,Ar)=(S,Ar) as a solution for the instance (Ar,p). Therefore, for the solution Salg found by the algorithm in this iteration, it holds that (Salg,Ar)(S,Ar). With the aforementioned observation, the proof of the following inequality is identical to the proof of Theorem 14.

(Salg,A)(1+ε)(S,A)

Taking into account both cases, the final solution returned by the algorithm is a feasible k-PART solution for A and has ratio smaller than or equal to that of the solution found in the p-th iteration. It follows that Algorithm 4 is a (1+ε)-approximation for k-PART.

We now analyze the complexity of the algorithm. The DP subroutine runs in time O(n(Q/δ)k1), by the same reasoning as in the proof of Lemma 13 for x=0 (which is the worst case). Taking into account the iteration for all possible values of p and using a bound for Q/δ just like we did for k-SSR, we infer that Algorithm 4 runs in O(n2k/εk1).

5 An FPTAS for k-SSR with linear dependence on n

In this section, we provide an alternative FPTAS for k-SSR, using techniques inspired from [8] to reduce the problem to smaller instances. We then use the k-SSR FPTAS of Section 3 to solve them.

We define an alternative restricted version of k-SSR, called k-SSRL, in which the solution is forced to contain the largest element of the input. This definition is based on the SSRL problem defined in [8].

Definition 24 (k-SSRL).

Given a sorted multiset A={a1,,an} of positive integers, find k disjoint subsets S1,,Sk of [n] with ni=1kSi, such that (S1,,Sk,A) is minimized.

Let A={a1,,an} be a sorted multiset of n positive integers. We denote by A[l,r] the subset of A consisting of all items ai, such that lir. We also use the notation sum(A)=aAa.

For a multiset A={a1,,an}, we denote the optimal ratio of the k-SSR instance A as OPT(A) and the optimal ratio of the k-SSRL instance A as OPTL(A). By definition, it holds that 1OPT(A)OPTL(A).

Lemma 25.

Let A={a1,,an} be a sorted multiset of positive integers. It holds that

OPT(A)=minkjnOPTL(A[1,j]).
Proof.

Let t{k,,n} be the maximum element121212If t<k, all feasible solutions for both problems have infinite ratio. contained in some optimal solution S of the k-SSR instance A. By Definition 24, S is a feasible solution for the k-SSRL instance A[1,t]. This implies OPT(A)minkjnOPTL(A[1,j]).

Note that any feasible solution for a k-SSRL instance A[1,j] (for any j{k,,n}) is a feasible solution for the k-SSR instance A. Thus, it also holds that OPT(A)minkjnOPTL(A[1,j]).

Lemma 26 provides the key structural insight of our algorithm. Intuitively, the fact that a k-SSRL solution contains the largest element allows us to consider only the largest O((1/ε)ln(1/ε)) elements for each k-SSRL instance A[1,j], in order to obtain a (1+ε)-approximation of the optimal k-SSR solution.

Lemma 26 (Largest elements).

For any sorted multiset A={a1,,an} of positive integers and any ε(0,1), the following holds:

OPT(A)minkjnOPTL(A[jC+1,j])(1+ε)OPT(A), (2)

where C=(c+1)(k1) and c=1+(1+1ε)ln2(k1)ε2.

Proof.

Since A[jC+1,j] is a subset of A and k-SSRL is (by definition) a restricted version of k-SSR, it follows directly that

OPT(A)OPT(A[jC+1,j])OPTL(A[jC+1,j]).

Note that the above is true for any j[n], therefore it is also true for the minimum. Thus, the first inequality of (2) holds. As for the second inequality of (2), we distinguish between two cases.

Case 1 (Dense case): There exists some v{k,,n} s.t. av(1+ε)avk+1. Since Ck, by setting Si={vk+i} for each i[k], we obtain

minkjnOPTL(A[jC+1,j])OPTL(A[vC+1,v])(1+ε)(1+ε)OPT(A).

Case 2 (Sparse case): For all v{k,,n} it holds that av>(1+ε)avk+1. By repeatedly applying this inequality, it follows that for all v{k,,n} and all i1 such that vi(k1)1,

avi(k1)<(1+ε)iav. (3)

Thus, for all such v,i it holds that

sum(A[v(i+1)(k1)+1,vi(k1)])(k1)avi(k1)<(k1)(1+ε)iav.[by Ineq. (3)] (4)

Consider the set A[1,vc(k1)]. Splitting this set into subsets of size (at most) k1 and using (4) for each of them yields

sum(A[1,vc(k1)])(k1)i=0(1+ε)(c+i)av=(k1)avε(1+ε)c1, (5)

where the last step is calculated as the sum of a geometric series. Note that (5) holds even if vc(k1)<1, since then it would be sum(A[1,vc(k1)])=0. Substituting c into (5) and using (1+ε)1+1/ε>e yields

sum(A[1,vc(k1)])<ε2av.

For any kjn, we choose v=jk+1 to obtain

sum(A[1,jC])<ε2ajk+1. (6)

Intuitively, inequality (6) is a bound for the sum of the jC smallest elements of A. This inequality will be used to obtain a (1+ε)-approximation by removing these elements from an optimal k-SSRL solution.

Let S=(S1,,Sk) be an optimal solution for the k-SSRL instance Aj=A[1,j]. We define

SM=argmaxSiSΣ(Si,Aj)andSm=argminSiSΣ(Si,Aj).

Now consider the k-SSRL instance Aj=A[jC+1,j] (i.e. Aj contains the C largest elements of Aj). For each SiS, we define Si=Si[jC+1,j], i.e. the subset of Si that contains elements i such that aiAj. We also define the respective k-tuple of sets, S=(S1,,Sk), and the following sets,

S=argmaxSiSΣ(Si,Aj)andSμ=argminSiSΣ(Si,Aj).

Observe that, by the above definitions, S is a set with maximum sum among all sets in S and Sμ is a set with minimum sum among all sets in S. By (6), for all i[k] it holds that

Σ(Si,Aj)Σ(Si,Aj)sum(A[1,jC])<ε2ajk+1.

Therefore, we obtain

Σ(Si,Aj)Σ(Si,Aj)Σ(Si,Aj)+(ε/2)ajk+1,i[k]. (7)

We now obtain a bound for the ratio (S,Aj) as follows.

(S,Aj)=Σ(S,Aj)Σ(Sμ,Aj)Σ(S,Aj)Σ(Sμ,Aj)ε2ajk+1[by Ineq. (7)]Σ(SM,Aj)Σ(Sm,Aj)ε2ajk+1. (8)

Recall that ji=1kSi (by Definition 24), which implies that Σ(SM,Aj)aj. Let Ss={S1s,,Sks} be a solution consisting of k singleton sets that contain the k largest elements of Aj, i.e. Sis={ji+1}, i[k]. Since Ss is a feasible solution for k-SSRL with ratio aj/ajk+1, it holds that (S,Aj)=Σ(SM,Aj)/Σ(Sm,Aj)aj/ajk+1. Thus, we have

Σ(Sm,Aj)Σ(SM,Aj)ajk+1ajajk+1.

Combining this with (8), we obtain

(S,Aj)Σ(SM,Aj)Σ(Sm,Aj)(1ε2)=22ε(S,Aj).

Assuming ε(0,1), this becomes (S,Aj)(1+ε)(S,Aj). Note that some set Si contains j, so S is a feasible solution for the k-SSRL instance Aj, therefore

OPTL(Aj)(S,Aj)(1+ε)(S,Aj)=(1+ε)OPTL(Aj).

By the definitions of Aj,Aj, we have the following for all j{k,,n}:

OPTL(A[jC+1,j])(1+ε)OPTL(A[1,j]).

Taking the minimum over all j{k,,n} and using Lemma 25, we have

minkjnOPTL(A[jC+1,j])(1+ε)OPT(A).

Lemma 27 (Reduction).

If there is a (1+ε)-approximation algorithm for k-SSRL running in time TL(n,ε), then there is a (1+ε)-approximation algorithm for k-SSR running in time

O(nTL(9kεlnkε,ε3)).
Proof.

Let A be a multiset of n positive integers a1an. For each j{k,,n}, consider Aj=A[jC+1,j], where

C=(c+1)(k1)andc=1+(1+1ε)ln2(k1)ε2.

Using the given (1+ε)-approximation algorithm for each of the k-SSRL instances Aj, we receive a k-tuple of sets Sj=(S1j,,Skj) for which (Sj,Aj)(1+ε)OPTL(Aj). Thus,

minkjn(Sj,Aj)(1+ε)minkjnOPTL(Aj)(1+ε)2OPT(A). [by Lemma 26]

For all j{k,,n}, the set Aj contains at most C elements, with

C=(k1)(2+(1+1ε)ln2(k1)ε2)<3k+k(1+1ε)ln2kε2<9kεlnkε,

assuming k2 and ε(0,1). As such, we have to run the given algorithm on O(n) k-SSRL instances of size bounded by (9k/ε)ln(k/ε) in order to obtain a (1+ε)2-approximation for OPT(A). For all ε(0,1) it holds that (1+ε)21+3ε. Therefore, by setting the error parameter to ε/3 instead of ε in the approximation algorithm for k-SSRL, we obtain a (1+ε)-approximation for OPT(A) running in time

O(nTL(9kεlnkε,ε3)).

We now present the main theorem of this section, which follows by using the FPTAS of Theorem 15 as the (1+ε)-approximation algorithm for k-SSRL in Lemma 27.

Theorem 28.

There is an FPTAS for k-SSR that runs in O~(n/ε3k1) time, where O~ hides polylog(1/ε) factors.

Proof.

Let A be a k-SSR instance. Suppose we use our k-SSR FPTAS running in time TL(n,ε)=O(n2k/εk1) (see Theorem 15) as a subroutine to solve the k-SSRL instances Aj=A[jC+1,j], kjn. This subroutine serves as a (1+ε)-approximation for k-SSRL, since for the solution Sj=(S1j,,Skj) returned it holds that

(Sj,Aj)(1+ε)OPT(Aj)(1+ε)OPTL(Aj).

Note that this subroutine does not take into account the k-SSRL restriction ji=1kSij, therefore it might return an invalid k-SSRL solution for Aj. However, all solutions returned are feasible for the (unrestricted) k-SSR instance A, therefore the solution which yields minkjn(Sj,Aj) is a feasible one. As such, by Lemma 27 we obtain another FPTAS for k-SSR running in time

O(nTL(9kεlnkε,ε3))=O~(nε3k1).

References

  • [1] Giannis Alonistiotis, Antonis Antonopoulos, Nikolaos Melissinos, Aris Pagourtzis, Stavros Petsalakis, and Manolis Vasilakis. Approximating subset sum ratio via partition computations. Acta Informatica, 61(2):101–113, 2024. doi:10.1007/S00236-023-00451-7.
  • [2] Georgios Amanatidis, Aris Filos-Ratsikas, and Alkmini Sgouritsa. Pushing the frontier on approximate EFX allocations. In Proceedings of the 25th ACM Conference on Economics and Computation, EC ’24, pages 1268–1286, New York, NY, USA, 2024. Association for Computing Machinery. doi:10.1145/3670865.3673582.
  • [3] Antonis Antonopoulos, Aris Pagourtzis, Stavros Petsalakis, and Manolis Vasilakis. Faster algorithms for k-subset sum and variations. J. Comb. Optim., 45(1):24, 2023. doi:10.1007/S10878-022-00928-0.
  • [4] Cristina Bazgan, Miklos Santha, and Zsolt Tuza. Efficient approximation algorithms for the SUBSET-SUMS EQUALITY problem. J. Comput. Syst. Sci., 64(2):160–170, 2002. doi:10.1006/JCSS.2001.1784.
  • [5] Richard E. Bellman. Dynamic programming. Princeton University Press, Princeton, NJ, 1957.
  • [6] Samuel Bismuth, Vladislav Makarov, Erel Segal-Halevi, and Dana Shapira. Partitioning problems with splittings and interval targets. In Julián Mestre and Anthony Wirth, editors, 35th International Symposium on Algorithms and Computation, ISAAC 2024, December 8-11, 2024, Sydney, Australia, volume 322 of LIPIcs, pages 12:1–12:15. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.ISAAC.2024.12.
  • [7] Karl Bringmann. A near-linear pseudopolynomial time algorithm for subset sum. In Philip N. Klein, editor, Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2017, Barcelona, Spain, Hotel Porta Fira, January 16-19, pages 1073–1084. SIAM, 2017. doi:10.1137/1.9781611974782.69.
  • [8] Karl Bringmann. Approximating subset sum ratio faster than subset sum. In Proceedings of the 2024 ACM-SIAM Symposium on Discrete Algorithms, SODA 2024, Alexandria, VA, USA, January 7-10, 2024, pages 1260–1277. SIAM, 2024. doi:10.1137/1.9781611977912.50.
  • [9] Karl Bringmann and Vasileios Nakos. A fine-grained perspective on approximating subset sum and partition. In Dániel Marx, editor, Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms, SODA 2021, Virtual Conference, January 10 - 13, 2021, pages 1797–1815. SIAM, 2021. doi:10.1137/1.9781611976465.108.
  • [10] Eric Budish. The combinatorial assignment problem: approximate competitive equilibrium from equal incomes. In Moshe Dror and Greys Sosic, editors, Proceedings of the Behavioral and Quantitative Game Theory - Conference on Future Directions, BQGT ’10, Newport Beach, California, USA, May 14-16, 2010, page 74:1. ACM, 2010. doi:10.1145/1807406.1807480.
  • [11] Lin Chen, Jiayi Lian, Yuchen Mao, and Guochuan Zhang. Approximating partition in near-linear time. In Proceedings of the 56th Annual ACM Symposium on Theory of Computing, STOC 2024, pages 307–318, New York, NY, USA, 2024. Association for Computing Machinery. doi:10.1145/3618260.3649727.
  • [12] Lin Chen, Jiayi Lian, Yuchen Mao, and Guochuan Zhang. An improved pseudopolynomial time algorithm for subset sum. In 65th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2024, Chicago, IL, USA, October 27-30, 2024, pages 2202–2216. IEEE, 2024. doi:10.1109/FOCS61266.2024.00129.
  • [13] Lin Chen, Jiayi Lian, Yuchen Mao, and Guochuan Zhang. A note on deterministic FPTAS for partition, 2025. doi:10.48550/arXiv.2501.12848.
  • [14] Mark Cieliebak and Stephan J. Eidenbenz. Measurement errors make the partial digest problem NP-hard. In Martin Farach-Colton, editor, LATIN 2004: Theoretical Informatics, 6th Latin American Symposium, Buenos Aires, Argentina, April 5-8, 2004, Proceedings, volume 2976 of Lecture Notes in Computer Science, pages 379–390. Springer, 2004. doi:10.1007/978-3-540-24698-5_42.
  • [15] Mark Cieliebak, Stephan J. Eidenbenz, and Paolo Penna. Noisy data make the partial digest problem NP-hard. In Gary Benson and Roderic D. M. Page, editors, Algorithms in Bioinformatics, Third International Workshop, WABI 2003, Budapest, Hungary, September 15-20, 2003, Proceedings, volume 2812 of Lecture Notes in Computer Science, pages 111–123. Springer, 2003. doi:10.1007/978-3-540-39763-2_9.
  • [16] Ed Coffman and Michael Langston. A performance guarantee for the greedy set-partitioning algorithm. Acta Informatica, 21:409–415, November 1984. doi:10.1007/BF00264618.
  • [17] Bryan Deuermeyer, Donald Friesen, and Michael Langston. Scheduling to maximize the minimum processor finish time in a multiprocessor system. SIAM Journal on Algebraic and Discrete Methods, 3, June 1982. doi:10.1137/0603019.
  • [18] Paul Duetting, Michal Feldman, and Yarden Rashti. Succinct ambiguous contracts, 2025. doi:10.48550/arXiv.2503.02592.
  • [19] M. R. Garey and David S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman, 1979.
  • [20] George Gens and Eugene Levner. A fast approximation algorithm for the subset-sum problem. INFOR: Information Systems and Operational Research, 32(3):143–148, 1994. doi:10.1080/03155986.1994.11732245.
  • [21] Theodore P. Hill. Partitioning General Probability Measures. The Annals of Probability, 15(2):804–813, 1987. doi:10.1214/aop/1176992173.
  • [22] Dorit S. Hochbaum and David B. Shmoys. Using dual approximation algorithms for scheduling problems theoretical and practical results. J. ACM, 34(1):144–162, January 1987. doi:10.1145/7531.7535.
  • [23] Ce Jin and Hongxun Wu. A simple near-linear pseudopolynomial time randomized algorithm for subset sum. In Jeremy T. Fineman and Michael Mitzenmacher, editors, 2nd Symposium on Simplicity in Algorithms, SOSA 2019, January 8-9, 2019, San Diego, CA, USA, volume 69 of OASIcs, pages 17:1–17:6. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2019. doi:10.4230/OASICS.SOSA.2019.17.
  • [24] Sotiris Kanellopoulos, Giorgos Mitropoulos, Antonis Antonopoulos, Nikos Leonardos, Aris Pagourtzis, Christos Pergaminelis, Stavros Petsalakis, and Kanellos Tsitouras. Approximation schemes for k-subset sum ratio and k-way number partitioning ratio, 2025. doi:10.48550/arXiv.2503.18241.
  • [25] Hans Kellerer, Renata Mansini, Ulrich Pferschy, and Maria Grazia Speranza. An efficient fully polynomial approximation scheme for the subset-sum problem. J. Comput. Syst. Sci., 66(2):349–370, 2003. doi:10.1016/S0022-0000(03)00006-0.
  • [26] Konstantinos Koiliaris and Chao Xu. Faster pseudopolynomial time algorithms for subset sum. ACM Trans. Algorithms, 15(3):40:1–40:20, 2019. doi:10.1145/3329863.
  • [27] Richard E. Korf. Objective functions for multi-way number partitioning. In Ariel Felner and Nathan R. Sturtevant, editors, Proceedings of the Third Annual Symposium on Combinatorial Search, SOCS 2010, Stone Mountain, Atlanta, Georgia, USA, July 8-10, 2010, pages 71–72. AAAI Press, 2010. doi:10.1609/SOCS.V1I1.18172.
  • [28] David Kurokawa, Ariel D. Procaccia, and Junxing Wang. Fair enough: Guaranteeing approximate maximin shares. J. ACM, 65(2):8:1–8:27, 2018. doi:10.1145/3140756.
  • [29] Joseph Y-T. Leung. Bin packing with restricted piece sizes. Information Processing Letters, 31(3):145–149, 1989. doi:10.1016/0020-0190(89)90223-8.
  • [30] Richard J. Lipton, Evangelos Markakis, Elchanan Mossel, and Amin Saberi. On approximately fair allocations of indivisible goods. In Jack S. Breese, Joan Feigenbaum, and Margo I. Seltzer, editors, Proceedings 5th ACM Conference on Electronic Commerce (EC-2004), New York, NY, USA, May 17-20, 2004, pages 125–131. ACM, 2004. doi:10.1145/988772.988792.
  • [31] Nikolaos Melissinos and Aris Pagourtzis. A faster FPTAS for the subset-sums ratio problem. In Lusheng Wang and Daming Zhu, editors, Computing and Combinatorics - 24th International Conference, COCOON 2018, Qing Dao, China, July 2-4, 2018, Proceedings, volume 10976 of Lecture Notes in Computer Science, pages 602–614. Springer, 2018. doi:10.1007/978-3-319-94776-1_50.
  • [32] Stephan Mertens. The easiest hard problem: Number partitioning. In Allon G. Percus, Gabriel Istrate, and Cristopher Moore, editors, Computational Complexity and Statistical Physics, Santa Fe Institute Studies in the Sciences of Complexity, pages 125–140. Oxford University Press, 2006.
  • [33] Marcin Mucha, Jesper Nederlof, Jakub Pawlewicz, and Karol Wegrzycki. Equal-subset-sum faster than the meet-in-the-middle. In Michael A. Bender, Ola Svensson, and Grzegorz Herman, editors, 27th Annual European Symposium on Algorithms, ESA 2019, September 9-11, 2019, Munich/Garching, Germany, volume 144 of LIPIcs, pages 73:1–73:16. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2019. doi:10.4230/LIPICS.ESA.2019.73.
  • [34] Marcin Mucha, Karol Wegrzycki, and Michal Wlodarczyk. A subquadratic approximation scheme for partition. In Timothy M. Chan, editor, Proceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2019, San Diego, California, USA, January 6-9, 2019, pages 70–88. SIAM, 2019. doi:10.1137/1.9781611975482.5.
  • [35] Danupon Nanongkai. Simple FPTAS for the subset-sums ratio problem. Inf. Process. Lett., 113(19-21):750–753, 2013. doi:10.1016/J.IPL.2013.07.009.
  • [36] Trung Thanh Nguyen and Jörg Rothe. Minimizing envy and maximizing average nash social welfare in the allocation of indivisible goods. Discret. Appl. Math., 179:54–68, 2014. doi:10.1016/J.DAM.2014.09.010.
  • [37] Christos H. Papadimitriou. On the complexity of the parity argument and other inefficient proofs of existence. J. Comput. Syst. Sci., 48(3):498–532, 1994. doi:10.1016/S0022-0000(05)80063-7.
  • [38] Diego Recalde, Daniel Severín, Ramiro Torres, and Polo Vaca. An exact approach for the balanced k-way partitioning problem with weight constraints and its application to sports team realignment. J. Comb. Optim., 36(3):916–936, 2018. doi:10.1007/S10878-018-0254-1.
  • [39] Sartaj Sahni. Algorithms for scheduling independent tasks. J. ACM, 23(1):116–127, 1976. doi:10.1145/321921.321934.
  • [40] Ethan L. Schreiber, Richard E. Korf, and Michael D. Moffitt. Optimal multi-way number partitioning. J. ACM, 65(4):24:1–24:61, 2018. doi:10.1145/3184400.
  • [41] Max Springer, Mohammad Taghi Hajiaghayi, and Hadi Yami. Almost envy-free allocations of indivisible goods or chores with entitlements. In Proceedings of the Thirty-Eighth AAAI Conference on Artificial Intelligence and Thirty-Sixth Conference on Innovative Applications of Artificial Intelligence and Fourteenth Symposium on Educational Advances in Artificial Intelligence, AAAI’24/IAAI’24/EAAI’24. AAAI Press, 2024. doi:10.1609/aaai.v38i9.28851.
  • [42] Gerhard J. Woeginger. When does a dynamic programming formulation guarantee the existence of a fully polynomial time approximation scheme (FPTAS)? INFORMS J. Comput., 12(1):57–74, 2000. doi:10.1287/IJOC.12.1.57.11901.
  • [43] Gerhard J. Woeginger and Zhongliang Yu. On the equal-subset-sum problem. Inf. Process. Lett., 42(6):299–302, 1992. doi:10.1016/0020-0190(92)90226-L.
  • [44] Yair Zadok, Nadav Voloch, Noa Voloch-Bloch, and Maor Meir Hajaj. Multiple subset problem as an encryption scheme for communication. CoRR, abs/2401.09221, 2024. doi:10.48550/arXiv.2401.09221.
  • [45] Houyu Zhou, Tianze Wei, Biaoshuai Tao, and Minming Li. Fair allocation of items in multiple regions. In Proceedings of the Thirty-Eighth AAAI Conference on Artificial Intelligence and Thirty-Sixth Conference on Innovative Applications of Artificial Intelligence and Fourteenth Symposium on Educational Advances in Artificial Intelligence, AAAI’24/IAAI’24/EAAI’24. AAAI Press, 2024. doi:10.1609/aaai.v38i9.28861.