# Computational bounds on randomized algorithms for online bin stretching

Antoine Lhomme, Nicolas Catusse, Nadia Brauner

<figure><img src="image_1.png" /></figure>

## To cite this version:

Antoine Lhomme, Nicolas Catusse, Nadia Brauner. Computational bounds on randomized algorithms for online bin stretching. 2025. hal-05319673

HAL Id: hal-05319673

https://hal.science/hal-05319673v1

Preprint submitted on 17 Oct 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Computational bounds on randomized algorithms for online bin stretching

Antoine Lhomme, Nicolas Catusse, Nadia Brauner

Univ. Grenoble Alpes, CNRS, Grenoble INP, G-SCOP, 38000 Grenoble, France

May 30, 2024

## Abstract

A frequently studied performance measure in online optimization is competitive analysis. It corresponds to the worst-case ratio, over all possible inputs of an algorithm, between the performance of the algorithm and the optimal offline performance. However, this analysis may be too pessimistic to give valuable insight on a problem. Several workarounds exist, such as randomized algorithms.

This paper aims to propose computational methods to construct randomized algorithms and to bound their performance on the classical online bin stretching problem. A game theory method is adapted to construct lower bounds on the performance of randomized online algorithms via linear programming. Another computational method is then proposed to construct randomized algorithms which perform better than the best deterministic algorithms known. Finally, another lower bound method for a restricted class of randomized algorithm for this problem is proposed.

## 1 Online bin stretching

The online bin stretching problem, introduced in [3], is defined as follows: a finite sequence of items, each characterized by its size (represented by a real number), must be placed into *m* bins. The items are revealed sequentially, meaning that an item, when revealed, must be placed into a bin before the next one is shown. The whole set of items given is also known to fit inside *m* bins of unit size. The objective is to place all the items into the bins so that, in the end, the load of the fullest bin is minimized. An algorithm that places items into bins has its performance measured through its worst-case input; the performance of an algorithm is called in this problem the *stretching factor*<fnref n="1" />.

This problem may also be interpreted as an online scheduling problem on *m* parallel identical machines where the objective is to minimize the makespan (the total time to execute all tasks): using scheduling notations, the problem may be written as $P_m|online, OPT = 1|C_{max}$, with $OPT = 1$ indicating that the optimal makespan is known in advance to be of unit duration.

Interestingly, some of the best known lower and upper bounds (algorithms) for this problem in the deterministic<fnref n="2" /> setting were recently found through computational searches: see [7], [5], [9] for lower bounds and [10] for upper bounds. Figure 1 depicts the current state of the art on this problem. Solid squares or solid circles correspond to values that were found through a computational search. Finding optimal online algorithms is still a challenge when the number of bins *m* is greater than 2.

The computational method to find lower bounds may be summarized as follows: the problem is modelled as a two-player zero-sum game, where one player, the *adversary*, sends items and the other player, the *algorithm*, who places the items into bins. The algorithm aims to minimize the load of the largest bin. By restricting the adversary to a finite subset of possible item sizes, the game becomes finite - and hence its min-max value may be computed through standard techniques. Since the adversary player is restricted in this game, the min-max value is a lower bound

<footnote n="1">¹If the sequence of items fits exactly into *m* bins of unit size, then the stretching factor may also be seen as a competitive ratio.</footnote>

<footnote n="2">²We employ the term *deterministic* in contrast to *randomized*: for some input, the output of a deterministic algorithm is fixed, while the output of a randomized algorithm is a random variable</footnote>
<figure><img src="image_3.png" /><figcaption>Figure 1: Best known bounds on the minimal stretching factor of deterministic algorithms for the online bin stretching problem. Solid squares and circles represent bounds that were found through computational searches.</figcaption></figure>

of the best achievable competitive ratio of online deterministic algorithms. Figure 2 gives an example of an adversarial strategy that proves the lower bound $\frac{4}{3}$ when 2 bins are available.

<figure><img src="image_4.png" /><figcaption>Figure 2: Adversarial strategy showing the lower bound of $\frac{4}{3}$ for the online bin stretching problem where 2 bins are available. In parentheses: occupied volume in each bin.</figcaption></figure>

To construct upper bounds, the same kind of technique is used. The problem is once again modelled as a game between the adversary and the algorithm; however, to ensure that a strategy for the algorithm player corresponds to a true online bin stretching algorithm, the adversary player sends item *classes* instead of items, which correspond to an interval of possible item sizes. See [10] for more details about this technique, which is not explained here.

The heart of the computational methods to obtain the lower and upper bounds consists of min-max searches in a game tree. Naturally, the size of the game tree becomes exponentially greater as one allows more items to be sent, and computation times are the limiting factor for obtaining better bounds.

Most of the results known so far for this problem are in the deterministic setting. The aim of this paper is to explore the randomized setting and to do so with computational methods, in the same fashion as to what has been done for the deterministic case. Section 2 justifies the interest of randomized algorithms and describes a framework to study online
problems. In Section 3, a linear programming methods allows the computational search of lower bounds for online problems. This method is used with success in Section 4.1 on the online bin stretching problem to construct new lower bounds on the performance of randomized algorithms; moreover Appendix B details a proof of the convergence of that method for the online bin stretching problem. Moreover, a restricted class of randomized algorithms is studied in Section 4.2 and Section 4.3, which yields a randomized algorithm that outperforms deterministic algorithms in the simple case for two bins.

# 2 Randomized algorithms

## 2.1 Motivation

Consider the following game of *matching pennies*: two players, A and B, each have a coin. Each picks a side, heads or tails, and then both show each other their coin. If both players have selected the same side, then player A wins. Otherwise, player B wins. A deterministic strategy for a player corresponds to choosing heads or tails, thus there are only two possible deterministic strategies. Trivially, the worst-case scenario for any given deterministic strategy of any player is a loss, which makes the worst-case analysis not so insightful. A well known work-around is to consider *randomized strategies*, which are informally, strategies making use of randomness in some way. For games with a quantified objective, the worst-case performance of a randomized strategy can be defined as the worst-case (relative to the strategies of the other players) of the expected pay-off (relative to the randomness of the randomized strategy) of the game.

In the previous example of matching pennies, the randomized strategy that picks heads (otherwise tails) with probability $\frac{1}{2}$ is the best one in the sense of worst-case analysis: regardless of the strategy chosen by the other player, the likelihood of winning is $\frac{1}{2}$.

In online optimization, considering randomized algorithms is a fairly standard practice (see [4]) as doing so helps to lessen the flaws of worst-case analysis, as showcased in the previous matching pennies example. Thus, we aim to consider randomized algorithms for the previously introduced online bin stretching problem. So far, the only result known on randomized algorithms for online bin stretching is the following lower bound, from [7]:

**Property 2.1.** For the online bin stretching problem with two bins, no randomized algorithms may have a stretching factor lower than $7/6$.

In game theory, two types of randomized strategies that are often considered are *mixed strategies* and *behavioral strategies*. The first one corresponds to picking, before the start of the game, a deterministic strategy according to some probability distribution and then following the chosen deterministic strategy for the rest of the game. The second one corresponds to, whenever a player has to make a move, picking a move according to some distribution. It has been shown in [8] that, if the game is finite and of *perfect recall*, i.e., when players "remember" their past moves, then both types of strategies are equivalent. If the game is infinite, then it has also been shown in [2] that both kinds of strategies are equivalent, however this requires more complex definitions of mixed and behavioral strategies: these will be addressed in Appendix A.

## 2.2 The request-answer framework

Let us first remark that the whole idea of using randomized algorithms requires *independence* between the decisions taken by an algorithm and the input sequence received. For instance, the input may be the current weather and the decision may be whether one purchases an umbrella or not. It is then reasonable to assume that the decision taken does not have any influence on the weather for future upcoming days. Our formalism is built on this assumption: it corresponds to *request answer games* [1], which we will briefly define in the following.

As the performance of an algorithm is measured in this paper by its worst-case input, an *adversary* player will be in charge of sending the input to the algorithm with the goal of making the algorithm perform as poorly as possible - this forms a two-player, zero-sum game.

