The Setting
A mean-payoff game on a graph with vertex set of size and integer edge weights reaches an algorithm as a binary code of length . The randomized algorithm treated here replaces each weight by , lets be the larger of and the largest absolute value of the new weights, and sets . It works on solver inputs : a box with corners in and reference width , positive rational support weights and budgets . Its recursion draws uniform random indices below a power of two and repeats calls in independent trials, whose answers it combines by coordinatewise medians and by majority votes.
The question is its bit complexity: on a machine that reads and a tape of random bits, how many steps can a run take, on the worst input of length and the worst tape? The library writes the algorithm as a register program, a program on a fixed number of registers holding bit strings that reads random bits as it runs, and bounds the steps of the machine compiled from it.
Register Programs and Machines
A configuration of a register program is a pair of a control point of and the contents of its registers; the configuration is halted when the control has stopped. The initial configuration of a register program on an input bit string is the configuration in which starts its run on .
A random tree is a finite binary tree whose inner nodes are fair coin flips and whose leaves carry values. The expectation of a function of the leaves of a random tree averages the two subtrees at every flip, and the depth of is the largest number of flips on a branch. The random computation tree of from a configuration is the random tree that branches on the random bits reads and has at its leaves the configurations reaches from within steps. A random tree traces the run of from when, for every infinite bit sequence and every position in it, following along the bits from that position leads to the configuration that reaches from in as many steps as has read bits.✦
The machine compiled from a register program runs on the input code of a mean-payoff game with a finite random tape. For an input and a number , is the step bound of for steps of on .
The Solver Program
The solver program is a register program on five registers, compiled from a flowchart of twelve nodes. On an input it runs the preprocessing program, which loads and runs the preparation routine; it then draws one fresh fair bit for each unit of the counter the preprocessing leaves, bits in all; it runs the postprocessing program, which applies the postprocessing routine to these bits and writes out the digits of its output; and it stops.
The preparation exponent of is .✦ The preparation routine parses as a game and computes , and the parameters of the recursion: , the binary length of plus ; ; the number of trials ; the step budget of the basic solver, the routine that answers on boxes of width at most ; and the initial support weights at every vertex and budgets . It writes out in unary by repeated doubling and returns the preparation value of : a counter of units and the auxiliary output , made of the chunk length , the sample bound , the number of chunks, the top width and the initial accumulator of the stack machine below.✦
An input of the postprocessing routine is a pair of a bit string and auxiliary data, and the solver applies it to .✦ It cuts into chunks of bits, each read as a binary number below : a chunk sampling state holds the chunk length, the bound , the indices drawn so far and the bits not yet used, and the chunk step reads the next chunk and records its index. It then runs a stack machine, which keeps an environment and a state, one step per index. The answer marks, for each entry of the vector the machine returns, whether exceeds half of .✦
Its environment and state together form its accumulator.✦ The environment holds the arena, the game graph with the weights , and the numbers , , and .✦ The state is a current cell over a stack of pending cells✦; a cell is a tag and a register pack, which holds support weights and budgets, a box, a counter, two vectors, a list of vectors, an orientation and a list of orientations. An orientation is a choice, or , with a list of masks, each marking a set of vertices.✦ A step reads a random index and dispatches on the tag of the current cell: tags to run the jobs solve, ask, trials, update, centers, orient, orientation trials, orientation plus, tighten and reweight, and any other tag hands the current pack back to the pending cell on top of the stack. The initial state calls solve on the initial support weights and budgets and the box .✦
The solve job returns a prescribed vector when the budget is small, and the output of the basic solver when the box has width . Otherwise it tightens the box, orients it, asks once for each mask of the orientation with the budget reweighted by that mask, solves the box capped high, for , or low, for , by , where is the grid width, and caps the result by the coordinatewise minimum, for , or maximum, for , with the answers to these asks. The ask job returns the coordinatewise median, in the box, of trials of solve, which the trials job runs in turn. The tighten job asks with the budget reduced in ; if the answer moves the floor of the box, its lower corner, at the scale , it tightens the box with its floor moved to the answer, and otherwise it asks with the budget reduced in and does the same with the ceiling, its upper corner, returning the box when neither moves.
The orientation plus job returns the majority of orientations from orient, run in turn by the orientation trials job: when more than half of them choose , with all their masks. On a box of width , orient takes the basic solver’s vector and the mask , and returns with the complement of when has measure above one half, the measure of a set of vertices being the one taken with respect to the support weights and budgets, and with otherwise.✦ On a wider box the centers job builds centers , with the midpoint of the box and the update of : the average, clipped to the box, of the answers to two asks on the box of width centered at , the first with the budget reduced in and the second in . If the positive displacement set has measure above one half, orient returns with its complement; else, if the negative displacement set does, it returns with its complement; else it orients the box of width centered at , for the random index of the step, and adds both sets to the masks of the result.
Step Counts
Write for the code size of a datum . The preprocessing cost of an input is , where is the cost of feeding the bits of and the step limit of the preparation routine on .✦ The postprocessing cost of an input of the postprocessing routine is its step limit on , plus the cost of emitting the bits of its output, plus .✦ For natural numbers and , the postprocessing budget of is ✦, and the step limit of is (1)✦
The total of is twice the step bound of the compiled solver program within this limit, (2)✦ and the preparation resource of an input is (3)
The Claim
Theorem 1 (Bit complexity). Let and be natural numbers, and for an input let be its length.
If the postprocessing cost satisfies for every input of the postprocessing routine, then for every input (4)✦ and there is a random tree that traces the run of from , has only halted leaves and depth at most , and gives, for every function from configurations to the rationals, (5)✦ where is the halted configuration whose output is and whose working registers are empty.
For every register program , every mean-payoff game with input code and every , if every leaf of is halted, then for every random tape of bits (6)✦
For every input , with , (7)✦
There is a polynomial with (8)✦ and a polynomial with (9)✦
For every input , (10)✦
If a function from inputs to natural numbers satisfies for a polynomial and every input , there is a natural number with (11)✦ If a function from inputs to natural numbers satisfies (11) for a natural number , there is a real with (12)✦
There is a real with (13)✦
In the paper, the result reads: the algorithm has a uniform implementation in a standard bit-operation model such that, for every input of bit length and every random tape, the running time, including preprocessing, every recursive execution, intermediate arithmetic and random-bit generation, is at most for an absolute constant .
The implementation in the box is the machine compiled from the solver program: when for every , it has halted after steps on the code of a game and every random tape, and the constant of (13) depends on and .
What Is Checked
The claim is stated over the solver program, with its preprocessing, its fair bits and its postprocessing stack machine, and over its step limit , its total and the preparation resource ; its halting parts are stated over random computation trees, the random trees that trace a run and the machine compiled from a register program, under the bound on the postprocessing cost.
Of the loops the solver runs, the library proves two size bounds: from a chunk sampling state , the chunk step run over the first units of a counter gives a state of code size at most ✦, and from an accumulator , the stack machine run over the first indices of a list gives an accumulator of code size at most .✦ A third such bound holds for the coordinatewise maximum or minimum of a vector with a list of vectors , computed as a left fold over the list: for every the fold over the first vectors has code size at most , where is the code size of .