Home/Chart Types/Network/Bipartite graph
NetworkIntermediate

Bipartite Graph

A graph with two distinct sets of nodes where edges only connect nodes from different sets — ideal for showing relationships between two different types of entities.

// 01 — The chart

What it looks like

Example — Authors & research topics2024 publications
AuthorsTopicsAliceBobCarolDaveMLNLPVisionEthicsHCI

A bipartite graph linking authors (left, circles) to research topics (right, squares). The highlighted edge shows Bob’s connection to the Vision topic.

// 02 — Definition

What is a bipartite graph?

A bipartite graph (also called a two-mode network) is a type of network where nodes are divided into two distinct groups, and edges only connect nodes from one group to the other — never within the same group. Think of it as a matchmaking diagram: one side lists one type of entity, the other side lists another, and lines show which pairs are related.

The classic example is a graph connecting people to events: each person on the left, each event on the right, and a line between them if that person attended. Other common pairings include students & courses, actors & films, genes & diseases, or customers & products.

Bipartite graphs are foundational in graph theory and appear frequently in recommendation systems, social network analysis, and ecology. Their strict two-set structure makes them analytically powerful — you can project them onto either set to discover hidden clusters and co-occurrence patterns.

Origin: The concept of bipartite graphs dates back to the work of Dénes König in 1931, who proved the foundational König’s theorem relating maximum matchings and minimum vertex covers in bipartite graphs. The visualization form gained popularity with social network analysis in the late 20th century.

// 03 — Anatomy

Parts of a bipartite graph

ABCDE
A — Set 1 (left nodes): One distinct group of entities, typically shown as circles on the left
B — Set 2 (right nodes): The other group of entities, often shown as squares on the right
C — Edge (connection): A line linking a node from Set 1 to a node in Set 2, representing a relationship
D — Edge weight: Optional thickness or label indicating the strength or frequency of the relationship
E — Vertical alignment: Nodes within each set are stacked vertically for clarity, keeping sets visually separated

// 04 — Usage

When to use it — and when not to

✓Use a bipartite graph when…
  • You have two distinct types of entities with relationships between them (e.g., people ↔ events)
  • You want to reveal which items from Set A connect to which items in Set B
  • Exploring co-occurrence patterns — which nodes share common neighbors across sets
  • Building recommendation systems based on user–item interactions
  • Modeling ecological relationships like plants and pollinators
  • Your data naturally has a two-mode structure that shouldn’t be flattened
×Avoid a bipartite graph when…
  • Your nodes are all the same type — use a standard network graph instead
  • You have edges within the same set — violates the bipartite constraint
  • There are too many nodes on both sides (>50 each), creating an unreadable hairball
  • You want to show hierarchy — use a tree diagram or dendrogram
  • The relationships have a clear direction and flow — consider a Sankey diagram
  • Simple tabular data would communicate the same information more clearly

// 05 — Reading guide

How to read a bipartite graph

Follow these steps whenever you encounter a bipartite graph.

1

Identify the two node sets

Determine what each side represents. One set might be people, products, or genes; the other might be events, categories, or diseases. The labels or positions will tell you.

2

Read the edges as relationships

Each line connecting a node on the left to a node on the right represents a relationship — membership, authorship, purchase, or any kind of affiliation between the two types.

3

Look for highly connected nodes

Nodes with many edges (high degree) are hubs. A person connected to many events is a social connector; a product bought by many customers is a bestseller.

4

Spot clusters and shared connections

If two nodes on the same side connect to the same nodes on the other side, they share a pattern. These shared neighbors reveal communities and co-occurrence relationships.

5

Check for edge weight or highlighting

Thicker or colored edges may indicate stronger relationships. Annotations or callouts typically highlight the most interesting connection in the dataset.

// 06 — Common mistakes

Mistakes to watch out for

Mixing node types within a set

The defining rule of a bipartite graph is that no edges exist within the same set. Placing different entity types in the same column or adding intra-set edges breaks the bipartite structure and misleads the reader.

Too many crossing edges