**Definition 2.1 (Request answer game).** A request answer game $\mathcal{G} = (\mathcal{I}, \mathcal{D}, f)$ consists of:
* A set of instances $\mathcal{I}$, where instances are finite sequences of requests;

* A set of decisions $\mathcal{D}$;

* A pay-off function $f: F \to \mathbb{R}$, where $F = \{(I, (d_1, \dots, d_k)) \mid I \in \mathcal{I} \text{ and } (d_1, \dots, d_k) \in \mathcal{D}^{|I|}\}$.

The game proceeds as follows: a request arrives to the algorithm, who has to pick some decision in $\mathcal{D}$. This is repeated, but the sequence of requests is constrained to be in the set of instances $\mathcal{I}$. When the sequence ends, the pay-off is computed through the pay-off function $f$ - in all of this document, the algorithm always aims to minimize the pay-off. For the online bin stretching problem, an instance is a sequence of items that fit into $m$ bins of unit size, a decision is the index of a bin into which to pack an item, and the pay-off function corresponds to the load of the fullest bin.

The objective in the deterministic setting is to find the best algorithm possible in the worst-case; formally, we aim to compute the deterministic value $v_{det}^*$ of the game:

$$v_{det}^* = \inf_{A \in \mathcal{A}_{det}} \sup_{I \in \mathcal{I}} f(I, A(I))$$

In the above equation, $\mathcal{A}_{det}$ represents the set of deterministic algorithms, and we suppose that $A(I)$ corresponds to the sequence of decisions taken by the algorithm on the input sequence $I$.

In the randomized case, the output $A(I)$ of an algorithm $A$ on some instance $I$ is a random variable; thus we aim to compute the randomized value of the game defined as:

$$v_{rand}^* = \inf_{A \in \mathcal{A}_{rand}} \sup_{I \in \mathcal{I}} \mathbb{E}(f(I, A(I)))$$

*Remark.* Online algorithms are often studied through competitive analysis, which measures the competitive ratio of algorithms: it corresponds to the worst-case over all inputs of the ratio of performance between the pay-off from the online algorithm and an optimal offline algorithm, i.e., who has knowledge of the entire input in advance. With the given formalism, one may define the pay-off function to correspond to such a ratio, so that the value of the game corresponds to the best competitive ratio achievable by an algorithm.

## 3 Lower bounds for online randomized algorithms with linear programming

In this section, we use a game theory technique to compute lower bounds on the performance of randomized online algorithms for a given online problem. The method is inspired from [12] and uses linear programming. The following develops both the general idea alternatively with a practical toy example, which is then applied in Section 4.1 to the online bin stretching problem to construct new bounds.

The method we present here is inspired by the work of [12], in which a method to compute the equilibrium of a game via a linear program is given. It is adapted here for online problems; the method cannot be applied straightforwardly to the game tree of the request-answer game, as the whole input sequence must be chosen in advance before the algorithm makes random choices.

Let $(\mathcal{I}, \mathcal{D}, f)$ be a request-answer game as defined in Section 2.2, with $\mathcal{D}$ finite and $\mathcal{I}$ finite as well. We aim to compute the worst case expected pay-off of the best randomized algorithm for this request-answer game. We require $\mathcal{I}$ to be finite here, which is very restrictive. In practice, one may approximate $\mathcal{I}$ by finite subsets $(\mathcal{I}_g)_{g \in \mathbb{N}}$, such that $\forall g \in \mathbb{N}, \mathcal{I}_g \subseteq \mathcal{I}_{g+1} \subset \mathcal{I}$. Then, applying the method to the game $(\mathcal{I}_g, \mathcal{D}, f)$ will result in a lower bound on the performance of randomized algorithms, since the adversary is restricted to a subset of instances. Increasing $g$ may then give better and better bounds.

**Example 3.1.** To clarify the idea, the following finite two-player zero-sum game, represented with its game tree in Figure 3, will serve as an example. The first player, named the algorithm, aims to go skiing during the weekend. Each day, the algorithm may either go skiing (S) or stay at home, drinking hot chocolate (C). Each day, it will either be snowing (S) or the weather will be clear (C). The algorithm aims to minimize some unhappiness function defined as
follows: skiing while it is snowing for a day gives 1 unhappiness, but -2 unhappiness in clear weather. Moreover, if it was snowing on the first day, going skiing in clear weather yields -3 unhappiness thanks to fresh that day. Drinking hot chocolate while the weather is clear gives 1 unhappiness, but it gives -1 unhappiness while it is snowing. The weather is, however, completely unpredictable in this particular ski resort and is only known when the algorithm has already made its choice. The worst-case analysis of this problem is not very insightful: if the algorithm decides to go skiing, then it may end up snowing, and if the algorithm stays at home, the weather may be clear; the min-max value of the game tree in Figure 3 is 2. In other words, the best deterministic algorithm has a worst-case of 2.

<figure><img src="image_5.png" /><figcaption>Figure 3: Two player zero-sum game example. Diamond nodes represent a decision node for the algorithm player (aiming to minimize the pay-off) and filled circles are for the adversary player (aiming to maximize the pay-off). S represents "Snow" for the adversary and "Skiing" for the algorithm, while C represents "Clear weather" for the adversary and "Chocolate" for the algorithm.</figcaption></figure>

To compute the expected value of the game for the optimal randomized algorithm in the worst case, we model the game as a linear program in the following way.

First, label all possible moves of the algorithm in this game as $x_i$, and label all the sequences of moves of the adversary as $y_j$. These will be variables in our linear program that represent the randomized strategies of the algorithm and adversary player. For the algorithm, variables $x_i$ will represent a flow of probability - this may be clearer in the example that follows.

Flow constraints are added as follows: if $x_{f_1}, \dots, x_{f_k}$ are variables corresponding to the algorithm moves for some game state, and that $x_p$ is the variable corresponding to the last move made by the algorithm, then add the constraint:

$$ \sum_{i=1}^{k} x_{f_i} = x_p $$

For the very first move of the algorithm player, replace $x_p$ by 1. These constraints in matrix form may be written as:

$$ Ex = e $$

For the adversary, add a variable $y_i$ for each possible sequence of moves for the adversary, i.e., a variable for each element of $\mathcal{I}$. This variable represents the probability for the adversary of choosing such a move sequence. Then, add the constraint:

$$ \sum_{i} y_i = 1 $$

Moreover, $x$ and $y$ are constrained to be positive.

**Example 3.2.** Figure 4 shows a possible labelling of the edges for the game of Figure 3. From the root node, the algorithm has to make a decision. The probability of choosing the left branch is exactly $x_1$, and is $x_6$ for the right branch. From this node's left side child, the algorithm has to make its second move. It picks left with probability $\frac{x_2}{x_1}$ and right with probability $\frac{x_3}{x_1}$.
The adversary has four sequences of moves available: (S, S), (S, C), (C, S) and (C, C). Thus, variables y1, y2, y3 and y4 are added.

The flow constraints for the algorithm player can be written as:

$$x_1 + x_6 = 1$$

$$x_2 + x_3 = x_1$$

$$x_4 + x_5 = x_1$$

$$x_7 + x_8 = x_6$$

$$x_9 + x_{10} = x_6$$

The constraint for the adversary player is written as:

$$y_1 + y_2 + y_3 + y_4 = 1$$

These constraints may then be written in the form $Ex = e$ and $\sum_i y_i = 1$, with E and e defined as:

$$E = \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ -1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ -1 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & -1 & 1 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 1 & 1 \end{pmatrix}, \quad e = \begin{pmatrix} 1 \\ 0 \\ 0 \\ 0 \\ 0 \end{pmatrix}$$

<figure><img src="image_6.png" /><figcaption>Figure 4: Two player zero-sum game example. Diamond nodes represent a decision node for the algorithm player and filled circles are for the adversary player. Variables x and y have been added to represent probabilities for possible moves.</figcaption></figure>

In our context of worst-case analysis, observe that the adversary has no interest in playing a randomized strategy: for any strategy for the player algorithm, there exists a deterministic strategy for the adversary which is optimal (see [8]); however writing these equations in such a way allows the constraints to be linear rather than integer.

