This document proposes algorithms to optimize communication quality in robot networks by computing optimal formations of relay vehicles. For a single remote unit, it computes a relay chain using a modified breadth-first search on a layered graph. For multiple units, it computes a minimum-cost relay tree using Steiner tree algorithms. The algorithms run in polynomial time and were tested in simulations and hardware experiments.