  Optimizing embedded systems, where the optimization of one depends on the
state of another, is a formidable computational and algorithmic challenge, that
is ubiquitous in real world systems. We study flow networks, where bilevel
optimization is relevant to traffic planning, network control and design, and
where flows are governed by an optimization requirement subject to the network
parameters. We employ message-passing algorithms in flow networks with sparsely
coupled structures to adapt network parameters that govern the network flows,
in order to optimize a global objective. We demonstrate the effectiveness and
efficiency of the approach on randomly generated graphs.
