  Differential equations on metric graphs can describe many phenomena in the
physical world but also the spread of information on social media. To
efficiently compute the solution is a hard task in numerical analysis. Solving
a design problem, where the optimal setup for a desired state is given, is even
more challenging. In this work, we focus on the task of solving an optimization
problem subject to a differential equation on a metric graph with the control
defined on a small set of Dirichlet nodes. We discuss the discretization by
finite elements and provide rigorous error bounds as well as an efficient
preconditioning strategy to deal with the large-scale case. We show in various
examples that the method performs very robustly.
