Next Article in Journal
CNL-Diff: A Nonlinear Data Transformation Framework for Epidemic Scale Prediction Based on Diffusion Models
Previous Article in Journal
The Predictive Power of Managerial Confidence: A Dynamic Mechanism of Attention and Reliability in China’s Stock Market
error_outline You can access the new MDPI.com website here. Explore and share your feedback with us.
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

The Weighted k-Search Problem

Faculty of Business Administration and Economics, Rotenbühl Campus, University of Applied Sciences for Technology and Business Saarland, Goebenstraße 40, 66117 Saarbrücken, Germany
*
Author to whom correspondence should be addressed.
Mathematics 2026, 14(2), 206; https://doi.org/10.3390/math14020206
Submission received: 7 December 2025 / Revised: 1 January 2026 / Accepted: 3 January 2026 / Published: 6 January 2026

Abstract

In the uni-directional conversion problem, the objective is to convert wealth from one asset into another while maximizing its value at the end of the investment horizon. In the k-preemptive variant of this problem, also known as the k-search problem, the wealth is divided into k equally-sized units that cannot be converted simultaneously. In this work the weighted k-search problem is introduced. The weighted k-search problem is a generalization of the k-search problem, since the problem setting is changed in a way in which the given number of units to convert is not limited to one. In the weighted k-search problem, the k units are grouped into l groups of variable size. Instead of one unit, each group has to be converted at once, and each group has to be converted separately. The online algorithm lRPP is presented and its competitive ratio is determined. It is shown that no deterministic algorithm can achieve a lower competitive ratio. Thus, lRPP solves the weighted k-search problem optimally. Both variants of the weighted k-search problem, i.e., min-search and max-search, are solved separately.

1. Introduction

In the conversion problem (CP), a given wealth has to be converted from one asset into another asset, e.g., from one currency into an other currency. At the start, the wealth is invested in one asset. The objective is to maximize the wealth W T at a given time T, with the distribution of wealth being adjustable at certain points in time t = 1 , , T . Conversion is only possible at the price q t applicable at time t. At T, all wealth must be converted into the other asset. Let q = q 1 , , q T be a price sequence and let s = s 1 , , s T be the sequence of the conversions, where s t is the number of units that are converted at time t. Essentially, the CP aims to determine the optimal conversion sequence s based on the price sequence q . One specific CP called k-search problem, introduced by [1], considers an initial wealth divided in k equally sized units, where each unit can only be converted at once. In this work a generalization of the k-search problem called weighted k-search is presented. Here, the k equally sized units are grouped, and instead of units, groups which can obtain different sizes can be converted at once.

1.1. Competitive Analysis

Optimization problems in which a decision based on partial information has to be made are so-called online problems (see [2]). Due to the fact that in the CP, the price sequence q is not known beforehand, but at each time t = 1 , , T , the next price q t is disclosed which necessitates a decision with partial information, the CP can be categorized as an online problem.
Algorithms designed to address online problems are known as online algorithms. A widely-used approach for assessing the performance of online algorithms is competitive analysis, first introduced by [3]. Competitive analysis involves comparing a specific online algorithm (ON) with an optimal offline algorithm (OPT). The offline algorithm, OPT, has complete knowledge of the entire price sequence and can make optimal decisions. Let O P T ( q ) denote the solution produced by OPT for the sequence q , and O N ( q ) represent the solution of the online algorithm. Additionally, let Ω represent the set of all feasible input sequences. The goal in competitive analysis is to determine the value c for which
c max q Ω O P T ( q ) O N ( q )
holds for a max search problem or
c max q Ω O N ( q ) O P T ( q )
holds for a minimization problem. The value c is then referred to as the competitive ratio. An algorithm with a lower c is considered better. An online algorithm that attains the smallest possible value of c is said to be optimal.

1.2. Related Work