Remark that the probability of reaching some leaf is exactly the product between the last $x_j$ variable and the $y_i$ variable corresponding to the adversary move sequence. In the previous example, see Figure 4, the probability of reaching the leftmost leaf is exactly $x_2 \cdot y_1$. Given a strategy x and a strategy y for each player, the expected value may be computed through the weighted sum of the pay-off of each leaf where weights are the probability of reaching each leaf. Hence, there exists a matrix C such that for any x and y strategies for both players, the expected value of the game can be written as $x^T C y$.
**Example 3.3.** In the previous example, the matrix C is written as:

$$C = \begin{pmatrix} 0 & 0 & 0 & 0 \\ 2 & -2 & 0 & 0 \\ 0 & 2 & 0 & 0 \\ 0 & 0 & -1 & -4 \\ 0 & 0 & -3 & -1 \\ 0 & 0 & 0 & 0 \\ 0 & -4 & 0 & 0 \\ -2 & 0 & 0 & 0 \\ 0 & 0 & 2 & -1 \\ 0 & 0 & 0 & 2 \end{pmatrix}$$

And the expected value of the game, given two randomized strategies x and y can hence be written as $x^T C y$.

The following optimization problem yields the best worst-case expected pay-off of the game:

$$\min_x \max_y x^T C y$$

such that:

$$Ex = e, \sum_i y_i = 1, x \ge 0, y \ge 0$$

Let x be any strategy for the algorithm. Then, the best response for the adversary can be obtained by solving the problem:

$$\max_y x^T C y$$

such that:

$$\sum_i y_i = 1, y \ge 0$$

As in [12], we dualize this problem into:

$$\min_u u$$

such that:

$$u \begin{pmatrix} 1 \\ \vdots \\ 1 \end{pmatrix} \ge C^T x$$

By strong duality, it has the same optimal value as its dual. So the previous non-linear problem may be written as the following linear program:

$$\min_{u,x} u$$

such that:

$$Ex = e, u \begin{pmatrix} 1 \\ \vdots \\ 1 \end{pmatrix} \ge C^T x, x \ge 0$$

Solving this linear program yields the best randomized algorithm x and its worst-case expected value u, which corresponds to the best worst-case expected pay-off of a randomized algorithm for the game.

Generating this linear program can be done by exploring the game tree through an exhaustive search.
**Example 3.4.** With the previously given matrices, the linear program may be solved with any linear optimization solver. The optimal randomized worst-case found is $u \approx -0.48$, with $x_7$ and $x_9$ being 0 in an optimal solution. The best deterministic algorithm had a worst-case pay-off of 2.

One may observe that the game tree should always begin with an algorithm decision and end with an adversary decision. If the game tree starts with an adversary decision, then the adversary always pick the best subtree for itself. Similarly, if the last move is an algorithm move, then the algorithm always pick the best move for itself.

# 4 Bounds on randomized algorithms for online bin stretching

## 4.1 Lower bounds with the linear programming method

The linear programming technique exposed in Section 3 was applied successfully to the online bin stretching problem. This allowed the construction of the following bounds:

**Theorem 4.1.** For $m = 2$ bins, there is a lower bound on the competitive ratio of randomized algorithm of $\frac{7}{6} \approx 1.1667$. For $m = 3$, there is a lower bound of $\frac{19}{16} = 1.1875$, and for $m = 4$, of $\frac{11}{9} \approx 1.2222$.

*Remark.* The lower bound of $\frac{7}{6}$ was already known from [6], but was found through a different kind of analysis.

As explained in Section 3, the linear programming method requires the game to be finite. To do so, we restrict the adversary to items of the form $x/g$ with $x \in \{1, \dots, g\}$ with $g$ some integer fixed in advance. A move of the adversary corresponds to choosing one item to send, and a move of the algorithm corresponds to choosing a bin into which the given item should be placed. Since the adversary is restricted in its choice of items, finding the optimal algorithm of that game with the linear program yields a lower bound on the performance of randomized algorithms.

Constructing the linear program may be done in a straightforward manner, i.e., by exploring the whole game tree. The implementation of our code may be found online$^3$, which also contains a visual representation of a game tree for online bin stretching alongside the associated weights.

Our linear program depends on some parameter $g \in \mathbb{N}$, such that the adversary is restricted to items of the form $\frac{x}{g}$ with $x \in \{1, \dots, g\}$. As such, increasing $g$ makes the adversary player stronger, and may result in better bounds at the cost of having a bigger game tree. A natural question is then: do the lower bounds parametrized by $g$ converge towards the optimal performance of a randomized online algorithm? It may be the case that they do not - we give in Section 4.4 examples of games where such a convergence is not possible in a broader setting. However, the convergence holds for the online bin stretching problem:

**Theorem 4.2.** *The method to construct lower bounds on randomized algorithms does converge for the online bin stretching problem.*

The proof is available in Appendix B.

## 4.2 Finding randomized algorithms through computational searches

So far, our method managed to bound the performance of randomized algorithms - however, as yet, no randomized algorithms that outperform deterministic algorithms for the online bin stretching problem are known. Is there a randomized algorithm for the online bin stretching problem that performs strictly better than any deterministic one?

To answer this, we consider a subset of randomized algorithms which consists of *mixed* algorithms that are comprised of only two deterministic algorithms. This class will be henceforth written as $\mathcal{M}_2$. An algorithm of this class, before receiving an input sequence, selects one of its two deterministic algorithms according to some probability and then takes the same decisions as the chosen deterministic algorithm for the whole sequence.

In [10], a computational method was proposed to construct online deterministic algorithms through a min-max search in a game tree; we propose an adaptation of that method to construct randomized algorithms from the class $\mathcal{M}_2$. When only two bins are available, the best competitive ratio for deterministic algorithms is exactly $\frac{4}{3}$; our aim is

