liveBook · Manning

Adjacency list

As explained in Graph Neural Networks in Action

An adjacency list is a graph representation that records the neighboring nodes associated with each node.

An adjacency list represents a graph by assigning each node a list of its neighboring nodes. It is useful when graph relationships must remain easy to inspect, transform, and serialize. section 8.3 section 8.3.2

A practical graph-data workflow uses an adjacency list as follows:

  • Choose a graph schema containing nodes and relationships. section 8.0
  • Convert raw JSON or CSV relationships into an adjacency list, often alongside an edge list. section 8.3.2
  • Store each node and its neighbors in a dictionary or text file, then serialize the result for reuse. section 4.2.2 section 8.3.2
  • Load the representation into NetworkX for exploration and visualization, or into PyTorch Geometric for preprocessing. section 8.3.2

Recruitment referrals

A candidate-referral dictionary uses each referring member as a key and referred candidates as values. The conversion function writes one line per member followed by related member hashes; for an undirected graph, it adds reciprocal connections. section 8.3.2

How Graph Neural Networks in Action covers it

How deep it goes
Defines the representation and walks through Python construction, serialization, and undirected-connection handling without covering algorithmic complexity.
Examples
Uses YelpChi graph data and a recruiting network of candidates connected through referral relationships.
What you can do after
Build it from scratch in Python, serialize it, and load it into NetworkX or PyTorch Geometric.
How it connects
Connects adjacency lists with graphs, edge lists, adjacency matrices, node degree, NetworkX, and PyTorch Geometric.

Also explained in

Compare how 5 books explain adjacency list →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Neural Networks in Action. The section links point to the parts of the book it draws on.