In order to solve the contesting among multiple device-to-device (D2D) users reusing the resource of one cellular user in high-density user scenarios, a D2 D resource allocation algorithm on the basis of game theory is proposed.Firstly, a utility function minimizing the system interference is proposed, which considers both the interference among D2 D users and the interference between D2 D users and cellular users.Secondly, a potential function of this game is designed.Then, the potential game nature of utility function as well as the existence of Nash equilibrium is proved.Simulated results show that the proposed algorithm possesses better system level fairness and convergence, improves system throughput, and reduces the interference to D2 D users.