
Allocation of multiple processors
to lazy boolean function trees
? justification of the magic number 2/3
Alan Dix?
Computer Science Department
University of York, York, YO1 5DD, U.K.
First draft May 1991
Revised April 1992
In simulations of lazy evaluation of boolean formulae, Dunne, Gittings and Leng found that parallel
evaluation by two processors achieved a speedup of 2/3 compared to single processor evaluation.
The reason that this factor was only 2/3 rather than a half was because the function nodes used for the
simulation were all `and' type functions, and hence sometimes the evaluation by the second processor
proved unnecessary. This paper is intended to provide a justification for this `magic number' of 2/3,
by proving that it is exactly the speedup obtained for pure balanced trees. A similar speedup figure
result is obtained for nonbinary balanced trees and an equivalent speedup figure for multiple
processors is also given. Unbalanced trees have worse behaviour and by way of example the speed
up figure for an AVL tree is given (0.6952). Finally, numerical solutions are given for the case of
arbitrary random binary trees. Since this report was first written Dunne et al. have proved
analytically that the 2/3 figure does indeed hold for random trees generated by a reasonable
distribution.
1. Background
This report springs from work by Dunne, Gittings and Leng on the computeraided design of VLSI logic
circuits.1, 2 They are in interested in efficient parallel evaluation strategies for simulation of Boolean
expression trees. Demanddriven lazy evaluation of such trees means that, for instance, at `and' nodes, if
the first evaluated subtree yields `false' the other need not be evaluated. In general, this will mean that
parallel evaluation will not achieve 100% process utilisation. At the Seventh British Colloquium on
Theoretical Computer Science in March 1991, Chris Gittings presented their simulation results which
suggested a speedup figure of 2/3 for two processors on random trees with `and' type nodes.3
This magic number 2/3 arose out of empirical studies of randomly generated trees. Is this speedup factor
for two processors exact? If so is it a feature of the particular random trees chosen, or is it more general?
Further, what is the generalisation to three or more processors? The following report is an attempt to
analytically justify the figure of 2/3 and partially generalise the result. I say `justify' as the report primarily
deals with deterministic rather than random trees. Since this report was originally written Dunne et al. have
produced a more complete analytic treatment of random trees both proving the speedup of 2/3 can be
achieved, on average, for `and' type trees and giving similar figures for formula trees which also include
`xor' type nodes.4
hhhhhhhhhhhhhhhhhh
? work funded by SERC Advanced Fellowship B/89/ITA/220