<footnote>$^3$https://gricad gitlab.univ-grenoble-alpes.fr/lhommea/computational-proofs-on-randomized-algorithms-for-online-bin-stretchin</footnote>
to find a pair of deterministic algorithms $A_1$ and $A_2$ together with a probability $p$ so that regardless of the instance $I$, $p(f(I, A_1(I)) + (1-p)(f(I, A_2(I))) < \frac{4}{3}$.

[10] models the problem of finding deterministic algorithms for the online bin stretching problem as a finite two player game; in that game, the adversary player sends items and the algorithm places the items into bins, but the items sizes are only known within some interval. The model depends once again on a discretization setting; the higher it is, the smaller the item intervals are. Finding a strategy for the algorithm player in this game does yield a valid online bin stretching algorithm. The game tree is illustrated in Figure 5 - for the sake of clarity, the details of that method are omitted here: the actual game tree is slightly more complex<fnref n="4" />.

We propose to modify that game so that the algorithm plays two moves (not necessarily distinct) in parallel, which corresponds to having two deterministic algorithms at once (illustrated in Figure 6). Each game state holds the bin loads of both algorithms. Then, the pay-off function at a leaf node is the weighted sum of the pay-off of both algorithms at that leaf node, according to some probability $p$ fixed beforehand of choosing either algorithm.

<figure><img src="image_7.png" /><figcaption>Figure 5: Illustration of the game tree for constructing upper bounds in the deterministic case. In parentheses, the load of each bin. Circle nodes correspond to game states where the algorithm has to take a decision.</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>Figure 6: Illustration of the game tree where two algorithms play in parallel. The pay-off at a leaf is the weighted sum according to $p$ of the highest bin loads of each algorithm.</figcaption></figure>

This idea, however, is fairly inefficient as we are essentially iterating over all possible pairs of deterministic algorithms - and the probability $p$ needs to be chosen. We propose two improvements to speed up the method and reach higher discretization settings in order to obtain better algorithms:

1. When $p = \frac{1}{2}$, both algorithms may not be distinguished. To reduce the number of possible game states, one may hence always order the loads of the bins of the first algorithm to be greater lexicographically than the loads of the bins of the second algorithm.

<footnote n="4">⁴Since item classes and bin loads represent intervals, adding an item into some bin may result in a wider interval - the idea is to keep the interval size constant and to branch on the possible resulting intervals. The game tree is actually wider than what is shown in Figure 5 and Figure 6. The technique is explained in details in [10].</footnote>
2. In [9], a propagation technique was presented that allows a strong pruning of the game states for the deterministic, lower bound case. The idea is to consider partial information (only bin loads) of a game state to quickly check if the algorithm player is certain to win from that game state. This may be adapted straightforwardly to the upper bound game, and to our method where two algorithms play at once, by considering the 2m-uplet of bin loads as the partial information.

Moreover, classical optimization techniques for min-max searches may be used in conjunction to these, such as hash tables to keep visited nodes in memory and a dynamic program to quickly compute which items may be sent at any configuration (which is a NP-complete problem, see [9] for more technical details on the dynamic program).

The implementation of that search leads to the following result:

**Theorem 4.3.** There is a $\frac{5}{4}$-competitive randomized algorithm for the online bin stretching problem with 2 bins, which is better than the optimal deterministic algorithm (which is $\frac{4}{3}$-competitive).

This result was obtained on with discretization 18, i.e., when considering only item sizes of the form $\frac{x}{18}$ with x integer, with roughly 35 seconds of computation time on a machine with Intel Core i5-1135G7 and 15 GB of RAM.

## 4.3 Lower bounds on the performance of the $M_2$ class

So far, we have a method to construct lower bounds and a method for upper bounds, but a significant gap still exists even for the seemingly simple case $m = 2$: the best algorithm in the deterministic case has competitive ratio $4/3 \approx 1.334$, the best randomized known has competitive ratio 1.25 but the best lower bound known on randomized algorithm is only $7/6 \approx 1.1667$.

The same idea of having two algorithm players play in parallel may be applied to do the same for lower bounds; in other words, we aim to compute lower bounds on the performance of randomized algorithms from the class $M_2$ that are distributions over 2 deterministic algorithms.

An idea could be to fix some probability $p \in (0, 1)$ corresponding to the probability of selecting the first deterministic algorithm of the pair, and then do a search while all algorithms play simultaneously, with the score of a leaf being defined as the weighted sum of the score of each algorithm. However, doing so results in a lower bound proof only for **one single** probability $p \in (0, 1)$. To bridge this gap, one may observe that if the pay-off function of the online problem is bounded, then a slightly weaker proof is valid for a neighborhood of $p$. For online bin stretching, the pay-off function is bounded since it corresponds to the load of the fullest bin; as the item sequence is guaranteed to fit inside $m$ bins of unit size, the load of the fullest bin is at most $m$ (putting all items into the same bin). This is formalized through the following property.

**Property 4.4.** Let $p \in (0, 1)$ and $v \ge 0$ such that:

$$ \forall (A_1, A_2) \in (A_{det})^2, \forall I \in \mathcal{I}, \quad p \cdot f(I, A_1(I)) + (1-p) \cdot f(I, A_2(I)) \ge v $$

Then:

$$ \forall p' \in (0, 1), \forall (A_1, A_2) \in (A_{det})^2, \forall I \in \mathcal{I}, \quad p' \cdot f(I, A_1(I)) + (1-p') \cdot f(I, A_2(I)) \ge (v - |p - p'| \cdot m) $$

**Proof.** The term $p \cdot f(I, A_1(I)) + (1-p) \cdot f(I, A_2(I))$ is linear in $p$ and its derivative is at most $|f| \le m$. $\square$

<figure><img src="image_9.png" /></figure>

In other words, when finding a lower bound $v$ for some probability $p$, one also has lower bounds of values close to $v$ for a probability in the neighborhood of $p$. This property leads to the following scheme to derive lower bounds on the performance of randomized algorithms that are a probability distribution over two deterministic algorithms, which corresponds to finding lower bounds for several probabilities $p$ and then using the above property to have a general lower bound on **any** probability.

Suppose that we have a minmax search function which takes as input some probability $p$ and some target lower bound to be proved, and that returns true if the lower bound was proved on any algorithm from $M_2$ with probability $p$. Then Algorithm 1 presents how one may construct a lower bound on the performance of any algorithm from $M_2$. Note that we only need to consider $p$ within $(0, \frac{1}{2})$, as if $p$ is greater than $\frac{1}{2}$ then $1-p$ is smaller than $\frac{1}{2}$ and plays the same role.

The application of this scheme to our problem yields the following result:
**Algorithm 1:** A scheme to construct lower bounds on the performance of algorithms from the class $\mathcal{M}_2$

**Input:** Discretization $g \in \mathbb{N}$, number of min-max searches $N \in \mathbb{N}$, $t \ge 0$ the lower bound to be proved

**Output:** True if the given lower bound is proved, False otherwise

1. $\delta \leftarrow \frac{1}{4N}$ // The distance between two tested probabilities will be $2\delta$
2. **for** $i = 0, \dots, N-1$ **do**
3. &nbsp;&nbsp;&nbsp;&nbsp;`p ← $\delta + 2 * \delta * i$`
4. &nbsp;&nbsp;&nbsp;&nbsp;**if** $\minmax(g, t+m\delta, p) == \text{False}$ **then**
5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`// The min-max function is called here with a slightly stronger bound, t+m\delta, than the one we aim to prove, and returns true if that bound was proved when the probability of any algorithm from $\mathcal{M}_2$ is fixed to p`
6. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**return** `False`
7. &nbsp;&nbsp;&nbsp;&nbsp;**end if**
8. **end for**
9. **return** `True`

<figure><img src="image_10.png" /><figcaption>Figure 7: Illustration of the methods to construct lower bounds on the class $\mathcal{M}_2$. Finding the lower bounds for a fixed $p$ (squares) implies weaker bounds on a neighborhood.</figcaption></figure>
<figure><img src="image_11.png" /><figcaption>Figure 8: Bounds for online bin stretching when $m=2$ bins are available.</figcaption></figure>

**Theorem 4.5.** No randomized algorithm from $\mathcal{M}_2$ has a competitive ratio smaller than $29/24 \approx 1,208$ for the online bin stretching when 2 bins are available.

This result directly bounds the performance of the upper bound method to construct randomized algorithm, which yielded an algorithm with competitive ratio 1.25 when two bins are available.

Figure 8 presents our results for online bin stretching when two bins are available. Once again, our code is available online here$^5$.

## 4.4 A theoretical limit of the computational approach

One may define, for any $k \in \mathbb{N}$, the class $\mathcal{M}_k$ of mixed algorithms consisting of $k$ deterministic algorithms. However, doing so may not necessarily improve algorithms: the following gives two zero-sum two-player game, where one player, the algorithm, aims to minimize the pay-off and the other player, the adversary aims to maximize the pay-off. In these games, the algorithm player has a deterministic worst-case of 1 and a randomized worst-case expected pay-off of 0; however if the algorithm uses a mixed strategy that is a distribution on a countable set of deterministic strategies, then the worst-case expected pay-off becomes 1. This shows that it may not be possible to approach a 'good' randomized algorithm through a distribution on a growing finite number of deterministic algorithms.

**First game example:** Two players each pick a positive real number, respectively denoted $x$ and $y$ for the algorithm and the adversary. The pay-off function of the game is then defined as:

$$f(x,y) = \begin{cases} \frac{1}{\sqrt{|x-y|}} & \text{if } x \neq y \\ 0 & \text{otherwise} \end{cases}$$

The algorithm aims to minimize $f$ while the adversary tries to maximize it. The game may be interpreted as both players picking a number, with the adversary trying to guess the number chosen by the algorithm as closely as possible. That game does not have a bounded worst-case pay-off, as the adversary may pick $y$ close to $x$ to reach an arbitrarily high value, so any deterministic strategy for the algorithm has a worst-case of $+\infty$. Similarly, if the algorithm strategy is randomized over a countable set of deterministic strategies, the adversary may choose $y$ close to some possible output $x$ of the algorithm randomized strategy to reach an arbitrarily high expected pay-off, so the worst-case expected pay-off of any randomized strategy defined as a probability over a countable set of deterministic strategies has a worst-case expected pay-off of $+\infty$. However, the randomized strategy $A$ that follows the distribution $p(x) = e^{-x}$ has bounded worst-case expected pay-off:

$$\forall y \in \mathbb{R}, \mathbb{E}(f(A,y)) = \int_{x \in \mathbb{R}} p(x)f(x,y) dx \leq 2\sqrt{\pi}$$

<footnote>$^5$https://gricad gitlab.univ-grenoble-alpes.fr/lhommea/computational-proofs-on-randomized-algorithms-for-online-bin-stretching</footnote>
This example, however, makes use of an unbounded pay-off function. It is hence natural to ask if a bounded pay-off function is sufficient to ensure that any randomized strategy may be approached by mixed strategies using countable deterministic strategies. However, the following example shows that this is not the case.

**Second game example:** Both players play simultaneously then both moves are revealed, and the pay-off is given by a pay-off function $f$ defined below. Let $D = \{0, 1, ..., 9\}$ be the set of digits. A move of any player is picking some infinite sequence of digits. One may see a move as a real number between 0 and 1. Let $M = D^N$ denote the set of moves. The adversary aims, once again, to guess the move of the algorithm. However, the adversary is here able to guess a countable set of moves: if the algorithm chosen number is within that sequence, then the adversary wins. This is formalized as follows:

Define $b: M^N \to M$ to be some bijection between the set of sequences of moves and the set of moves. Such a bijection exists because $\mathbb{R}$ and $\mathbb{R}^N$ have the same cardinality.

The pay-off resulting from move $x = (x_1, x_2, ... ) \in M$ by player 1 and move $y = (y_1, y_2, ... ) \in M$ of player 2 is defined as:

$$f(x, y) = \begin{cases} 1 & \text{if } \exists(z^1, z^2, ..., ) \in M^N, \exists k \in \mathbb{N} \\ & \text{such that } b(z^1, z^2, ..., z^k, x, z^{k+1}, z^{k+2}, ...) = y \\ 0 & \text{otherwise} \end{cases}$$

The bijection $b$ allows the adversary to guess a countable set of moves. If the guess is successful, i.e., if the move from the algorithm is within the guessed sequence from the adversary, then the adversary wins (pay-off of 1), otherwise the algorithm wins (pay-off of 0).

If player 1 has a mixed strategy that is a distribution on a countable set of deterministic strategies $(x^1, x^2, ... ) \in M^N$, then there is a move $y$ for player 2 such that the expected pay-off is 1: fix $y = b(x^1, x^2, ... )$. Then:

$$\forall i \in \mathbb{N}, f(x^i, y) = 1$$

Thus, the expected pay-off is 1.

Let us show that player 1 has a randomized strategy that has an expected pay-off of 0 regardless of the strategy of player 2. If player 1 picks each digit in his sequence randomly, then:

$$\forall y \in M, E_x(f(x, y)) \leq \sum_{k \in \mathbb{N}} P_k$$

with:

$$P_k = \mathbb{P}(\exists(z^1, z^2, ..., ) \in M^N, | b(z^1, z^2, ..., z^k, x, z^{k+1}, z^{k+2}, ...) = y)$$

However:

$$P_k = 0$$

Hence, the expected pay-off is 0.

These examples show that, in a general setting, it may not be possible to approximate a randomized strategy by considering mixed strategies using countable deterministic strategies. This may be a limit to the power of computational methods.

# 5 Conclusion and perspectives

The competitive analysis framework to study online algorithms is often pointed out for its flaws. Workarounds exist, such as randomized algorithms; however this paradigm is more complex than deterministic algorithms - thus this paper proposes methods for a computational approach to perform competitive analysis on randomized algorithms. First, a method derived from game theory is proposed to compute the best randomized online algorithm in a finite setting via linear programming. This method was then used with success on the online bin stretching problem to construct lower bounds on the performance of randomized algorithms. Moreover, the adaptation of a computational method to construct upper bounds in the deterministic case yields a new randomized algorithm for online bin stretching that outperform the best known one in the simple case where 2 bins are available. Besides, we also propose an algorithm to give lower bounds on a simple class of randomized algorithms.
These results show that the paradigm of considering randomized algorithms may be studied through computational tools. Several questions arise next: is it possible to find an efficient pruning of the game tree for the linear programming method? Can a more efficient method be found to compute online randomized algorithms? Could computational methods be extended to other related online problems, such as online scheduling problems, or even to other online optimization paradigms, such as online algorithms with predictions?

## A On the definition of randomized online algorithms

As stated in Section 2.1, two types of strategies are prevalent in game theory: mixed strategies and behavioral strategies. A mixed strategy, before the start of the game, selects a deterministic strategy according to some probability distribution, and then applies the chosen deterministic strategy for the whole game. A behavioral strategy of a player contains the probability distribution of selecting a move for each possible game state where that player has to make a move. Both types of strategies have been shown to be equivalent in [8] when the game is finite and players have perfect recall, i.e., remember their past moves.

However, if the game has an infinite number of moves and if players have a continuity of decisions available to them, the definition itself of a mixed strategy is not so clear. For example, given two deterministic strategies $A_1$ and $A_2$, the mixed strategy that picks $A_1$ with probability $\frac{1}{2}$ and $A_2$ otherwise is well-defined. But in an infinite game, there may be an infinite number of deterministic strategies; the set of deterministic strategies may not even be countable. To define a distribution on this space may not be easy, as this requires one to be able to measure the space of deterministic strategies. Some works such as [4] or [11] consider randomized strategies to be a distribution over the space of deterministic strategies, which, as pointed out in [2], leads to several complications. Indeed, the space of deterministic strategies may be fairly complex; constructing a measure on that space may not even be possible. To circumvent this difficulty, [2] proposes new definitions for mixed and behavioral strategies and then shows that both types of strategies are equivalent. Since both are equivalent, this paper only makes use of the behavioral strategy definition from [2]:

**Definition A.1 (Behavioral strategy).** A behavioral strategy $b$ for some player is a sequence of measurable transformations $b_1, b_2, \dots$ such that $b_i: X_i \times \Omega_i \to Y_i$, where $X_i$ is the input space prior to the $i$-th move, $\Omega_i$ is a sample space and $Y_i$ is the set of decisions that may be taken. Given some input $x \in X_i$, the function $b_i(x, \cdot)$ corresponds to the random variable associated with the action taken at move $i$ when the input is $x$. The functions $(b_i)_{i \in \mathbb{N}}$ must be measurable transformations, i.e., $\forall B_i \subseteq Y_i$, $B_i$ measurable then $b_i^{-1}(B_i)$ must be measurable. This condition is to ensure that if all players have a randomized strategy then the expected pay-off of the game may be computed.

## B Proof of convergence of the linear program for online bin stretching

The lower bounds method for randomized algorithms in the online bin stretching case does depend on some discretization (or granularity) parameter. This section aims to prove that the lower bounds obtained by the aforementioned method do converge towards the optimal competitive ratio of randomized algorithm.

**Theorem B.1.** *The method to construct lower bounds on randomized algorithms does converge for the online bin stretching problem.*

**Remark:** The statement of the theorem might be slightly misleading, in that we do not show that the sequence of lower bounds does converge towards the optimal value when the discretization increases, but rather we show that this sequence has a subsequence that converges towards the optimal value.

**Notations for the proof:**

* $\mathcal{I}$ represents the set of finite item sequences that fit into $m$ bins of unit size.

* $\mathcal{I}_g$ is the set of finite item sequences that fit into $m$ bins of unit size where all item sizes are of the form $\frac{x}{g}$ with $x$ integer.

* $\mathcal{A}$ is the set of randomized algorithms. We use the definition given in Appendix A for a randomized algorithm.
• $\mathcal{D} = \{d_1, \dots, d_m\}$ corresponds to the set of decisions of the algorithm: $d_i$ is the decision to place an item in the $i$-th bin.

• $f$ is the pay-off function. It takes as input a finite sequence of items and a finite sequence of decisions with the same length, and outputs the load of the fullest bin after placing the items in the corresponding bins.

• $\mu: \mathcal{P}(\Omega) \to \mathbb{R}_{\ge 0}$ is the measure function on the sample space $\Omega$. We consider that all sample spaces are copies of the interval $[0, 1]$.

• A randomized online algorithm $A$ is a sequence of measurable functions $A_1, A_2, \dots$ such that the function $A_i: X_i \times \Omega_i \to \mathcal{D}$ represents the decision process for the $i$-th move of the algorithm; the set $X_i$ to the information space of the algorithm prior to taking the $i$-th decision. An element from this set corresponds to the input of the algorithm before taking the $i$-th decision, i.e., the sequence of objects received and decisions taken so far alongside a new item to be placed. An element from $X_i$ is hence written as $(I, D)$ where $I \in \mathcal{I}$, $|I| = i$ and $D \in \mathcal{D}^{i-1}$. For a given input $x = (I, D) \in X_i$, the function:

$$ \Omega_i \to \mathcal{D} \\ \omega \mapsto A_i(x, \omega) $$

corresponds to the random variable of the decision taken. For a given input $x \in X_i$ and a decision $d \in \mathcal{D}$, the probability of taking the decision $d$ at step $i$ is hence:

$$ \mathbb{P}_{\omega \in \Omega_i}(A_i(x, \omega) = d) = \mu(A_i(x, \cdot)^{-1}(d)) $$

**Proof idea:** Solving the linear program for some discretization $g$ yields a vector $x$ representing an algorithm strategy for a game where item sizes are restricted to fractions of the form $\frac{n}{g}$, with $n$ integer. The idea of the proof is to construct a randomized algorithm $A^{\infty, \varepsilon}$ from the algorithms obtained with the linear program method, such that this constructed algorithm may process any item sequence from $\cup_{k \in \mathbb{N}} \mathcal{I}_{2k}$ and does not perform worse (up to $\varepsilon$) than the highest lower bound obtained through the method.

That algorithm is not yet a true online bin stretching algorithm, as it only deals with items of a form $\frac{x}{2^k}$ with $x$ and $k$ integers; however, we show that we may "extend" the algorithm into $A^{\infty, \varepsilon, \delta}$ in order to process any item sequence from $\mathcal{I}$ without changing the competitive ratio up to an arbitrarily small constant $\delta$. In other words, we construct an algorithm that has performance arbitrarily close to the best lower bound found through our method; since the performance of any algorithm is also an upper bound on the optimal performance of an algorithm, this implies the convergence of the method.

Before starting the proof, the following definition is proposed:

**Definition B.1 (Sublimit).** Define the sublimit of a sequence as the set of all limits of convergent subsequences of this sequence. Formally, if $(u_n)_{n \in \mathbb{N}}$ is a sequence, then:

$$ \text{sublim} u_n = \{ \lim_{n \to +\infty} v_n \text{ such that } (v_n)_{n \in \mathbb{N}} \text{ is a convergent subsequence of } (u_n)_{n \in \mathbb{N}} \} $$

If a sequence takes values in a compact set, then Bolzano-Weierstrass Theorem ensures that its sublimit is non-empty.

*Proof.* Denote by $v_g^*$ the lower bound obtained by the method when the discretization is $g$ and denote by $A^g$ the corresponding randomized algorithm. Define $v^*$ to be the optimal competitive ratio of a randomized algorithm:

$$ v^* = \inf_{A \in \mathcal{A}} \sup_{I \in \mathcal{I}} \mathbb{E}(f(I, A(I))) $$

We will show that:

$$ \lim_{k \to +\infty} v_{2k}^* = v^* $$

This proof only consider powers of 2 as discretization, to ensure that $\mathcal{I}_{2k} \subseteq \mathcal{I}_{2k+1}$, i.e., that the adversary has an increasing set of possible moves; this implies that the sequence $(v_{2k}^*)$ is increasing (as the adversary is more and more powerful) and converging, since the sequence is bounded by the performance of any randomized algorithm.

The proof is done in three steps:
1. Construct $A^{\infty, \varepsilon}$, an online algorithm that may only process item sequences from $\bigcup_{k \in \mathbb{N}} \mathcal{I}_{2k}$

2. Prove that $A^{\infty, \varepsilon}$ has a competitive ratio of at most $\lim_{k \to +\infty} v_{2k}^* + \varepsilon$

3. Construct $A^{\infty, \varepsilon, \delta}$ an online algorithm that has competitive ratio at most $v_{2k}^* + \varepsilon + \delta$

### 1. Construction of $A^{\infty, \varepsilon}$:

Let $\varepsilon > 0$. We construct $A^{\infty, \varepsilon} = (A_1^{\infty, \varepsilon}, A_2^{\infty, \varepsilon}, \dots)$ an online algorithm that may process any item sequence from $\bigcup_{k \in \mathbb{N}} \mathcal{I}_{2k}$, such that the algorithm is $\lim_{k \to +\infty} v_{2k}^* + \varepsilon$ competitive. By definition of behavioral algorithms given in Appendix A, an online algorithm must be some sequence of measurable transformations: functions $A_i^{\infty, \varepsilon}$ are defined on $X_i \times \Omega_i$ and map to $\mathcal{D}$, where $\Omega_i$ is a sample space, $X_i$ is the input space of the algorithm at step $i$, i.e., the item sequence given so far and the $i-1$ decisions taken so far.

Functions $A_i^{\infty, \varepsilon}$, as well as sets $G(I)$ for any input sequence $I$ of length $i$ are constructed inductively on $i$. Define first $G(\emptyset) = \mathbb{N}$, with $\emptyset$ denoting here the empty item sequence, and define as well $\Delta_i = \frac{\varepsilon}{m^{i-2}}$.

Let $i \in \mathbb{N}^*$. We aim to construct $A_i^{\infty, \varepsilon}$. First, let us observe that the set of sequences of decisions of length $i-1$ is finite; as such it is possible to give an ordering $D_1, \dots, D_{m^{i-1}}$ of $\mathcal{D}^{i-1}$.

Let $p_{i,D,d}^j(I)$ be the probability for algorithm $A^j$ to select move $d \in \mathcal{D}$ when the sequence of items received is $I \in \bigcup_k \mathcal{I}_{2k}$ (with $I$ of length $i$) and the sequence of decisions taken so far is $D \in \mathcal{D}^{i-1}$. Formally:

$$p_{i,D,d}^j(I) = \mathbb{P}_{\omega \in \Omega_i} (A_i^j(I,D), \omega) = d)$$

