In this paper we give an explicit and algorithmic description of Graver basis for the toric ideal associated with a simple undirected graph and apply the basis for testing the beta model of random graphs by Markov chain Monte Carlo method.