Adjacency Matrices #
This module defines the adjacency matrix of a graph, and provides theorems connecting graph properties to computational properties of the matrix.
Main definitions #
Matrix.IsAdjMatrix:A : Matrix V V αis qualified as an "adjacency matrix" if (1) every entry ofAis0or1, (2)Ais symmetric, (3) every diagonal entry ofAis0.Matrix.IsAdjMatrix.to_graph: forA : Matrix V V αandh : A.IsAdjMatrix,h.to_graphis the simple graph induced byA.Matrix.compl: forA : Matrix V V α,A.complis supposed to be the adjacency matrix of the complement graph of the graph induced byA.SimpleGraph.adjMatrix: the adjacency matrix of aSimpleGraph.SimpleGraph.adjMatrix_pow_apply_eq_card_walk: each entry of thenth power of a graph's adjacency matrix counts the number of length-nwalks between the corresponding pair of vertices.
For A : Matrix V V α and h : IsAdjMatrix A,
h.toGraph is the simple graph whose adjacency matrix is A.
Instances For
Equations
For A : Matrix V V α, A.compl is supposed to be the adjacency matrix of
the complement graph of the graph induced by A.adjMatrix.
Instances For
adjMatrix G α is the matrix A such that A i j = (1 : α) if i and j are
adjacent in the simple graph G, and otherwise A i j = 0.
Instances For
The adjacency matrix of G is an adjacency matrix.
The graph induced by the adjacency matrix of G is G itself.
The sum of the identity, the adjacency matrix, and its complement is the all-ones matrix.
If A is qualified as an adjacency matrix,
then the adjacency matrix of the graph induced by A is itself.