When both sets are large, edges crisscross into an unreadable tangle. Sort nodes strategically (e.g., by degree or cluster) to minimize crossings, or consider using a matrix representation instead.

Ignoring node ordering

Random vertical ordering of nodes within each set makes patterns invisible. Group related nodes together or sort by connectivity to reveal structure.

Not distinguishing the two sets visually

If both sets use the same shape, size, and color, readers can’t tell them apart. Use different shapes (circles vs. squares), colors, or positions to make the two-set structure obvious.

Overloading with too many nodes

Bipartite graphs become unreadable when each set exceeds 30–50 nodes. For large datasets, consider filtering to top connections, aggregating nodes, or switching to a matrix view.

// 07 — Real-world examples

Where you’ll see bipartite graphs used

01

Recommendation systems: Users and products

E-commerce platforms model customer–product interactions as bipartite graphs. By finding users who share similar purchase patterns, the system recommends products that connected users bought. Netflix, Amazon, and Spotify all use bipartite graph projections at their core.

Machine Learning
02

Social science: People and organizations

Sociologists study affiliation networks by mapping individuals to the groups they belong to. The classic Southern Women study (1941) used a bipartite graph of 18 women and 14 social events to reveal community structure in a small town.

Social Networks
03

Biology: Genes and diseases

Biomedical researchers map genes to diseases they are associated with. Projecting this bipartite graph onto the disease set reveals disease modules — clusters of diseases that share genetic underpinnings — opening paths for drug repurposing.

Bioinformatics

// 08 — At a glance

Quick reference

Also known asTwo-mode network, affiliation network, 2-colorable graph
Key theoremKönig’s theorem (1931)
Best forShowing relationships between two distinct types of entities
Data typesTwo categorical sets connected by relational edges
Recommended nodes5 – 30 per set for readability
Edge constraintInter-set only. No intra-set edges allowed.
Common toolsD3.js, Gephi, NetworkX, igraph, Cytoscape
Common mistakesMixing node types, too many crossings, random ordering, no visual distinction

// 09 — Variations

Types of bipartite graphs

The basic bipartite graph has several layout and analytical variants suited to different analysis needs.

Weighted bipartite graph

Edges carry numeric weights representing strength, frequency, or volume of the relationship between nodes.

k-partite graph

Extends to three or more node sets. Edges only connect nodes from different sets, enabling multi-type relationship modeling.

One-mode projection

Projects the bipartite graph onto one set, connecting nodes that share at least one common neighbor in the other set.

Biadjacency matrix

A matrix representation where rows are one set, columns the other, and filled cells indicate edges. Scales better for large graphs.

// 10 — FAQs

Frequently asked questions

What is a bipartite graph?+

A bipartite graph (also called a two-mode network) is a type of network where nodes are divided into two distinct groups, and edges only connect nodes from one group to the other — never within the same group. Think of it as a matchmaking diagram: one side lists one type of entity, the other side lists another, and lines show which pairs are related.

When should you use a bipartite graph?+

Use a bipartite graph when you have two distinct types of entities with relationships between them (e.g., people ↔ events). It also works well when you want to reveal which items from Set A connect to which items in Set B, and when exploring co-occurrence patterns — which nodes share common neighbors across sets.

When should you avoid a bipartite graph?+

Avoid a bipartite graph when your nodes are all the same type — use a standard network graph instead. It is also a poor fit when you have edges within the same set — violates the bipartite constraint, or when there are too many nodes on both sides (>50 each), creating an unreadable hairball.

Is a bipartite graph suitable for dashboards?+

Yes — a bipartite graph can work well in dashboards as long as the panel is large enough for readers to perceive the encoded values, has a clear title, and includes the legend or axis labels needed to interpret it.

What category of chart is a bipartite graph?+

Bipartite Graph belongs to the Network family of charts. Charts in that family are designed to answer the same kind of question, so they often work as alternatives when one doesn't quite fit your data.

How do you read a bipartite graph?+

Start with the axis labels and legend, then look at the overall shape before zooming into individual marks. Compare prominent features against the rest of the data, and verify any conclusion against the underlying numbers when precision matters.