The CP has many different variants, which can be categorized by the nature of search, the nature of conversion and given information (see [4]). The nature of the search determines in which ways conversion is possible. In the uni-directional CP it is allowed to convert from one asset into another asset but converting backwards is forbidden. In contrast, in bi-directional conversion it is allowed to convert backwards. The nature of conversion describes the percentage of wealth that can be converted at once. In a non-preemptive conversion it is necessary to convert the whole wealth. In a preemptive conversion it is possible to convert only a part of the wealth. Given information bounds the input sequence. In the conversion literature the constant price interval and interrelated are the most common given information. In case of a constant price interval, each price q t lies between the upper bound M and lower bound m, i.e., q t [ m , M ] . For this type of information the uni-directional variants of the CP are solved by [5,6,7,8]. Ref. [6] presents the algorithm RPP to solve the uni-directional non-preemptive conversion problem by using the reservation price:
q R P P * = ( M · m ) 1 2 .
RPP has a competitive ratio of the following:
c R P P = M m 1 2 .
Ref. [9] provides an upper bound for the bi-directional preemptive conversion problem, which was improved by [10]. Ref. [11] solves the bi-directional non-preemptive conversion problem with bounded number of transactions for given M and m.
Interrelated prices restrict the maximal price change between two points in time. θ 1 , θ 2 restrict the factors at which a price can maximally decrease respectively increase. Refs. [12,13,14,15] consider the conversion problem with interrelated prices as given information.
Given information can also restrict the length of the input sequence. The most common restrictions are, the knowledge of the number of points in time at which conversion can be carried out (see e.g., [10,16,17]). Refs. [8,18] restrict the number of runs, where a run is defined as a subsequence of the price sequence in which the offered prices decrease or increase monotonically.
Some authors consider additionally constraints about the nature of conversion. Ref. [1] presents the uni-directional k-preemptive CP. In this, the wealth is divided into k equal valued units. It is forbidden to convert more than one unit at time t. This CP is also called k-search problem. They provide the reservation price algorithm kRPP, where for each unit i with i = 1 , , k , a reservation price q i , k R P P * is defined. The online player only converts this unit, if the price q t is equal or better than the reservation price and there is no other unit remaining with a worse reservation price. For kRPP the reservation prices are calculated with the following equation:
q i , k R P P * = M 1 1 1 c · 1 + 1 k · c i 1 .
Ref. [17] provides the algorithm kRPP’ for a variant of the k-search problem, where the number of units to convert at once is up to k. This problem is called the general k-search problem. The algorithm is based on kRPP and differs only in the calculation of the k reservation prices q i , k R P P * . Note that while the weighted k-search problem introduced in this work generalizes the problem by allowing groups of different sizes, the general k-search problem generalizes it by allowing multiple equal-sized groups to be converted simultaneously. These two distinct generalizations are independent of one another and can be applied in combination.
While these generalizations make the original constraints less restrictive, there are also several works in the literature that study the k-search problem under modified or additional constraints, or from alternative perspectives. Ref. [19] introduces the ( j , k ) -search problem as a relaxation of the k-search problem, in which it is only necessary to convert j units instead of k units with j k . Thus, the player is not required to convert all units. This problem is solved for the k-search problem as well as the generalized k-search problem. Ref. [20] considers a problem in which, in the first k periods, a unit is added to the wealth. The number of units which can be converted is equal to the number of available units. Ref. [21] also studies a variant of the k-search problem whereby units are added periodically and prices are interrelated. Ref. [22] adapts the k-search problem to a setting, in which k applicants for k jobs have to be chosen. In the problem it is assumed that there are two interview rounds, and after the first round, some applicants are sorted out. Ref. [23] considers a variant of the k-search problem where a switching cost is incurred whenever the convert decision changes between consecutive time steps. Ref. [24] considers a risk aware online algorithm for the k-search problem. Ref. [25] considers the k-search problem in the context of advice complexity. Ref. [26] designed a learning-augmented algorithms for the k-search problem. They showed that this algorithm achieves a Pareto-optimal trade-off between consistency and robustness.
Refs. [6,27] show that the CP is a special case of the portfolio selection problem (PSP). In this, the wealth can be distributed arbitrarily on n 2 assets. For n = 2 , the PSP is the bi-directional preemptive CP.

2. Problem Formulation

In the weighted k-search problem, a player converts k units of wealth, divided into l groups from one asset into another. Let W = w 1 , w 2 , , w l with i = 1 l w i = k and w i 1 denotes the sequence of grouped units, with l k elements, where w i represents the number of units in group i. Note, that in the k-search problem, the sequence is W = 1 , 1 , , 1 with l = k elements. The player must follow these rules:
  • The player has to convert the groups in consecutive order.
  • Converting more than one group at the same time is not allowed.
  • Each group has to be converted at once.
  • All groups have to be converted until the end of the investment horizon at time T.
At each time t = 1 , , T a price q t is given, where converting one wealth unit of the initial asset yields q t wealth units of the target asset. The objective is to maximize the wealth in the target asset at the end of the investment horizon, which occurs at time T. Since the groups must be converted sequentially, earlier conversions determine the group i and the number of units w i that can be converted at time t. Let i t represent the group that can be converted at time t, and thus the number of units that can be converted at time t is denoted by w i t with i t = 1 + τ = 1 t 1 s τ max j = 1 , , l { w j } . For simplification w l + 1 = 0 is defined. According to the Rules 1, 2, and 3, it follows that s t 0 , w i t . Following Rule 4, all wealth must be invested in the target asset by time T, i.e., t = 1 T s t = l = 1 j w l . The terminal wealth W T is given by W T = t = 1 T s t · q t . The problem description is presented as a mathematical program below. It is based on the mathematical program given in [10].
Given : q , T , W , l Search : s = s 1 , , s T Maximize / minimize W T = t = 1 T s t · q t subject to ( I ) s t 0 , w i t , t = 1 , , T with i t = 1 + τ = 1 t 1 s τ m a x l = j , , l { w j } ( II ) t = 1 T s t = j = 1 l w j
A max-search naturally corresponds to selling an asset, whereas a min-search is the conventional objective when purchasing an asset.
Note that the k-search problem results from the mathematical program described above when it holds w j = 1 for all j = 1 , , l . Therefore, the weighted k-search problem is a generalization of the k-search problem.
In the analysis in this paper, ON possesses the information that the price will lie within a defined range, specifically q t [ m , M ] for all t = 1 , , T , where m indicates the lowest possible price and M the highest. Moreover, the value of T is unknown to ON. Nevertheless, if at any time t, the number of unconverted groups is equal to the number of remaining prices, ON is informed of T and has to convert at each remaining price.
To improve readability, a summary of the notation is provided in Table 1.
Note that even when w i and k are discrete values, any possible wealth distribution among the groups can be represented using appropriately chosen parameters, whereas the k-search problem is restricted to the uniform case k = l .

