  We consider in-network computation of an arbitrary function over an arbitrary
communication network. A network with capacity constraints on the links is
given. Some nodes in the network generate data, e.g., like sensor nodes in a
sensor network. An arbitrary function of this distributed data is to be
obtained at a terminal node. The structure of the function is described by a
given computation schema, which in turn is represented by a directed tree. We
design computing and communicating schemes to obtain the function at the
terminal at the maximum rate. For this, we formulate linear programs to
determine network flows that maximize the computation rate. We then develop
fast combinatorial primal-dual algorithm to obtain $\epsilon$-approximate
solutions to these linear programs. We then briefly describe extensions of our
techniques to the cases of multiple terminals wanting different functions,
multiple computation schemas for a function, computation with a given desired
precision, and to networks with energy constraints at nodes.
