Efficient Bayesian Inference for Dynamically Changing Graphs