Remark that such a probability is not necessarily well-defined for any $j \in \mathbb{N}$: the algorithm $A^j$ may only deal with items of the form $\frac{x}{j}$ with $x$ integer.

Define then $P_i^j(I)$ to be the $m^i$-uplet containing all $p_{i,k,d}^j(I)$ for $d \in \mathcal{D}$ and $k \in \{1, \dots, m^{i-1}\}$:

$$P_i^j(I) = (p_{i,D_1,d_1}^j(I), p_{i,D_1,d_2}^j(I), \dots, p_{i,D_1,d_m}^j(I), \\ p_{i,D_2,d_1}^j(I), p_{i,D_2,d_2}^j(I), \dots, p_{i,D_2,d_m}^j(I), \\ \dots \\ p_{i,D_{m^{i-1}},d_1}^j(I), p_{i,D_{m^{i-1}},d_2}^j(I), \dots, p_{i,D_{m^{i-1}},d_m}^j(I))$$

Then, one may observe that the $m^i$-uplet $P_i^j(I)$ is in the space $H_i$:

$$P_i^j(I) \in H_i = \left\{ (x_s) \in \mathbb{R}^{m^i} \mid \begin{array}{l} \forall s \in \{1, \dots, m^i\} \ x_s \in (0, 1) \\ \forall k \in \{0, \dots, m^{i-1} - 1\}, \ \sum_{l=1}^{m} x_{mk+l} = 1 \end{array} \right\}$$

