Monte Carlo integration in discrete undirected probabilistic models