Matrix Representation¶
Matrix representation of graphs are widely used in algebraic analysis of graphs. This package comprises functions that derive matrix representation of an input graph.
Adjacency Matrix¶
An adjacency matrix is defined as

-
adjacency_matrix(graph)¶ Constructs an adjacency matrix for a graph.
Weight Matrix¶
A weight matrix is defined as

-
weight_matrix(graph, eweights)¶ Constructs a weight matrix from a graph and a vector of edge weights. Here,
gmust implementedge_mapand (edge_listorincidence_list).
Distance Matrix¶
A distance matrix is defined as

-
distance_matrix(graph, eweights)¶ Constructs a distance matrix from a graph and a vector of edge weights. Here,
gmust implementedge_mapand (edge_listorincidence_list).
Laplacian Matrix¶
Laplacian matrix is significant in algebraic graph theory. The eigenvalues of a Laplacian matrix characterizes important properties of a graph. For an undirected graph, it is defined as:

-
laplacian_matrix(graph)¶ Constructs a Laplacian matrix over an undirected graph.
For graphs with weighted edges, we have
-
laplacian_matrix(graph, eweights) Constructs a weighted Laplacian matrix from an undirected graph with a vector of edge weights.