$H_i$ is compact; as such, Bolzano-Weierstrass Theorem ensures that any sequence from this set, and in particular the sequence $(P_i^j(I))_{j \in \mathbb{N}}$, has a subsequence that converges within $H_i$. The idea of our construction is to pick such a limit for the probabilities of the algorithm $A^{\infty, \varepsilon}$. Since several limits may exist we need to have a procedure to select one. This may be done either immediately with the axiom of choice, or by remarking that the sublimit (the set of limits of convergent subsequences) is itself compact: since $H_i$ is compact, hence bounded, the sublimit of $(P_i^j(I))_{j \in \mathbb{N}}$ is clearly bounded; moreover, the sublimit is closed, since a converging sequence of limits is also a limit. A way to pick a singular element from a finite dimensional compact set is to order it with respect to some lexical ordering, and to select the minimum. The minimum always belongs to the compact.

Define:

$$P_i^{\infty, \varepsilon}(I) = \min_{\leq lex} \text{sublim} \ P_i^j(I)$$
In the above equation, $\leq_{lex}$ denotes any fixed lexical ordering on $\mathbb{R}^{m^i}$, and $I|_{1,...,i-1}$ corresponds to the first $i-1$ items received.

Define also $p_{i,D,d}^{\infty,\epsilon}$ the corresponding value from the $m^i$-uplet $P_i^{\infty,\epsilon}(I)$ for a given $D \in \mathcal{D}^{m^i-1}$ and $d \in \mathcal{D}$.

