Adjacency matrix
An adjacency matrix is a square matrix whose rows and columns represent graph vertices and whose entries indicate edges or encode edge weights between vertex pairs.
Optimization Algorithms: AI techniques for design, planning, and control problems
An adjacency matrix is a matrix whose entries indicate whether pairs of graph nodes are connected, and possibly encode connection weights.
- How it is used
- Represents neighborhood relationships for districting constraints and graph structure for node embeddings.
- How deep it goes
- Shows pairwise construction from geometry and use in constraints, then contrasts unweighted and attention-weighted graph inputs.
- Examples
- Uses 16 Toronto neighborhoods, geometry-intersection code, and a graph-learning pipeline for traveling-salesman instances.
- What you can do after
- Build it from scratch from geographic intersections and apply it as input to districting constraints or graph-learning pipelines.
Graph Neural Networks in Action
An adjacency matrix is a matrix representation of a graph in which entries encode whether or how strongly pairs of nodes are connected.
- How it is used
- Represents node connections for graph inspection, graph-based learning, and adjacency reconstruction.
- How deep it goes
- Defines matrix entries and works through symmetry, weights, and self-connections; extends to model workflows without a formal derivation.
- Examples
- Uses a five-node matrix, passenger relationships, and predicted versus real molecular adjacency matrices.
- What you can do after
- Evaluate/understand graph connections from matrix entries and apply the matrix as a reconstruction target in a graph autoencoder.
Read how Graph Neural Networks in Action explains adjacency matrix →
Data Without Labels
An adjacency matrix is a matrix representing which pairs of nodes in a graph are connected and, when applicable, the connection weights.
- How it is used
- Represents graph connectivity and supplies a foundation for spectral clustering.
- How deep it goes
- Defines binary and symmetric representations, then uses them in Laplacian construction without detailing implementation code.
- Examples
- Uses five connected nodes, including matrix entries for connections between nodes 1 and 5 and between nodes 1 and 4.
- What you can do after
- Apply it via spectral clustering workflows that calculate degree and Laplacian matrices from graph connectivity.
D3.js in Action, Third Edition
An adjacency matrix is a square grid in which rows and columns represent nodes and cells indicate the presence and optionally the weight of connections between them.
- How it is used
- Displays relationships between network nodes when connection patterns matter more than individual-node details.
- How deep it goes
- Explains grid encoding, weighted opacity, symmetry, data preparation, legends, and interaction through a D3 implementation.
- Examples
- Uses Romeo and Juliet characters, shared-scene counts, opacity legends, tooltips, and highlighted labels.
- What you can do after
- Builds an interactive weighted adjacency matrix with D3.js from node and edge data.
Read how D3.js in Action, Third Edition explains adjacency matrix →
Machine Learning Algorithms in Depth
An adjacency matrix is a matrix that records which pairs of graph vertices are connected by edges.
- How it is used
- Represents graph connectivity for graph neural networks and PageRank transition construction.
- 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 you can do after
- Build it from graph edges and apply it as relational input for GNNs or transition construction for PageRank.
Read how Machine Learning Algorithms in Depth explains adjacency matrix →
Graph Algorithms for Data Science
An adjacency matrix is a square matrix whose elements indicate whether pairs of graph nodes are connected.
- How it is used
- Represents graph structure as a high-dimensional input feature for machine-learning models.
- How deep it goes
- Defines 0/1 connectivity and scales it to million-node graphs, then identifies feature-count and overfitting problems.
- Examples
- Uses a four-node graph with A, B, C, and D, including a C–D cell containing 1.
- What you can do after
- Evaluate/understand adjacency-matrix features and their scaling and overfitting implications for graph machine learning.
Read how Graph Algorithms for Data Science explains adjacency matrix →
Advanced Algorithms and Data Structures
An adjacency matrix is a matrix representation of a graph in which entries indicate whether pairs of vertices are connected, and may encode edge information.
- How it is used
- Represents graph connections while supporting direct edge insertion, deletion, and presence checks.
- How deep it goes
- Defines cells, demonstrates a matrix, and compares operation and space costs without implementing traversal algorithms.
- Examples
- Uses a four-vertex directed matrix with entries for V1→V2, V1→V3, and V2→V4.
- What you can do after
- Evaluate/understand when a matrix representation suits a graph, including its operation times and quadratic space cost.
Read how Advanced Algorithms and Data Structures explains adjacency matrix →
Financial AI in Practice
A matrix whose entries represent whether or how pairs of graph vertices are connected.
- How it is used
- Encodes transaction connections as input to a graph neural network for fraud detection.
- How deep it goes
- Explains graph construction, sparse storage, row normalization, and neighbor aggregation without detailing matrix theory.
- Examples
- Links transaction nodes that share a user ID or device ID.
- What you can do after
- Apply it via PyTorch as input for aggregating neighboring transaction features.
Read how Financial AI in Practice explains adjacency matrix →
Related concepts
- adjacency listalternative to · An adjacency list is a graph representation that associates each vertex with a collection of its neighboring vertices or incident edges.
- graphimplements · A graph is a mathematical structure consisting of vertices connected by edges that represent relationships or connections.
- graph Laplacianused by · A graph Laplacian is a matrix formed from a graph’s degree and adjacency matrices that encodes connectivity and supports spectral analysis.
- encoderused by · An encoder is a component that transforms input data into an encoded representation for subsequent processing, reconstruction, comparison, or transmission.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.







