Appearance
A two-mode (or bipartite) network has two different kinds of node — say people and events — where edges only ever run across the types, never within them. You work with one by keeping that bipartite structure explicit: store an edge list with a person column and an event column, analyse it directly where you can, and only collapse it into a one-mode projection when a specific method demands it. The single biggest mistake is treating a projection's edges as if they were real contacts.
This step-by-step guide covers representation, projection, metrics and the pitfalls.
What does a two-mode network look like?
The defining rule: nodes split into two sets, and edges connect set A to set B only. Common historical examples:
- People → organisations they belonged to.
- Signatories → petitions they signed.
- Authors → journals they published in.
- Attendees → meetings they attended.
There are no person-to-person or event-to-event edges in the raw data; those only appear if you create them by projection.
How do I represent it in data?
Use a two-column edge list, one row per affiliation, plus a node-type marker:
csv
person,event
Cobden,Anti-Corn-Law-League-1839
Bright,Anti-Corn-Law-League-1839
Bright,Reform-Conference-1858
Cobden,Reform-Conference-1858When you build nodes, tag each with its mode so tools can distinguish them:
python
import networkx as nx
import pandas as pd
df = pd.read_csv("affiliations.csv")
B = nx.Graph()
B.add_nodes_from(df["person"].unique(), bipartite=0)
B.add_nodes_from(df["event"].unique(), bipartite=1)
B.add_edges_from(df.itertuples(index=False, name=None))The bipartite attribute (0 or 1) is what NetworkX's bipartite functions rely on.
Should I project, and onto which mode?
Projection collapses the graph onto one node type: a people projection links two people who share an event; an event projection links two events with a shared attendee. It is convenient because all standard one-mode tools then apply — but it discards information and inflates density.
| Approach | Keeps | Loses |
|---|---|---|
| Analyse two-mode directly | Full structure, both modes | Some familiar one-mode metrics |
| Project to one mode | Easy standard analysis | How many shared events; edge sparsity |
Prefer direct analysis; project only when a method you need requires one mode.
How do I project correctly in NetworkX?
Use a weighted projection so you retain how many affiliations link a pair — otherwise everyone who shared any event looks equally connected:
python
from networkx.algorithms import bipartite
people = df["person"].unique()
P = bipartite.weighted_projected_graph(B, people)
# edge weight = number of shared eventsThe weight is essential: two people who co-attended ten meetings differ sharply from two who shared one, and an unweighted projection erases that distinction.
What metrics work directly on two-mode data?
You do not have to project to measure structure. NetworkX's bipartite module offers degree, density and centrality designed for two-mode graphs:
python
from networkx.algorithms import bipartite
deg_people, deg_events = bipartite.degrees(B, people)
density = bipartite.density(B, people)Degree on the person side counts events attended; degree on the event side counts attendees — both directly meaningful, no projection required.
What pitfalls trip people up?
- Mistaking projected edges for contact — a shared mass petition does not mean two signatories met.
- Unweighted projections — they flatten strong and weak co-affiliation into one undifferentiated mesh.
- Hairball projections — one giant event (e.g. a national census) links everyone to everyone; consider excluding or down-weighting it.
- Losing the type marker — without a
bipartite/type attribute, tools silently treat the graph as one-mode.
What does a clean workflow look like?
Load the affiliation list, build the bipartite graph with type markers, compute two-mode degree and density first, then produce a weighted projection only for the specific one-mode question you need — and label every projected figure clearly as "shared affiliation, not direct contact". That discipline keeps your conclusions honest.
Key Takeaways
- A two-mode network has two node types with edges only across them.
- Store affiliations as a two-column edge list and tag each node's mode.
- Analyse the bipartite structure directly when you can; project only when needed.
- Always use weighted projections so shared-affiliation counts survive.
- Watch for giant events that turn a projection into a hairball.
- Projected edges mean co-affiliation, never proven contact.
Frequently Asked Questions
What is a two-mode network?
A two-mode, or bipartite, network has two distinct kinds of node where edges only connect across the types, never within them. A classic example is people linked to the organisations they belong to, which historians use for memberships, signatories or co-attendance.
What is a one-mode projection?
A one-mode projection collapses a bipartite network onto a single node type, connecting two people if they share an affiliation. It is convenient for standard analysis but loses information and inflates edge counts, so use it knowingly.
Should I analyse the two-mode network directly or project it?
Analyse the two-mode structure directly when possible, because projection discards how many shared affiliations link a pair and can mislead centrality. Project only when a tool or method you need requires a one-mode graph.
How do I represent a two-mode network in a CSV?
Use an edge list with one column for each mode, for example a person column and an event column, one row per affiliation. Add a node type attribute so tools and you can tell the two kinds of node apart.
Which tools handle two-mode networks well?
NetworkX has a dedicated bipartite module for projection and metrics, and Python's networkx plus pandas covers most needs. Gephi can display bipartite graphs if you set a node type attribute, though its analytics assume one mode.
What is the biggest pitfall with two-mode data?
Treating a dense projection as if its edges were direct relationships. Two people sharing a large event are linked by the projection even if they never met, so always remember projected edges mean co-affiliation, not contact.