Let:

$$G(I) = \{j \in G(I|_{1,...,i-1}) \mid \|P_i^{\infty,\epsilon}(I) - P_i^j(I)\|_{\infty} \leq \Delta_i\}$$

The set $G(I)$ corresponds to indices of algorithms $A^g$ that are close from the algorithm $A^{\infty,\epsilon}$ constructed so far; close means that the probability for taking some decision at step $i$ is distant by at most $\Delta_i$. By definition of the sublimit, $G(I)$ is always infinite.

Finally, the function $A_i^{\infty,\epsilon}$ may be defined as follows:

$$A_i^{\infty,\epsilon}((I,D), \omega) = d_l \text{ where } l \text{ is such that } \omega \in \left[ \sum_{s=1}^{l-1} p_{i,D,d_s}^{\infty,\epsilon}(I), \sum_{s=1}^{l} p_{i,D,d_s}^{\infty,\epsilon}(I) \right]$$

In other words, the probability for the algorithm $A^{\infty,\epsilon}$ to select decision $d$ at move $i$ given input $(I,D)$ is exactly $p_{i,D,d}^{\infty,\epsilon}$.

Remember that so far, we only defined $A^{\infty,\epsilon}$ on item sequences from $\cup_{k \in \mathbb{N}} I_{2k}$ which is a countable set (since each $I_{2k}$ is finite); as such we can show that $A_i^{\infty,\epsilon}$ is a measurable function:

$$\forall d \in \mathcal{D}, (A_i^{\infty,\epsilon})^{-1}(d) = \bigcup_{\substack{I \in \cup_{k \in \mathbb{N}} \mathcal{I}_{2k} \\ |I| = i}} \bigcup_{D \in \mathcal{D}^{i-1}} \underbrace{((I,D), (A_i^{\infty,\epsilon}((I,D), \cdot))^{-1}(d))}_{\text{segment by construction}} \\ \underbrace{\text{Countable union}}$$

**2. Proof that $A^{\infty,\epsilon}$ has competitive ratio at most $\lim_k v_{2k}^* + \epsilon$:**

Let $I \in \cup_{k \in \mathbb{N}} \mathcal{I}_{2k}$. We will show that the expected score (load of the fullest bin) of the algorithm $A^{\infty,\epsilon}$ when receiving the item sequence $I$ is close from the expected score of the algorithm $A^j$ on $I$ for any $j \in G(I)$.

By construction, given some input $x \in X_i$, the probability of choosing some move $d$ at step $i$ for the algorithm $A^{\infty,\epsilon}$ is close from the probability of choosing the same move with the same input $x$ of any algorithm from $G(I)$:

$$\forall x \in X_i, \forall d \in \mathcal{D}, \quad \|\mathbb{P}_{\omega \in \Omega_i}(A_i^{\infty,\epsilon}(x, \omega) = d) - \mathbb{P}_{\omega \in \Omega_i}(A_i^j(x, \omega) = d)\|_{\infty} \leq \Delta_i$$

Let $I \in \cup_{k \in \mathbb{N}} \mathcal{I}_{2k}$ with $|I| = s$. Let $A^{\infty,\epsilon}(I)$ be the random variable corresponding to the output of the algorithm when receiving input $I$, which takes values in $\mathcal{D}^s$. The expected score of $A^{\infty,\epsilon}$ on $I$ may be written as:

$$\begin{aligned} \mathbb{E}(f(I, A^{\infty, \epsilon}(I))) &= \sum_{D \in \mathcal{D}^s} \mathbb{P}(A^{\infty, \epsilon}(I) = D) f(I, D) \\ &= \sum_{D \in \mathcal{D}^s} \prod_{i=1}^{s} \underbrace{p_{i, D|_{1,...,i-1}, D_i}^{\infty, \epsilon}(I)}_{\text{probability for algorithm } A^{\infty, \epsilon} \\ &\qquad \text{to select decision } D_i \text{ if the previous decisions taken are } D|_{1,...,i-1}} f(I, D) \end{aligned}$$

The probabilities taken by the algorithm $A^{\infty,\epsilon}$ are close to the probabilities taken by algorithm $A^j$, thus we write:

$$p_{i,D|_{1,...,i-1},D_i}^{\infty,\epsilon}(I) = p_{i,D|_{1,...,i-1},D_i}^{j}(I) + \delta_{i,D|_{1,...,i-1},D_i}^{j}(I)$$

$$\text{with } |\delta_{i,D|_{1,...,i-1},D_i}^{j}(I)| \leq \Delta_i$$

Then:

$$\mathbb{E}(f(I, A^{\infty, \epsilon}(I))) = \sum_{d^1 \in \mathcal{D}} (p_{1,\emptyset,d^1}^{j}(I) + \delta_{i,\emptyset,d^1}^{j}(I)) \sum_{d^2 \in \mathcal{D}} (p_{2,(d^1),d^2}^{j}(I) + \delta_{2,(d^1),d^2}^{j}(I)) \dots f(I, (d^1, d^2, \dots, d^s))$$
Moreover, without the terms $\delta$, then the expression becomes the expected value of algorithm $A^j$ on $I$:

$$ \mathbb{E}(f(I, A^j(I))) = \sum_{d^1 \in \mathcal{D}} p_{1,0,d^1}^j(I) \sum_{d^2 \in \mathcal{D}} p_{2,(d^1),d^2}^j(I) \dots f(I, (d^1, d^2, \dots, d^s)) $$

Let $D \in \mathcal{D}^s$, and define $e_{s,D}^{\infty, \epsilon}(I) = f(I, D)$. Define then inductively for $0 \le i < s$ and for $D \in \mathcal{D}^i$:

$$ e_{i,D}^{\infty, \epsilon}(I) = \sum_{d^{i+1} \in \mathcal{D}} (p_{i+1,D,d^{i+1}}^{j}(I) + \delta_{i+1,D,d^{i+1}}^{j}(I)) e_{i+1,D \oplus d^{i+1}}^{\infty, \epsilon}(I) $$

where $\oplus$ in the above equation is the concatenation of sequences. The terms $e^{\infty, \epsilon}$ may be seen as a sub-part of the sum to compute the expected value of algorithm $A^{\infty, \epsilon}$:

$$ \mathbb{E}(f(I, A^{\infty, \epsilon}(I))) = \sum_{d^1 \in \mathcal{D}} (p_{1,0,d^1}^j(I) + \delta_{i,0,d^1}^j(I)) \sum_{d^2 \in \mathcal{D}} (p_{2,(d^1),d^2}^j(I) + \delta_{2,(d^1),d^2}^j(I)) \dots \underbrace{f(I, (d^1, d^2, \dots, d^s))}_{\substack{e_{s,(d^1, \dots, d^s)}^{\infty, \epsilon} \\ e_{1,(d^1)}^{\infty, \epsilon} \\ \vdots \\ e_{0,0}^{\infty, \epsilon}}} $$

We define similarly $e_{s,D}^j(I) = f(I, D)$ and inductively for $0 \le i < s$ and for $D \in \mathcal{D}^i$:

$$ e_{i,D}^j(I) = \sum_{d^{i+1} \in \mathcal{D}} p_{i+1,D,d^{i+1}}^j(I) \cdot e_{i+1,D \oplus d^{i+1}}^j(I) $$

Now, we will prove that:

$$ |\mathbb{E}(f(I, A^{\infty, \epsilon}(I))) - \mathbb{E}(f(I, A^j(I)))| = |e_{0,0}^{\infty, \epsilon} - e_{0,0}^j| \le \epsilon $$

