AI Glossary / Graphs and symbolic AI / Intermediate

Markov network

Definition

A Markov network is a probabilistic graphical model that uses an undirected graph to represent relationships among variables. Also called a Markov random field, it expresses a joint distribution through local compatibility functions and encodes conditional independences through graph separation. Its edges do not specify a direction of causation.

What it means

Some modeling problems involve mutual compatibility rather than a natural sequence of causes. Adjacent image regions, for example, often have related labels, while each region also has its own visual evidence. An undirected model can combine these local relationships into probabilities for whole configurations.

The graph alone is not a complete probability model. It specifies which variables interact locally; numerical functions specify how their possible values fit together. A network containing many loops is still a valid Markov network. Those loops may complicate computation, but they are not forbidden in the way directed cycles are forbidden in a Bayesian network.

How it works

Define variables and an undirected graph. Associate nonnegative potential functions with cliques, which are sets of mutually connected nodes. A potential gives a compatibility weight to each configuration of its variables. Multiply the relevant weights and divide by a normalizing quantity, the partition function, to obtain a probability distribution, assuming the normalizer is finite and positive.

If a set of observed nodes separates two other sets in the graph, the model makes those sets conditionally independent. A node's immediate neighbors form its graphical Markov blanket.

Inference may ask for a marginal probability, a conditional probability, or the highest-probability configuration. These are different tasks. Exact calculations can become expensive, leading to methods such as message passing or sampling. Strict positivity is important when stating the full equivalence between undirected independence properties and clique factorization.

Three practical examples

  • Image restoration: balance agreement with observed pixel values against compatibility between neighboring hidden pixel labels.
  • Document layout: combine local evidence about text blocks with relationships between nearby labels such as heading, paragraph, and caption.
  • Sensor interpretation: model compatible states across neighboring monitoring locations while preserving uncertainty about individual readings.

Think of it this way

Think of arranging tiles whose neighboring patterns should fit, with some tiles also having individual preferences. A complete arrangement receives a score from all those local agreements.

The limitation is that a probabilistic model does not necessarily prohibit a mismatch. It can give mismatches lower weight, and it must normalize configuration weights before calling them probabilities. The highest-scoring arrangement also differs from the full distribution over possible arrangements.

Worked example

Create a chain A - B - C of binary variables. Give each edge potential weight 2 when its endpoints match and 1 when they differ. There are no other preferences. The weight of a complete configuration is the product of its two edge weights.

Configurations 000 and 111 each have weight 4. Configurations 001, 011, 100, and 110 each have weight 2. Configurations 010 and 101 each have weight 1. The partition function is therefore 4+4+2+2+2+2+1+1=18. The probability of 000 is 4/18, not 4 or 1/4.

Condition on B=0. The four remaining configurations have weights 4, 2, 2, and 1, totaling 9. Consequently P(A=0|B=0)=6/9=2/3, and the same holds for C. Their joint probability of both being zero is 4/9=(2/3)×(2/3), illustrating conditional independence. Without observing B, A and C are not independent: P(A=0,C=0)=5/18, whereas P(A=0)P(C=0)=1/4. These values are directly enumerated arithmetic, not a fitted application.

Illustrative case study

Fictional case: an archive labels scanned page regions as text or illustration. Its first classifier treats each region independently and creates isolated labels inside otherwise consistent areas. The team develops an undirected model that combines local visual scores with neighborhood compatibility.

Reviewers then find that overly strong agreement weights erase small genuine illustrations. The team adjusts the modeling assumptions and evaluates small regions separately, instead of treating visual smoothness as proof of correctness. This fictional example illustrates a trade-off in local compatibility modeling and makes no claim about an achieved accuracy gain.

Common misconceptions and mistakes

An edge is not a causal arrow, and its absence does not generally imply unconditional independence. In A - B - C, the endpoints can be associated until B is conditioned on.

Potential values are not automatically probabilities, so they need not sum to one independently. Normalizing each potential separately does not remove the need to understand the joint normalizer. A high-probability complete configuration is also not necessarily obtained by independently choosing each variable's most probable value.

Finally, a compact graph can still require substantial inference work. The number and arrangement of connections matter, as do variable sizes and the chosen inference objective.

Business use

Markov networks are useful when a decision involves many related labels or states and local consistency carries information. They can make those relationships explicit enough for domain review, while supporting probabilistic rather than purely deterministic conclusions.

Teams should document what each potential rewards, how its parameters are estimated, and which inference approximations are used. Evaluate the actual business failure modes: a model that removes isolated errors may also suppress rare but important exceptions. Runtime and approximation error should be assessed alongside predictive performance.

People also ask

Is a Markov network a Markov chain?

No. A chain usually describes sequential transitions; a Markov network is an undirected representation of a joint distribution.

Are all factors pairwise?

No. Higher-order clique potentials can involve more than two variables.

Does observing a separator always make the model's separated groups independent?

Yes, for the conditional independence represented by the model, on conditioning events where the relevant conditional probabilities are defined. The real data must still justify the model.

Check your understanding

in the worked chain, A and C have no direct edge. Can their unconditioned probabilities still be related?

Answer: yes. Their connection through B can produce dependence. Conditioning on B blocks that path, which is a different statement from unconditional independence.

Related terms

  • Markov random field
  • Conditional independence
  • Markov blanket
  • Factor graph
  • Bayesian network
  • potential function
  • clique
  • partition function
  • maximum a posteriori inference

Learn next

recompute the worked model after changing one edge's matching weight from 2 to 3. Compare marginal probabilities with the most probable complete assignments. Then study factor graphs and exact versus approximate inference to see how the same model can support different computations.

  • Approximate inference

More in Graphs and symbolic AI

  • Makespan - Makespan is the time at which all scheduled work has finished, measured from a specified scheduling origin.
  • Margin - In classification, a margin measures how far an example lies from a decision boundary, usually with a sign indicating whether it is on the correct side.
  • Markov chain Monte Carlo - Markov chain Monte Carlo, or MCMC, is a family of methods for estimating quantities from a probability distribution by generating a dependent sequence of...
  • Markov reward process - A Markov reward process, or MRP, is a Markov state-transition model equipped with rewards.
  • Maximal independent set - A maximal independent set is a set of graph nodes with no edges between selected nodes, to which no additional node can be added without creating an edge...
  • Maximin - Maximin is a decision rule that chooses the option with the best worst-case payoff.

Sources

Christopher Bishop, Pattern Recognition and Machine Learning, Chapter 8, Sections 8.3.1–8.3.3: https://www.cs.cornell.edu/courses/cs6780/2009fa/materials/bishop_ch8.pdf. Relevant primary textbook passages on separation, clique potentials, normalization, and image modeling were read. The three-variable model, numerical enumeration, and archive case are original teaching material.

Previous: Markov logic network Next: Markov property

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer