I try to make an example also run the MAP inference. So I slightly changed the graph construction, it becomes a tree graph, because I fixed x == 0 for vertical edges, i.e. if (x == 0 && y > 0).