#Example 1: Generate 100 samples from a Potts model with the
# neighborhood structure corresponding to a
# second-order Markov random field defined on a
# \eqn{3 \times 3} 2D graph. The number of colors is 2.
# \eqn{\beta}=0.1. All weights are equal to 1.
edges <- getEdges(mask=matrix(1, 3, 3), neiStruc=rep(2,4))
SW(n=100, nvertex=9, ncolor=2, edges, beta=0.1)Run the code above in your browser using DataLab