We address the optimal dynamic formation problem in mobile leader-follower networks where an optimal formation is generated to maximize a given objective function while continuously preserving connectivity. We show that in a convex mission space, the connectivity constraints can be satisfied by any feasible solution to a mixed integer nonlinear optimization problem. When the optimal formation objective is to maximize coverage in a mission space cluttered with obstacles, we separate the process into intervals with no obstacles detected and intervals where one or more obstacles are detected. In the latter case, we propose a minimum-effort reconfiguration approach for the formation which still optimizes the objective function while avoiding the obstacles and ensuring connectivity. We include simulation results illustrating this dynamic formation process.