Optimal Degree Distribution of Scale-Free Networks