3. Online Algorithm lRPP

This paper presents an online algorithm, lRPP, that solves the weighted k-search problem. First, a competitive ratio c is determined. Then, a reservation price q i * is calculated for each group i such that all worst-case sequences result in the calculated c. lRPP then waits for a price q t which is equal to or better than the reservation price q i * of the current group i and repeats this process for all groups. The algorithm is presented as follows:
  • Step 1: Calculate c with the following:
    c = M k · m · i = 1 l w i · 1 1 1 c · j = 2 i 1 + w j 1 k · c for min - search M · k m · i = 1 l w i · 1 + c 1 · j = 2 i 1 + w j 1 · c k for max - search .
  • Step 2: Calculate the l reservation prices q i * with the following:
    q i * = M · 1 1 1 c · j = 2 i 1 + w j 1 k · c for min - search m · 1 + c 1 · j = 2 i 1 + w j 1 · c k for max - search .
  • Step 3: Repeat from t = 1 , , T : convert s t with the following:
    s t = w h t , if q t q h t * T t = l h t 0 , else for min - search w h t , if q t q h t * T t = l h t 0 , else for max - search .
    with
    h t = τ = 1 t 1 s τ max i = 1 , , l { w i } + 1 .
    Note that h t defines which group can be traded at time t, since the group must be converted following the given sequence.
Note that there is no closed formula for c; instead, c can be determined using any suitable approximation method. Furthermore, there exists exactly one c 1 that satisfies the equation. This uniqueness follows from the monotonicity of Equation (6). Since M > m > 0 , k w i > 0 i and c 1 , it is evident in both cases of Equation (6) that increasing c decreases the value of the function and that the function is continuous. From Equations (1) and (2), it follows directly that the value of the function must be greater than or equal to 1. This means that ON can never achieve a solution better than the optimal solution.
The algorithm is demonstrated through an example. Consider a min-search scenario, in which a player has to convert k = 5 equally sized units of wealth divided into l = 2 groups, it holds w 1 = 3 and w 2 = 2 units. According to the rules, the player must execute exactly two conversions. The investment horizon for converting both groups concludes at T = 4 . Also the price range with M = 15 and m = 2 is known.
In step 1, lRPP calculates c 2.5319769 . This is used in step 2 to determine the two reservation prices q 1 * = 5.9242247 and q 2 * = 3.7735472 . The price sequence is q = 6 , 3 , 4 , 3 . In step 3, the prices are revealed sequentially, each requiring a conversion decision. Since it holds q 1 > q 1 * , lRPP does not convert at t = 1 . At t = 2 lRPP converts the group with w 1 = 3 units, because q 2 < q 1 * . lRPP is not allowed to convert the other group at the same time, although it holds q 2 < q 2 * . At t = 3 lRPP does not convert, because q 3 > q 2 * . lRPP has to accept the last price q 4 to convert, because it is the end of the trading horizon, i.e., t = T . The optimal trading decisions would be to convert first at time t = 2 and again at time t = 4 .
Now this example is adapted to the algorithm kRPP. Since kRPP only solves the special case with k = l (the k-search problem), the example is adapted by setting w 1 = w 2 = 1 and therefore k = 2 . kRPP differs from lRPP by determining different reservation prices q 1 , k R P P * = 5.9441412 and q 2 , k R P P * = 4.1498315 . In this example kRPP converts also the first group at time t = 2 , but accepts the price to convert at time t = 3 for the other group.

3.1. Min-Search

