Optimizing Networks