liveBook · Manning

Adjacency matrix

As explained in Machine Learning Algorithms in Depth

An adjacency matrix is a matrix that records which pairs of graph vertices are connected by edges.

An adjacency matrix A represents graph connectivity. For a graph G=(V,E), set Aij=1 when an edge connects nodes i and j, and 0 otherwise. For an undirected graph, A is symmetric: A=AT. section 11.4

Use the matrix to encode relational structure alongside node and edge information:

  • Represent N nodes with an N×N adjacency matrix; directed edges need not produce a symmetric matrix. section 11.4
  • Pair A with the node feature matrix X, whose N×F entries describe F features for each node. section 11.4
  • Keep edge attributes separately in an M×S edge feature matrix E when M edges have S features each. section 11.4
  • For PageRank, derive each page’s out-degree from adjacency entries and use it to construct link-following probabilities. section 7.1.1

CORA citation network

Treat each document as a node and each citation as a directed edge. The adjacency matrix records citation relationships, while a binary N×F feature matrix records whether dictionary words occur in each document. section 11.4

How Machine Learning Algorithms in Depth covers it

How deep it goes
Defines binary entries, dimensions, undirected symmetry, and out-degree use without developing storage or implementation details.
Examples
Uses CORA documents and citations, binary document-word features, and web-page link structures as concrete graph representations.
What it assumes
Assumes graph notation and matrix operations while defining adjacency entries from the graph’s vertices and edges.
What you can do after
Build it from graph edges and apply it as relational input for GNNs or transition construction for PageRank.
How it connects
Connects graph neural networks, graph convolutional networks, node feature matrices, edge feature matrices, PageRank, and Markov chains.

Also explained in

Compare how 8 books explain adjacency matrix →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning Algorithms in Depth. The section links point to the parts of the book it draws on.