Lemma 1.
The optimal reservation prices for the lRPP in a min-search problem are calculated by the following:
q i * = M · 1 1 1 c · j = 2 i 1 + w j 1 k · c .
Proof of Lemma 1.
To determine the optimal reservation prices, it is crucial to identify and balance all worst-case scenarios. In worst-case sequences the players are offered the reservation prices q i * , subsequently beginning with i = 1 , until one price q t is infinitesimally higher than the next reservation price, i.e., q t = q i * + ϵ with ϵ 0 . ON accepts the first t 1 prices to convert, and rejects the price q t . Then q t is offered l-times. OPT converts all groups to this price and then the price raises up to M and remains there for the rest of the game, forcing ON to convert all remaining groups to M. In case the offered prices are never higher than the next of the j reservation prices, ON accept all reservation prices which results in converting all groups. Then the price drops to m and OPT converts all groups. This results in l + 1 worst case sequences. Let q i with i = 1 , , l + 1 be the worst-case sequence in which OPT converts to q i * + ϵ . For simplification it holds q l + 1 * = m ϵ . The ratio of OPT and ON holds the following:
O N ( q i ) O P T ( q i ) = j = 1 i 1 w j · q j * + k j = 1 i 1 w j · M k · q i * + ϵ = k · M + j = 1 i 1 w j · q j * M k · q i * + ϵ .
Since there are l + 1 possible worst-case sequences and l degrees of freedom (the l reservation prices), it exists a unique solution in which all ratios of the possible worst-case sequences are balanced. To derive the general formula for the reservation prices, the indices i and i + 1 are substituted into Equation (11) and then subtracted from one another. This leads to the following recursive formula:
O N ( q i + 1 ) O P T ( q i + 1 ) O N ( q i ) O P T ( q i ) = 0 q i * · w i M · w i + k · c · q i + 1 * k · c · q i * = 0 q i + 1 * = M · 1 1 q i * M · 1 + w i k · c .
Note that ϵ is set to 0 when calculating the optimal reservation prices. Since it holds M q 1 = c , the general formula for the reservation prices results in Equation (10).
Using this formula, the ratios of all worst-case sequences are balanced. From the balancing follows that different reservation prices lead to a worse competitive ratio. □
Note that Equation (10) is very close to the equation for the reservation prices of [1]. In fact, Equation (5) can be rewritten to
q i , k R P P * = M · 1 1 1 c · l = 2 i 1 + 1 k · c .
The only difference from Equations (10)–(13) is that in the product, the term w j 1 is in the nominator instead of a 1. Therefore, the kRPP provided by [1] is a special case of lRPP, where only the k-search problem with a unit sequence W = 1 , 1 , , 1 can be solved. In contrast, lRPP solves the general case with arbitrary sequences W with w j N * j = 1 , , l .
Theorem 1.
There is no deterministic algorithm that leads to a lower competitive ratio than c = M k · m · i = 1 l i · 1 1 1 c · j = 2 i 1 + w j 1 k · c by given M and m for the min-search variant of the weighted k-search problem.
Proof of Theorem 1.
This proof follows directly from the balancing argument in Lemma 1. Putting Equation (10) in Equation (11) with i = l leads to the competitive ratio:
c = M k · m · i = 1 l w i · 1 1 1 c · j = 2 i 1 + w j 1 k · c .

3.2. Max-Search

In this section the competitive ratio of the max-search problem is given. Ref. [1] states that it is unexpected that the competitive ratios for the optimal online min- and max-search algorithms differ when M and m are the same. This argumentation is not followed here. Each min-search problem can be transformed into a max-search problem and vice versa by changing the perspectives of the exchange rate. A min-search problem with the exchange rate s is a max-search problem with the exchange rate equal to the reciprocal of s, that means 1 s . Let P be a min-search problem with lower bound m and upper bound M. The corresponding max-search problem P with lower bound m = 1 M and upper bound M = 1 m is the same problem, only the perspectives of the exchange rate change. As a result, the optimal online algorithm for P attains the same competitive ratio as that for P . Therefore, it is entirely expected that a max-search problem, when using the same lower and upper bounds, m and M (rather than m and M ), as a min-search problem, would exhibit a different competitive ratio.
Lemma 2.
The optimal reservation prices for the lRPP in a max-search problem are calculated by the following:
q i * = m · 1 + c 1 · l = 2 i 1 + w l 1 · c k .
Proof of Lemma 2.
The proof follows the same argumentation as for Lemma 1. As long as the reservation prices are offered subsequently ON converts, as soon as a price q t = q i * ϵ is offered, OPT converts l times and the price drops to m. If all reservation prices are offered, the price raises to M and OPT converts all groups to M. For simplification, q l + 1 * = M + ϵ is held. The ratio of OPT and ON holds the following:
O P T ( q i ) O N ( q i ) = k · q i * ϵ l = 1 i 1 w l · q l + k l = 1 i 1 w l · m = k · q i * ϵ k · m + l = 1 i 1 w l · q l * m .
To derive the general formula for the reservation prices, the indices i and i + 1 are substituted into Equation (11) and then subtracted from one another. This leads to the following recursive formula:
O P T ( q i + 1 ) O N ( q i + 1 ) O P T ( q i ) O N ( q i ) = 0 q i * · w i m · w i + k · q i + 1 * c k · q i * c = 0 q i + 1 * = m · 1 + q i * m 1 · 1 + w i · c k .
Note that ϵ is set to 0 when calculating the optimal reservation prices. Since it holds q 1 m = c , the general formula for the reservation prices results in Equation (15). □
Theorem 2.
There is no deterministic algorithm that leads to a lower competitive ratio than c = M · k m · i = 1 l w i · 1 + c 1 · j = 2 i 1 + w j 1 · c k by given M and m for the max-search variant of the weighted k-search problem.
Proof of Theorem 2.
Putting Equation (15) in Equation (16) with i = l leads to the competitive ratio:
c = M · k m · i = 1 l w i · 1 + c 1 · j = 2 i 1 + w j 1 · c k .
This proof follows directly from the balancing argument in Lemma 2. □

