  In previous studies of spatial public goods game, each player is able to
establish a group. However, in real life, some players cannot successfully
organize groups for various reasons. In this paper, we propose a mechanism of
reputation-driven group formation, in which groups can only be organized by
players whose reputation reaches or exceeds a threshold. We define a player's
reputation as the frequency of cooperation in the last $T$ time steps. We find
that the highest cooperation level can be obtained when groups are only
established by pure cooperators who always cooperate in the last $T$ time
steps. Effects of the memory length $T$ on cooperation are also studied.
