A factor graph is a
bipartite graph
In the mathematical field of graph theory, a bipartite graph (or bigraph) is a graph whose vertices can be divided into two disjoint and independent sets U and V, that is every edge connects a vertex in U to one in V. Vertex sets U and V are ...
representing the
factorization of a function. In
probability theory and its applications, factor graphs are used to represent factorization of a probability distribution function, enabling efficient computations, such as the computation of
marginal distributions through the
sum-product algorithm. One of the important success stories of factor graphs and the
sum-product algorithm is the
decoding
Decoding or decode may refer to: is the process of converting code into plain text or any format that is useful for subsequent processes.
Science and technology
* Decoding, the reverse of encoding
* Parsing, in computer science
* Digital-to-analog ...
of capacity-approaching
error-correcting code
In computing, telecommunication, information theory, and coding theory, an error correction code, sometimes error correcting code, (ECC) is used for controlling errors in data over unreliable or noisy communication channels. The central idea is ...
s, such as
LDPC and
turbo codes.
Factor graphs generalize
constraint graph
In constraint satisfaction research in artificial intelligence and operations research, constraint graphs and hypergraphs are used to represent relations among constraints in a constraint satisfaction problem. A constraint graph is a special case o ...
s. A factor whose value is either 0 or 1 is called a constraint. A constraint graph is a factor graph where all factors are constraints. The max-product algorithm for factor graphs can be viewed as a generalization of the
arc-consistency algorithm for constraint processing.
Definition
A factor graph is a
bipartite graph
In the mathematical field of graph theory, a bipartite graph (or bigraph) is a graph whose vertices can be divided into two disjoint and independent sets U and V, that is every edge connects a vertex in U to one in V. Vertex sets U and V are ...
representing the
factorization of a function. Given a factorization of a function
,
:
where
, the corresponding factor graph
consists of variable vertices
, factor
vertices , and edges
. The edges depend on the factorization as follows: there is an undirected edge between factor vertex
and variable vertex
if
. The function is tacitly assumed to be
real-valued:
.
Factor graphs can be combined with message passing algorithms to efficiently compute certain characteristics of the function
, such as the
marginal distributions.
Examples

Consider a function that factorizes as follows:
:
,
with a corresponding factor graph shown on the right. Observe that the factor graph has a
cycle
Cycle, cycles, or cyclic may refer to:
Anthropology and social sciences
* Cyclic history, a theory of history
* Cyclical theory, a theory of American political history associated with Arthur Schlesinger, Sr.
* Social cycle, various cycles in soc ...
. If we merge
into a single factor, the resulting factor graph will be a
tree. This is an important distinction, as message passing algorithms are usually exact for trees, but only approximate for graphs with cycles.
Message passing on factor graphs
A popular message passing algorithm on factor graphs is the
sum-product algorithm, which efficiently computes all the marginals of the individual variables of the function. In particular, the marginal of variable
is defined as
:
where the notation
means that the summation goes over all the variables, ''except''
. The messages of the sum-product algorithm are conceptually computed in the vertices and passed along the edges. A message from or to a variable vertex is always a
function of that particular variable. For instance, when a variable is binary, the messages
over the edges incident to the corresponding vertex can be represented as vectors of length 2: the first entry is the message evaluated in 0, the second entry is the message evaluated in 1. When a variable belongs to the field of
real numbers
In mathematics, a real number is a number that can be used to measure a ''continuous'' one-dimensional quantity such as a distance, duration or temperature. Here, ''continuous'' means that values can have arbitrarily small variations. Every real ...
, messages can be arbitrary functions, and special care needs to be taken in their representation.
In practice, the sum-product algorithm is used for
statistical inference
Statistical inference is the process of using data analysis to infer properties of an underlying probability distribution, distribution of probability.Upton, G., Cook, I. (2008) ''Oxford Dictionary of Statistics'', OUP. . Inferential statistical ...
, whereby
is a joint
distribution Distribution may refer to:
Mathematics
*Distribution (mathematics), generalized functions used to formulate solutions of partial differential equations
*Probability distribution, the probability of a particular value or value range of a varia ...
or a joint
likelihood function, and the factorization depends on the
conditional independencies among the variables.
The
Hammersley–Clifford theorem shows that other probabilistic models such as
Bayesian networks and
Markov networks can be represented as factor graphs; the latter representation is frequently used when performing inference over such networks using
belief propagation. On the other hand, Bayesian networks are more naturally suited for
generative models, as they can directly represent the causalities of the model.
See also
*
Belief propagation
*
Bayesian inference
Bayesian inference is a method of statistical inference in which Bayes' theorem is used to update the probability for a hypothesis as more evidence or information becomes available. Bayesian inference is an important technique in statistics, and e ...
*
Bayesian programming
*
Conditional probability
*
Markov network
*
Bayesian network
*
Hammersley–Clifford theorem
External links
*
dimplean open-source tool for building and solving factor graphs in MATLAB.
*
References
*
*
*
*
{{DEFAULTSORT:Factor Graph
Graphical models
Markov networks
Application-specific graphs