3.3. Additional Insights

Remark 1.
The competitive ratio c l R P P of lRPP in the case of an unknown investment horizon T represents an upper bound for the competitive ratio c l R P P , T with known T.
Let c l R P P , T and c l R P P represent the competitive ratios of the lRPP in cases where the investment horizon T is known and unknown, respectively. It holds c l R P P , T c l R P P T N * . This conclusion is drawn from the fact that in every worst-case scenario for the lRPP, ON and OPT do not convert to the same price at any point. For j T < 2 · l , the competitive ratio must be lower than c l R P P , because OPT cannot avoid converting to the same price as ON. The case of T > 2 · l is straightforward, since both players convert l times. In this scenario, a sequence with T > 2 · l prices would contain T 2 · l prices where neither player converts. These prices have no impact on the competitive ratio. Equation (6) thus holds an upper bound for the competitive ratio with known T.
Remark 2.
Two unit sequences W and W for which hold W = x · W with x N * and x > 1 results in the same competitive ratio.
This follows from Equation (14) for the min-search problem. Let c ( W ) be the competitive ratio for unit sequence W by given M and m. For the remark to be true, it must hold the following:
c ( W ) = c ( W ) M k · m · i = 1 l w i · 1 1 1 c · j = 2 i 1 + w j 1 k · c = M x · k · m · i = 1 l x · w i · 1 1 1 c · j = 2 i 1 + x · w j 1 x · k · c .
The proof is the analog for the max-search problem using Equation (18).
As mentioned before, competitive analysis is based on the idea of playing against an adversary who has complete knowledge of future inputs. OPT is able to make optimal decisions. In this setting worst-case sequences are searched to determine the competitive ratio. Another interpretation of competitive analysis is that OPT not only has knowledge of the future, but also has the ability to control it, with the objective of maximizing the ratio between OPT and ON performances. This implies that OPT has knowledge of the algorithm used by ON and can choose the information that is not known to ON in a manner that maximizes the ratio between their performances. In the considered case it is the price sequence q and the investment horizon T. This perspective of OPT can be extended by considering that it can also make decisions about the information given to ON. An interesting question then becomes how OPT would choose the unit sequence W in order to maximize the ratio between its and ON performances by given k and l.
Lemma 3.
The competitive ratio c for lRPP for a given unit sequence W = ( w 1 , w 2 , , w l ) is the same for each permutation of W .
Proof of Lemma 3.
The proof is demonstrated for the min-search problem, and the proof for the max-search problem follows the same approach. Let W be a unit sequence with l elements and let κ i i = 2 , , l be the sum of the product of each element combination with i elements in sequence W . That means, κ 2 = 1 n < i l ( w i · w n ) , κ 3 = 1 j < n < i l w i · w n · w j , and so on. Let a sequence W = ( w 1 , w 2 , , w l ) be a permutation of the sequence W . If the lemma is true, it must hold that the ratio of ON and OPT is the same on both sequences:
O N O P T ( W ) = O N O P T ( W ) M k · m · i = 1 l w i · 1 1 1 c · j = 2 i 1 + w j 1 k · c = M k · m · i = 1 l w i · 1 1 1 c · j = 2 i 1 + w j 1 k · c i = 1 l w i · 1 1 1 c · j = 2 i 1 + w j 1 k · c = i = 1 l w i · 1 1 1 c · j = 2 i 1 + w j 1 k · c .
For improved readability, both parts of the equation are considered separately. The left sum represents the following:
w 1 · 1 1 1 c + w 2 · 1 1 1 c · 1 + w 1 k · c + + w l · 1 1 1 c · 1 + w 1 k · c · · 1 + w l 1 k · c k 1 1 c · w 1 + w 2 · 1 + w 1 k · c + w 3 · 1 + w 1 k · c · 1 + w 2 k · c + + w l · 1 + w 1 k · c · 1 + w 2 k · c · · 1 + w l 1 k · c k 1 1 c · k + κ 2 k · c + κ 3 k · c 2 + + κ j k · c l 1 .
For the right sum the same steps can be made and it also leads to
k 1 1 c · k + κ 2 k · c + κ 3 k · c 2 + + κ j k · c l 1 .
From this follows that Equation (20) is true. □
Remark 3.
lRPP also optimally solves a variant of the weighted k-search problem in which ON is allowed to choose its own unit sequence.
This follows directly from Lemma 3. Each permutation of the unit sequence leads to the same competitive ratio, balancing all possible worst-case sequences. OPT is not affected by the adaptation in the new variant, because it converts all units at the same price. lRPP first calculates c and then adjusts the reservation prices q i * for any given or chosen unit sequence to achieve exactly this competitive ratio c on every possible worst-case sequence.
Lemma 4.
The competitive ratio c for lRPP for a given k and l maximizes on a unit sequence W = ( k l + 1 , 1 , 1 , 1 , 1 ) or any permutation of this sequence.
Proof of Lemma 4.
The proof is demonstrated for the min-search problem, and the proof for the max-search problem follows the same approach. The competitive ratio c depending on κ can be derived from Equation (22). It follows
c = M k · m · k 1 1 c · k + κ 2 k · c + κ 3 k · c 2 + + κ j k · c l 1 .
In order to maximize the solution of Equation (23), the values of κ i i = 2 , , l have to be minimized. Remember that these are the sums of products of elements of the unit sequence. From Lemma 3 it can be assumed that w.l.o.g. holds for any unit sequence w 1 w 2 w l . Let W be a unit sequence ( w 1 , w 2 , , w l ) . Furthermore, let r be an arbitrary position with 1 < r l that holds w r 2 , and let W be the unit sequence obtained by replacing the r-th element of W with w r 1 and replacing the first element with w 1 + 1 , i.e., W = ( w 1 , w 2 , , w r , , w l ) with w 1 = w 1 + 1 and w r = w r 1 . The products of W can be split into three categories depending on the containing prices.
In the first category are the products that neither contain w 1 and w r . So the values of these products are identical with the corresponding products of W .
The second category contains the products that include both w 1 and w r . Since w 1 w 2 w r w l > 0 , it holds w 1 + w r 1 < w 1 · w r . From this follows that the sum of these products decreases compared with W .
The last category contains all products that either consist of w 1 but not w r or vice versa. All products with w 1 increase and all with w r decrease. To determine if the sum of all products in this category increases or decreases, we can pair each product of the form w 1 · w x · w y · with the corresponding product obtained by replacing w 1 with w r . These pairs are built for W and W and compared. Equation (24) shows that for any pair, the sum of these product pairs is the same. Without loss of generality, a pair of products is considered in which w 1 , w r , respectively, are multiplied by w x .
w 1 · w x + w r · w x = w 1 · w x + w r · w x w 1 + w r = w 1 + 1 + w r 1 w 1 + w r = w 1 + w r
The sum of all products in the first and last category is the same for W and W . In the second category, the products in W are lower than those in W . Thus, each κ i for i = 2 , , l is lower in the unit sequence W . It follows that on a unit sequence W with w 1 w 2 w r w l and w r > 1 , the achievable competitive ratio for an online algorithm is lower than on a unit sequence W with w 1 = w 1 + 1 , w r = w r 1 and w i = w i , i = 2 , , w r 1 , w r + 1 , , w l . Therefore, the competitive ratio is maximized on the sequence W = ( k l + 1 , 1 , 1 , 1 , 1 ) . □
Note that the argumentation from Lemma 4 can be used to prove that a unit sequence in which holds w l w 1 1 , minimizes the achievable competitive ratio. In case of k mod l = 0 the k-search problem minimizes the achievable competitive ratio. From this follows that the competitive ratio of the k-search problem is a lower bound for the competitive ratio of the weighted k-search problem.
Remark 4.
The competitive ratio of RPP c R P P is an upper bound for the competitive ratio of lRPP c l R P P .
The uni-directional non-preemptive conversion problem can be reinterpreted as a k-search problem with the sequence W = ( 1 , 0 , 0 , 0 , , 0 ) . In this setting, it is sufficient for lRPP to compute only the first reservation price q 1 * . This results in the same reservation price as that obtained by RPP, and therefore in the same competitive ratio. Furthermore, Lemma 4 implies that a sequence in which one value is maximized while all other values are minimized leads to the highest possible competitive ratio. Consequently, the competitive ratio of RPP constitutes an upper bound on the competitive ratio of lRPP.
Table 2 presents numerical examples illustrating the competitive ratios for RPP, kRPP and lRPP. Note that kRPP and lRPP find the same solution in case of the k-search problem. The competitive ratio of lRPP converges toward that of RPP but does not exceed it. Moreover, increasing the number of groups l consistently results in a lower competitive ratio for all considered algorithms, with the exception of RPP, since it operates only on a single group regardless of l.

