# Factor graph equivalent to Markov networks

Consider the following potential on three nodes.

$$\psi(x_1,x_2,x_3) = f_a(x_1,x_2)f_b(x_2,x_3)f_c(x_1,x_3)$$

represented by the following factor graph:

Now the notes claim that we can represent this factor graph as both a Bayesian network and a Markov networks as follows.

The representation is given here:

I'm failing to see the connection with the extra three nodes $$Z_1,Z_2,Z_3$$? What would the break down into clique potentials of the probability distribution looks like? Since there are only 2-cliques, the theory as I know it suggests that $$p(x_1,x_2,x_3,Z_1,Z_2,Z_3) = \frac 1 Z \psi_1(x_1,Z_1) \psi_2(Z_1,x_2) \psi_3(x_2,Z_2) \psi_4(Z_2,x_3) \psi_5(x_3,Z_3) \psi_6(Z_3,x_1)$$ where $$Z$$ is the normalising constant. However I'm confused as to what $$\psi(Z_1)$$ would represent and how it equals $$f_a(x_1,x_2)$$? Can anyone fill in the missing pieces of the construction?

$$p(x_1, x_2, x_3, z_1, z_2, z_3) = \frac{1}{Z} \psi(x_1,z_1)\psi(z_1,x_2)\psi(z_1) \psi(x_2,z_2)\psi(z_2,x_3)\psi(z_2)\\ \phantom{aaaa}\psi(x_1,z_3)\psi(z_3,x_3)\psi(z_3).$$
As explained in your post and in my linked article, to get the equivalence between this Markov field distribution and the factor graph we need to have that the pairwise cliques are indicator functions and the single variable cliques are equal to the function value (e.g. $$\psi(z_a) = f_a(x_1,x_2)$$).