  For general connections, the problem of finding network codes and optimizing
resources for those codes is intrinsically difficult and little is known about
its complexity. Most of the existing solutions rely on very restricted classes
of network codes in terms of the number of flows allowed to be coded together,
and are not entirely distributed. In this paper, we consider a new method for
constructing linear network codes for general connections of continuous flows
to minimize the total cost of edge use based on mixing. We first formulate the
minimumcost network coding design problem. To solve the optimization problem,
we propose two equivalent alternative formulations with discrete mixing and
continuous mixing, respectively, and develop distributed algorithms to solve
them. Our approach allows fairly general coding across flows and guarantees no
greater cost than any solution without network coding.
