Use a bipartite graph when relationships run between two sets of nodes, but not within either set. Each edge connects a node in one set to a node in the other. A bipartite graph can also be heterogeneous: its two sets may represent different kinds of things. section 1.2.2
Pins and boards
In a Pinterest-style recommendation graph, pins form one set and boards the other. A pin can belong to multiple boards, but pin-to-pin and board-to-board edges are absent. These connections provide recommendation signals alongside image data and user tags. PinSage, a graph convolutional network, used this kind of graph in a large-scale recommendation system. section 1.3.1
When designing the graph dataset, make the structural rule explicit:
- Identify the two node sets and the relationship an edge represents. section 8.2.2
- Check that edges cross between sets; an edge within a set violates the bipartite structure. section 8.2.2
- Record the rule in the schema so data integrity can be tested and graph structures compared systematically. section 8.2.2
Figure 1.3 A bipartite graph. There are two types of nodes (two shades of circles). In a bipartite graph, nodes can’t be connected to nodes of the same type. This is also an example of a heterogeneous graph.
The two shades of nodes show the sets; every depicted edge crosses between them. section 1.2.2