4. Conclusions

In this work, the weighted k-search problem is introduced. A player has to divide wealth into k units. The k units are summarized into l groups. Each group has to be converted as a whole group and it is only allowed to convert one group at once. The unit sequence W = w 1 , , w l defines how many units are in each group and in which order the groups have to be converted.
The problem is analyzed in a setting in which the online player has only information about the upper M and the lower bound m for the prices and the unit sequence W . The introduced online algorithm lRPP solves this problem optimally. It is shown that this remains true even if the player is allowed to choose their own unit sequence. Furthermore, it is shown that the k-search problem is a special case of the weighted k-search problem. It is also shown that for given k and l, a unit sequence which maximizes the size of an arbitrary group i leads to the worst competitive ratio. Conversely, equally sized groups lead to the best achievable competitive ratio for the weighted k-search problem. If equal sizing is not possible, then the achievable competitive ratio is minimized if the maximal and minimal group size differs by 1.
An open research question is how to adapt lRPP for the variant of the problem, in which the online player knows T and it holds l T 2 · l . The competitive ratio for the case with unknown T represents an upper bound for an optimal online algorithm. A second open research question is how to solve the weighted k-search problem in the case that the number of groups that can be converted at once is not restricted by 1.

Author Contributions

Conceptualization, M.S. and R.D.; methodology, M.S.; validation, M.S.; formal analysis, M.S.; writing—original draft preparation, M.S.; writing—review and editing, M.S.; supervision, R.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