To do that, we show the following by backwards induction on $i$:

$$ \forall D \in \mathcal{D}^i, \quad |e_{i,D}^{\infty, \epsilon} - e_{i,D}^j| \le \frac{\epsilon}{2^i} $$

Clearly, the statement is true when $i = s$, as $\forall D \in \mathcal{D}^s$, $e_{s,D}^{\infty, \epsilon} = e_{s,D}^j = f(I, D)$. Suppose that the statement is true for some $0 \le i \le s$, let us show that it holds as well for $i-1$.

$$ \forall D \in \mathcal{D}^{i-1}, \quad |e_{i-1,D}^{\infty, \epsilon} - e_{i-1,D}^j| = \left| \sum_{d^i \in \mathcal{D}} p_{i,D,d^i}^j (e_{i,D \oplus d^i}^{\infty, \epsilon} - e_{i,D \oplus d^i}^j) + \sum_{m \text{ terms}} \delta_{i,D,d^i}^j \cdot e_{i,D \oplus d^i}^{\infty, \epsilon} \right| \le \frac{\epsilon}{2^{i-1}} $$

By induction, we know that $|e_{i,D \oplus d^i}^{\infty, \epsilon} - e_{i,D \oplus d^i}^j|$ is smaller than $\frac{\epsilon}{2^i}$. Moreover, $\sum_{d^i \in \mathcal{D}} p_{i,D,d^i}^j = 1$ since the term $p_{i,D,d^i}^j$ represents a probability. Additionally, $\delta_{i,D \oplus d^i}^j \le \Delta_i = \frac{\epsilon}{2^m}$, and $e_{i,D \oplus d^i}^{\infty, \epsilon}$ is a mean over values of $f$ and is thus smaller than $m$, as $|f| \le m$ (the maximum highest load of a bin is $m$ when all items are put into the same bin). Putting everything together:

$$ \forall D \in \mathcal{D}^{i-1}, \quad |e_{i-1,D}^{\infty, \epsilon} - e_{i-1,D}^j| = \underbrace{\sum_{d^i \in \mathcal{D}} p_{i,D,d^i}}_{\text{sums to 1}} \underbrace{(e_{i,D \oplus d^i}^{\infty, \epsilon} - e_{i,D \oplus d^i}^j)}_{\le \frac{\epsilon}{2^i}} + \sum_{m \text{ terms}} \underbrace{\delta_{i,D,d^i}}_{\le \frac{\epsilon}{2^i m^2}} \cdot \underbrace{e_{i,D \oplus d^i}^{\infty, \epsilon}}_{\le m} \le \frac{\epsilon}{2^{i-1}} $$

Hence:

$$ |\mathbb{E}(f(I, A^{\infty, \epsilon}(I))) - \mathbb{E}(f(I, A^j(I)))| = |e_{0,0}^{\infty, \epsilon} - e_{0,0}^j| \le \epsilon $$

In other words, for any item sequence $I \in \bigcup_{k \in \mathbb{N}} \mathcal{I}_{2k}$ the expected highest load of a bin of algorithm $A^{\infty, \epsilon}$ is at most the expected highest load of a bin of algorithm $A^j$ plus $\epsilon$, with $j \in G(I)$.

### 3. Extension of the algorithm to process any item sequence:
The algorithm $A^{\infty, \epsilon}$ may be extended to be able to process any input item sequence (so far, it has been only defined on item sequences from $\cup_{k \in \mathbb{N}} \mathcal{I}_{2k}$). To do so, let $\delta > 0$; we construct yet another online algorithm, $A^{\infty, \epsilon, \delta}$ which may process any input sequence and has worst-case expected performance close, up to $\delta$, from the performance of algorithm $A^{\infty, \epsilon}$. The idea is to round items to nearby numbers of the form $\frac{x}{2^k}$ which may be processed by the algorithm $A^{\infty, \epsilon}$. This is done through the following function $T$:

$$T^{\delta}: \mathcal{I} \to \bigcup_{k \in \mathbb{N}} \mathcal{I}_{2k}$$

That function is constructed as a sequence of functions (similarly to online algorithms) where the i-th function takes as input only the i-th item in the sequence:

$$T^{\delta}(I) = (T_{1}^{\delta}(I_{1}), T_{2}^{\delta}(I_{2}), \dots)$$

Let $i_0 = \lceil \log_2(\frac{2}{\delta}) \rceil$.

$$T_{i}^{\delta}(y) = \frac{|2^{i_{0}} + i|}{2^{i_{0}} + i}$$

This construction implies:

$$\forall i \in \mathbb{N}^{*}, y - T_{i}^{\delta}(y) \le \frac{\delta}{2^{i}}$$

Hence, $T^{\delta}$ verifies:

$$\|I - T^{\delta}(I)\|_{1} \le \delta$$

Then, define $A^{\infty, \epsilon, \delta}(I) = A^{\infty, \epsilon}(T^{\delta}(I))$: in other words, any received item if first "rounded" down to some item of the form $\frac{x}{2^k}$ for some $x$ and $k$ integers, then the algorithm $A^{\infty, \epsilon}$ is applied. Doing so induces an error of at most $\delta$ (since items are considered smaller than what they really are by the algorithm $A^{\infty, \epsilon}$). Since items are always rounded down, the sequence $T(I)$ is still a valid sequence since it does not violate the constraint of the online bin stretching problem that its offline optimum must be lesser than 1.

The extended algorithm $A^{\infty, \epsilon, \delta}$ is still comprised of measurable transformations, as $(T_i^\delta)^{-1}$ is by construction a finite union of segments. Hence, we have constructed a valid online randomized algorithm, with performance of at most $\epsilon + \lim_{k \to +\infty} v_{2k}^* + \delta$. The performance of any algorithm is an upper bound on the optimal value of the game. Hence:

$$\forall \epsilon > 0, \forall \delta > 0, \lim_{k \to +\infty} v_{2k}^* \le v^* \le \lim_{k \to +\infty} v_{2k}^* + \epsilon + \delta$$

This concludes the proof that the linear programming method converges towards the optimal competitive ratio for the online bin stretching problem. □

## References

[1] Borodin Allan, El-Yaniv Ran, and Allan Borodin. *Online computation and competitive analysis / Allan Borodin, Ran El-Yaniv*. Cambridge University Press, Cambridge, 1998.

[2] Robert J. Aumann. 28. *Mixed and Behavior Strategies in Infinite Extensive Games*, pages 627–650. Princeton University Press, Princeton, 1964.

[3] Yossi Azar and Oded Regev. On-line bin-stretching. *Theoretical Computer Science*, 268(1):17–41, 2001.

[4] S. Ben-David, A. Borodin, R. Karp, G. Tardos, and A. Wigderson. On the power of randomization in on-line algorithms. *Algorithmica*, 11(1):2–14, Jan 1994.

[5] Martin Böhm and Bertrand Simon. Discovering and certifying lower bounds for the online bin stretching problem. *Theoretical Computer Science*, 938:1–15, 2022.
[6] Michael Gabay. *High-multiplicity Scheduling and Packing Problems: Theory and Applications*. Theses, Université de Grenoble, October 2014.

[7] Michaël Gabay, Nadia Brauner, and Vladimir Kotov. Improved lower bounds for the online bin stretching problem. *4OR*, 15(2):183–199, Jun 2017.

[8] H. W. Kuhn. Extensive games and the problem of information. In *Contributions to the theory of games. Volume II*, Annals of Mathematics Studies, pages 245–266. Princeton University Press, Princeton, N. J, 1953.

[9] Antoine Lhomme, Olivier Romane, Nicolas Catusse, and Nadia Brauner. Online bin stretching lower bounds: Improved search of computational proofs, 2022. https://arxiv.org/abs/2207.04931v2.

[10] Matej Lieskovský. Better algorithms for online bin stretching via computer search, 2022. https://arxiv.org/abs/2201.12393.

[11] M.P. Renault and A. Rosén. *Lower and Upper Bounds for Online Algorithms with Advice*. Lille thèses. 2014.

[12] Bernhard von Stengel. Equilibrium computation for two-player games in strategic and extensive form. In *Algorithmic Game Theory*, chapter 3, pages 73–78. Cambridge University Press, 2007.