A Bayesian network is a graphical model in which all nodes are connected by directed edges, and in which there are no closed paths if the directions of the edges are followed [2]. Factor graphs are bipartite graphs with different vertices for random variables and the functions that depend on them [3]. Any Bayesian network can be represented as a factor graph, so the factor graph may be considered its general form.
In practice, factor graphs offer a more intuitive approach to solving belief networks. Separation of the variable from its function, as well as the removal of the directed edges make a more fitting structure for the sum-product algorithm, which depends on message passing from random variables to function nodes and back. A Bayesian network can be converted to a factor graph by drawing one function node and one random variable node for each node in the Bayesian network. If more than one path meet at a single variable in a Bayesian network, in a factor graph, they will meet at a function node that is singly connected to the random variable that it depends upon. A simple example is given in figure 1.