No new data were created or analyzed in this study.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Lorenz, J.; Panagiotou, K.; Steger, A. Optimal Algorithms for k-Search with Application in Option Pricing. Algorithmica 2009, 55, 311–328. [Google Scholar] [CrossRef]
  2. Borodin, A.; El-Yaniv, R. Online Computation and Competitive Analysis; Cambridge University Press: Cambridge, UK, 1998. [Google Scholar]
  3. Sleator, D.D.; Tarjan, R.E. Amortized Efficiency of List Update and Paging Rules. Commun. ACM 1985, 28, 202–208. [Google Scholar] [CrossRef]
  4. Mohr, E.; Ahmad, I.; Schmidt, G. Online algorithms for conversion problems: A survey. Surv. Oper. Res. Manag. Sci. 2014, 19, 87–204. [Google Scholar] [CrossRef]
  5. El-Yaniv, R.; Fiat, A.; Karp, R.M.; Turpin, G. Competitive analysis of financial games. In Proceedings of the IEEE Symposium on Foundations of Computer Science, Pittsburgh, PA, USA, 24–27 October 1992; pp. 327–333. [Google Scholar]
  6. El-Yaniv, R. Competitive solutions for online financial problems. ACM Comput. Surv. 1998, 30, 28–69. [Google Scholar] [CrossRef]
  7. Dannoura, E.; Sakurai, K. An improvement on El-Yaniv-Fiat-Karp-Turpin’s money-making bi-directional trading strategy. Inf. Process. Lett. 1998, 66, 27–33. [Google Scholar] [CrossRef]
  8. El-Yaniv, R.; Fiat, A.; Karp, R.M.; Turpin, G. Optimal Search and One-Way Trading Online Algorithms. Algorithmica 2001, 30, 101–139. [Google Scholar] [CrossRef]
  9. Schwarz, M. Kompetitive Algorithmen für den Börsenhandel. Ph.D. Thesis, Saarland University, Saarbrücken, Germany, 3 June 2019. [Google Scholar]
  10. Schwarz, M. Lower and upper bounds for the discrete bi-directional pre-emptive conversion problem with a constant price interval. Algorithms 2020, 13, 42. [Google Scholar] [CrossRef]
  11. Fung, S.P.Y. Optimal Online Two-Way Trading with Bounded Number of Transactions. Algorithmica 2019, 81, 4238–4257. [Google Scholar] [CrossRef]
  12. Chen, G.H.; Kao, M.Y.; Lyuu, Y.D.; Wong, H.K. Optimal buy-and-hold strategies for financial markets with bounded daily returns. In Proceedings of the Thirty-First Annual ACM Symposium on Theory of Computing, Atlanta, GA, USA, 1–4 May 1999; pp. 119–128. [Google Scholar]
  13. Zhang, W.; Xu, Y.; Zheng, F.; Dong, Y. Optimal algorithms for online time series search and one-way trading with interrelated prices. J. Comb. Optim. 2012, 23, 159–166. [Google Scholar] [CrossRef]
  14. Schroeder, P.; Kacem, I. New algorithms for online time series search with interrelated prices. In Proceedings of the 2019 6th International Conference on Control, Decision and Information Technologies (CoDIT), Paris, France, 23–26 April 2019; pp. 1682–1687. [Google Scholar]
  15. Schroeder, P.; Kacem, I.; Schmidt, G. Optimal online algorithms for the portfolio selection problem, bi-directional trading and -search with interrelated prices. RAIRO Oper. Res. 2019, 53, 559–576. [Google Scholar] [CrossRef]
  16. Damaschke, P.; Ha, P.H.; Tsigas, P. Online Search with Time-Varying Price Bounds. Algorithmica 2009, 55, 619–642. [Google Scholar] [CrossRef]
  17. Zhang, W.; Xu, Y.; Zheng, F.; Liu, M. Online algorithms for the general k-search problem. Inf. Process. Lett. 2011, 111, 678–682. [Google Scholar] [CrossRef]
  18. Schmidt, G. Competitive analysis of bi-directional non-preemptive conversion. J. Comb. Optim. 2017, 34, 1096–1113. [Google Scholar] [CrossRef]
  19. Zhang, W.; Zhang, E.; Zheng, F. Online (j, k)-search problem and its competitive analysis. Theor. Comput. Sci. 2015, 593, 139–145. [Google Scholar] [CrossRef]
  20. Zhang, W.; Zhang, Y.; Cheng, Y.; Zheng, S. An online trading problem with an increasing number of available products. J. Comb. Optim. 2022, 44, 518–531. [Google Scholar] [CrossRef]
  21. Zhao, J.; Cheng, Y.; Eube, J.; Liu, H. Online multiple one way non-preemptive time series search with interrelated prices. J. Comb. Optim. 2024, 49, 12. [Google Scholar] [CrossRef]
  22. Zhang, W.; Zhang, E.; Zheng, F. Online two stage k-search problem and its competitive analysis. Int. J. Found. Comput. Sci. 2016, 27, 653–663. [Google Scholar] [CrossRef]
  23. Lechowicz, A.; Christianson, N.; Zuo, J.; Bashir, N.; Hajiesmaili, M.; Wierman, A.; Shenoy, P. The Online Pause and Resume Problem: Optimal Algorithms and an Application to Carbon-Aware Load Shifting. Proc. Acm Meas. Anal. Comput. Syst. 2023, 7, 1–32. [Google Scholar] [CrossRef]
  24. Ahmad, I.; Abdulwahab, A.A.; Mohammed, A.A.; Muhammad, K.N. Competitive risk aware algorithm for k-min search problem. Intell. Autom. Soft Comput. 2022, 31, 1131. [Google Scholar] [CrossRef]
  25. Clemente, J.B.; Adorna, H.N.; Fernandez, P.L., Jr. Online algorithms with advice for the k-search problem. Philipp. J. Sci. 2022, 151, 1321–1331. [Google Scholar] [CrossRef]
  26. Lee, R.; Sun, B.; Hajiesmaili, M.; Lui, J.C.S. Online Search with Predictions: Pareto-optimal Algorithm and its Applications in Energy Markets. In Proceedings of the 15th ACM International Conference on Future and Sustainable Energy Systems, Vienna, Austria, 2–5 July 2024; pp. 386–407. [Google Scholar]
  27. Dochow, R. Online Algorithms for the Portfolio Selection Problem; Springer: Wiesbaden, Germany, 2016. [Google Scholar]
