We study in-network computation on general network topologies. Specifically,
we are given the description of a function, and a network with distinct nodes
at which the operands of the function are made available, and a designated sink
where the computed value of the function is to be consumed. We want to compute
the function during the process of moving the data towards the sink. Such
settings have been studied in the literature, but mainly for symmetric
functions, e.g. average, parity etc., which have the specific property that the
output is invariant to permutation of the operands. To the best of our
knowledge, we present the first fully decentralised algorithms for arbitrary
functions, which we model as those functions whose computation schema is
structured as a binary tree. We propose two algorithms, Fixed Random-Compute
and Flexible Random-Compute, for this problem, both of which use simple random
walks on the network as their basic primitive. Assuming a stochastic model for
the generation of streams of data at each source, we provide a lower and an
upper bound on the rate at which Fixed Random-Compute can compute the stream of
associated function values. Note that the lower bound on rate though computed
for our algorithm serves as a general lower bound for the function computation
problem and to the best of our knowledge is first such lower bound for
asymmetric functions. We also provide upper bounds on the average time taken to
compute the function, characterising this time in terms of the fundamental
parameters of the random walk on the network: the hitting time in the case of
Fixed Random-Compute, and the mixing time in the case of Flexible
Random-Compute.