The development of research on social network makes a great contribution to the study of network evolution though much of the work focuses on a macroscopic evolutionary mechanism. In this paper, based on public goods games, an optimized evolutionary dynamic multi-community network model generated by the co-evolution process of evolutionary games and network topology is put forward (dMCPGG). Edges are revised according to the difference between expected payoff and effective payoff through time. Considering the heterogeneous topology, a new preferential rule based on the topological potential is introduced to quantify the nodes’ importance when choosing and updating the payoff of individuals in the public goods games. Finally, the results of simulations demonstrate that the dMCPGG model can reproduce the random world and scale-free world features, such as the nodes’ degree, clustering coefficient and average path length. Finally, we apply our model to United State Congress voting data and verify its rationality.