Table 1. Summary of notation.
Table 1. Summary of notation.
VariableDescription
kTotal number of units to convert
lNumber of groups to convert
mLowest possible price
MHighest possible price
TTime horizon
q t Price at time t
q Price sequence
w i Number of units in group i
W Unit sequence (sequence of grouped units)
W T Terminal wealth
q i * Reservation price for group i
s t Number of units converted at time t
h t Group which can be converted at time t
cCompetitive ratio
Table 2. Competitive ratios for RPP, kRPP, and lRPP with M = 15 , m = 2 and l { 3 , 6 } .
Table 2. Competitive ratios for RPP, kRPP, and lRPP with M = 15 , m = 2 and l { 3 , 6 } .
Algorithm l = 3 l = 6
W c W c
kRPP/lRPP ( 1 , 1 , 1 ) 2.4407 ( 1 , 1 , 1 , 1 , 1 , 1 ) 2.3506
lRPP ( 10 , 1 , 1 ) 2.6106 ( 10 , 1 , 1 , 1 , 1 , 1 ) 2.4981
lRPP(10,000 , 1 , 1 ) 2.7384(10,000 , 1 , 1 , 1 , 1 , 1 ) 2.7382
RPP ( 1 , 0 , 0 ) 2.7386 ( 1 , 0 , 0 , 0 , 0 , 0 ) 2.7386
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Schwarz, M.; Dochow, R. The Weighted k-Search Problem. Mathematics 2026, 14, 206. https://doi.org/10.3390/math14020206

AMA Style

Schwarz M, Dochow R. The Weighted k-Search Problem. Mathematics. 2026; 14(2):206. https://doi.org/10.3390/math14020206

Chicago/Turabian Style

Schwarz, Michael, and Robert Dochow. 2026. "The Weighted k-Search Problem" Mathematics 14, no. 2: 206. https://doi.org/10.3390/math14020206

APA Style

Schwarz, M., & Dochow, R. (2026). The Weighted k-Search Problem. Mathematics, 14(2), 206. https://doi.org/10.3390/math14020206

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop