arXiv:2609.06470cs.DSSep 2026

Manuscript Offprint

arXiv:2609.06470

A Group-Based Resource Allocation Model for the Fractional Knapsack Problem

Abhinaba Chakraborty

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

To solve the fractional knapsack problem, Dantzig's greedy rule orders items according to their value-to-cost ratio. This ordering introduces priority issues. An arbitrarily small perturbation to the input can change the allocation if the budget is exhausted between two items with very similar ratios. To mitigate that problem, we introduce a two-stage rule. We group items sharing attributes within a radius δ\delta. These groups are then evaluated in descending order of ratio, and divide their group's budget share without further ranking. Consider a group featuring an aggregate capacity UGU_G, unit costs contained in [w−,w+][w^-, w^+], and a representative value w^\widehat{w}. The group's loss compared to the exact optimum is bounded by w^UGw+−w−w++w−+εvUG\widehat{w}U_G \frac{w^+-w^-}{w^++w^-} + \varepsilon_v U_G, in which εv\varepsilon_v limits the group's internal value variation. Moreover, for any group size, this harmonic factor remains tight. The overall loss becomes restricted to the single budget-binding group whenever the grouping remains order-compatible; thus, groups containing at most KK items suffer a per-item loss of O(K/n)\mathcal{O}(K/n). Should group ratio intervals exhibit an overlap of at most ω\omega, an additive term ωC\omega C degrades this bound. Within the separation margin between adjacent groups, the grouped allocation remains Lipschitz continuous with respect to cost data, exhibiting a modulus of Kwmin⁡\frac{K}{w_{\min}}. Computing this allocation takes O(n+mlog⁡m+∣Γ∣log⁡∣Γ∣)\mathcal{O}(n + m \log m + |\Gamma| \log |\Gamma|) time given mm groups and a boundary group Γ\Gamma. Alternatively, the time complexity drops to O(n+mlog⁡m)\mathcal{O}(n + m \log m) if a linear-time selection method identifies the boundary group's allocation.

I. MOTIVATION: DISCONTINUITY AND SPURIOUS RANKING

A set of nn items defines an instance I=(v,w,u,C)I = (v, w, u, C), where items are indexed by [n]:={0,…,n−1}[n] := \{0, \ldots, n-1\}. Every item has a value vi>0v_i > 0, a cost wi>0w_i > 0, and a capacity limit ui∈[0,1]u_i \in [0,1]. A total budget C≥0C \geq 0 is also provided. Given a subset S⊆[n]S \subseteq [n], we denote its total capacity as US:=∑i∈SuiU_S := \sum_{i \in S} u_i, whereas FSw:=∑i∈SwiuiF_S^w := \sum_{i \in S} w_i u_i. We refer to ρi:=viwi\rho_i := \frac{v_i}{w_i} as the efficiency ratio for item ii. Thus, the bounded fractional knapsack problem can be stated as follows:

V⋆(I):=max⁡z∈Z(I)∑i∈[n]vizi,Z(I):={z∈∏i∈[n][0,ui]:∑i∈[n]wizi≤C}.(1)V^{\star}(I):=\max_{z \in \mathcal{Z}(I)} \sum_{i \in [n]} v_i z_i, \qquad \mathcal{Z}(I):=\Big\{z \in \prod_{i \in [n]} [0,u_i]: \sum_{i \in [n]} w_i z_i \leq C\Big\}. \tag{1}

Throughout this article, we assume that C<F[n]wC < F_{[n]}^w; hence, it is impossible for the budget to saturate all items simultaneously. We will use the notation V∗(C)V^*(C) in contexts where (v,w,u)(v,w,u) remain fixed while the budget varies.

Lemma 1 (Optimality conditions). A given feasible allocation z∗∈Z(I)z^* \in \mathcal{Z}(I) becomes an optimal solution to (1) if and only if ∃ν∗≥0\exists \nu^* \geq 0 satisfying ν∗(C−∑iwizi∗)=0\nu^*(C - \sum_i w_i z_i^*) = 0 such that the following condition holds:

zi⋆={ui,ρi>ν⋆,0,ρi<ν⋆,∈[0,ui],ρi=ν⋆(2)z_i^\star=\begin{cases}u_i,&\rho_i>\nu^\star,\\0,&\rho_i<\nu^\star,\\\in[0,u_i],&\rho_i=\nu^\star\end{cases} \tag{2}

Furthermore, on the interval [0,F[n]w][0,F_{[n]}^w], V∗(C)V^*(C) behaves as a strictly increasing, piecewise linear, and concave function, satisfying V∗(C′)≤V∗(C)+ν∗(C′−C)V^*(C') \leq V^*(C) + \nu^*(C' - C) for any C′∈[0,F[n]w]C' \in [0,F_{[n]}^w] thus, V∗(C)≥ν∗CV^*(C) \geq \nu^* C.

Proof. Let us fix some ν≥0\nu \geq 0 along with a z∗∈Z(I)z^* \in \mathcal{Z}(I) that satisfies both (2) for ν∗=ν\nu^* = \nu and the complementary slackness condition ν(C−∑iwizi⋆)=0\nu(C - \sum_i w_i z_i^\star) = 0. Because wi>0w_i > 0, the expression vi−νwiv_i - \nu w_i necessarily shares the same sign as ρi−ν\rho_i - \nu. Consequently, condition (2) simply dictates that zi⋆z_i^\star must maximise the product (vi−νwi)zi(v_i - \nu w_i)z_i within the interval [0,ui][0, u_i]. Therefore, taking any arbitrary zz subject to 0≤zi≤ui0 \leq z_i \leq u_i and ∑iwizi≤C′\sum_i w_i z_i \leq C', we obtain

∑ivizi≤νC′+∑i(vi−νwi)zi≤νC′+∑i(vi−νwi)zi⋆=∑ivizi⋆+ν(C′−C),(3)\sum_{i} v_{i} z_{i} \leq \nu C' + \sum_{i} (v_{i} - \nu w_{i}) z_{i} \leq \nu C' + \sum_{i} (v_{i} - \nu w_{i}) z_{i}^\star = \sum_{i} v_{i} z_{i}^\star + \nu (C' - C), \tag{3}

Notice that the final equality follows from the assumption that ν(C−∑iwizi⋆)=0\nu(C - \sum_i w_i z_i^\star) = 0. Setting C′=CC' = C immediately demonstrates the optimality of z⋆z^\star. Following this, the relation V∗(C′)≤V∗(C)+ν(C′−C)V^*(C') \leq V^*(C) + \nu(C' - C) naturally emerges as the required supergradient inequality.

To prove the converse, we begin by explicitly constructing an allocation adhering to this structure. First, sort and relabel the items ensuring that ρ0≥⋯≥ρn−1\rho_0 \geq \cdots \geq \rho_{n-1}. Next, identify pp as the smallest index satisfying ∑i≤pwiui>C\sum_{i \leq p} w_i u_i > C; such an index is guaranteed to exist due to the condition C<F[n]wC < F_{[n]}^w. We then define zig=uiz_i^g = u_i for all i<pi < p, assign zpg=(C−∑i<pwiui)/wp∈[0,up)z_p^g = (C - \sum_{i < p} w_i u_i)/w_p \in [0, u_p), and enforce zig=0z_i^g = 0 for any i>pi > p. This specific allocation zgz^g fully consumes the budget CC while simultaneously satisfying (2) by setting ν⋆=ρp>0\nu^\star = \rho_p > 0, thereby confirming its optimality. Now, consider an arbitrary optimal solution zz. We can invoke (3) using

z⋆=zg,C′=Cz^{\star}=z^{g}, C^{\prime}=C, and ν=ρp\nu=\rho_{p}. Because the expressions at both ends evaluate to V⋆(C)V^{\star}(C), the intermediate inequalities must actually be exact equalities. The first equality implies ρp(C−∑iwizi)=0\rho_{p}(C-\sum_{i}w_{i}z_{i})=0, demonstrating that z must exhaust the entire budget. The second equality applies on a term-by-term basis, meaning (vi−ρpwi)zi=(vi−ρpwi)zig(v_{i}-\rho_{p}w_{i})z_{i}=(v_{i}-\rho_{p}w_{i})z_{i}^{g}. This equation strictly requires zi=uiz_{i}=u_{i} whenever ρi>ρp\rho_{i}>\rho_{p}, and similarly zi=0z_{i}=0 whenever ρi<ρp\rho_{i}<\rho_{p}. Consequently, we obtain exactly condition (2) with ν⋆=ρp\nu^{\star}=\rho_{p}. Lastly, setting ν⋆=0\nu^{\star}=0 would be contradictory in (2). Given that all ρi>0\rho_{i}>0, such a setting would necessitate z⋆=uz^{\star}=u, producing an infeasible allocation.

Our procedure for building zgz^g likewise characterises the function V⋆V^\star. Specifically, whenever CC falls within the interval [∑i<pwiui,∑i≤pwiui][\sum_{i<p} w_i u_i, \sum_{i\leq p} w_i u_i], the corresponding optimal value evaluates to ∑i<pviui+ρp(C−∑i<pwiui)\sum_{i<p} v_i u_i + \rho_p (C - \sum_{i<p} w_i u_i). This expression is affine, possessing a strictly positive slope of ρp>0\rho_p > 0. Furthermore, the sequence of slopes ρ0≥ρ1≥⋯\rho_0 \geq \rho_1 \geq \cdots is non-increasing. These properties collectively ensure that V⋆V^\star remains concave, strictly increasing, and piecewise linear. Applying the supergradient inequality at C′=0C' = 0, combined with the fact that V⋆(0)=0V^\star(0) = 0, yields the lower bound V⋆(C)≥ν⋆CV^\star(C) \geq \nu^\star C. □\square

The specific allocation zgz^g detailed during the proof corresponds to the well-known Dantzig greedy strategy [1]. This approach involves funding the items in descending order of their efficiency ratios ρi\rho_i until the budget is exhausted. In terms of computational complexity, the procedure requires O(nlog⁡n)\mathcal{O}(n \log n) operations if direct sorting is utilised. Alternatively, one can achieve O(n)\mathcal{O}(n) execution time by relying on weighted median selection techniques [2], [3], [4], [5]. Assuming all efficiency ratios are distinct from one another, a maximum of a single item will be assigned a fractional quantity, whereas all remaining coordinates must be set to either 0 or uiu_i. Consequently, the resulting solution always corresponds to a vertex of the feasible set Z(I)\mathcal{Z}(I). This vertex is dictated purely by the relative ordering of the ratios, not their precise numerical values, which ultimately introduces inherent instability into the problem.

Proposition 2 (No Lipschitz modulus). Assume we are given parameters w~,ε>0\tilde{w}, \varepsilon > 0, values v=(1,1)v = (1,1), capacities u=(1,1)u = (1,1), and a budget limit C=w~C = \tilde{w}. We analyze two distinct cost vectors: w=(w~,w~+ε)w = (\tilde{w}, \tilde{w} + \varepsilon) alongside w′=(w~+ε,w~)w' = (\tilde{w} + \varepsilon, \tilde{w}). Under these conditions, the uniquely optimal allocation vectors evaluate to z⋆(w)=(1,0)z^\star(w) = (1,0) and z⋆(w′)=(0,1)z^\star(w') = (0,1), which implies

∥z⋆(w)−z⋆(w′)∥1∥w−w′∥∞  =  2ε  →ε↓0  ∞.(4)\frac{\|z^{\star}(w)-z^{\star}(w^{\prime})\|_{1}}{\|w-w^{\prime}\|_{\infty}}\;=\;\frac{2}{\varepsilon}\;\xrightarrow[\varepsilon\downarrow0]{}\;\infty. \tag{4}

Because every norm defined over R2\mathbb{R}^2 is topologically equivalent, it follows that the mapping to the optimal solution cannot exhibit a finite Lipschitz constant under any combination of norms.

Proof. Suppose that the pair (t,s)(t,s) represents a feasible assignment under the cost vector ww. The underlying budget restriction, given by w~t+(w~+ε)s≤w~\tilde{w}t+(\tilde{w}+\varepsilon)s\leq\tilde{w}, forces the upper bound s≤w~(1−t)/(w~+ε)s\leq\tilde{w}(1-t)/(\tilde{w}+\varepsilon). This naturally leads to the inequality

t+s ≤ w~+εtw~+ε ≤ 1,t+s~\leq~\frac{\tilde{w}+\varepsilon t}{\tilde{w}+\varepsilon}~\leq~1,

where the sequence of inequalities achieves equality if and only if we have t=1t=1 accompanied by s=0s=0. As a result, the vector (1,0)(1,0) represents the sole optimal choice for the cost configuration ww. By applying symmetric reasoning, we conclude that (0,1)(0,1) must be the strictly unique optimum when confronting w′w^{\prime}.

This abrupt transition in the solution space is resilient against minor regularisation techniques or arbitrary tie-breaking rules. The optimal configuration immediately shifts between extreme vertices of Z(I)\mathcal{Z}(I) the instant the relative ordering between ρ0\rho_0 and ρ1\rho_1 reverses, regardless of how minute that reversal might be. To ensure that our chosen allocation reflects genuine variation in the dataset rather than being distorted by measurement noise, our strategy must strictly avoid ranking items whose ratio disparity falls below the underlying data resolution. Consequently, Section II operationalises this concept by bundling items together whenever their attribute distance lies within a margin δ\delta, allowing for internal group allocations that bypass strict ranking. Subsequently, Section III provides a formal quantification of both the efficiency sacrifice and the corresponding improvements in systemic stability.

References (48)