Optimization of Networks