# Graphical Model: MAP optimization vs belief propagation

Assume there are three types (sets) of variables $X$, $Y$ and $Z$ in a graphical model where $X = \{x_1,x_2,\dots,x_m\}$, $Y = \{y_1,y_2,\dots,y_n \}$ and $Z = \{z_1,z_2,\dots,z_k\}$. Further, $Z$ is dependent on both $X$ and $Y$, e.g. there is a path $x_1 \rightarrow z_5 \leftarrow y_3$ in the model. Let Z be the observed variables and $X$ and $Y$ be the latent variables. To maximize the probability $p(X,Y|Z)$. One can choose to (1) minimize its log likelyhood and find the assignments for variables in $X$ and $Y$, or (2) use belief propagation. My question is which of the two methods are better, is there any rules to choose one over the other?