Dynamic Sampling from Graphical Models