The definition and the role of cliques in Markov random fields I'm freshing up on machine learning (specifically image analysis) and of course looked into Markov random fields. 
I really cannot wrap my head around the concept of cliques and their application in MRFs. The definition of a clique is, to my knowledge from graph theory, that every vertex in a clique is adjacent to every other vertex. However, I have no idea how this concept of cliques relates to the concept of neighbourhoods in MRFs and the Markov properties. Could someone explain to me the concept / definition / role of cliques in MRFs?
 A: A clique is a complete subgraph. For the role of cliques, because the local conditional probability distribution and topological ordering do not apply to undirected models, we need to express the relations between variables and the clique is the method for us to represent the relations or connections or affinities. I think we can just use unary factors but that would be not as compact depending on the scenarios. 
For instance in this example: 
 
To encourage variables take the same value it is better to make the above three cliques. If we use the unary factor it is very hard to represent the requirement but if we use the cliques above we can make the weights big if the values are the same and very small if values are different. 
And a clique can be just treated as a unary factor and hence its neighbors are just the Markov blanket because the same principle for a single variable also applies to a clique: given the Markov blanket the clique is independent of the rest of the nodes in the graph.  
