For example, the adjacency matrix of the following graph
Remarks. Let be a graph and be its adjacency matrix.
is symmetric with ’s in its main diagonal.
The sum of the cells in any given column (or row) is the degree of the corresponding vertex. Therefore, the sum of all the cells in is twice the number of edges in .
The above definition of an adjacency matrix can be extended to multigraphs (multiple edges between pairs of vertices allowed), pseudographs (loops allowed), and even directed pseudographs (edges are directional). There are two cases in which we can generalize the definition, depending on whether edges are directional.
(Edges are not directional).
Since a multigraph is just a special case of a pseudograph, we will define for a pseudograph . Let be a pseudograph with The adjacency matrix of is an matrix such that is the number of edges whose endpoints are and . Again, is symmetric, but the main diagonal may contain non-zero entries, in case there are loops.
(Edges are directional).
Since a digraph is a special case of a directed pseudograph, we again define in the most general setting. Let be a directed pseudograph with and . The adjacency matrix of is an matrix such that
In other words, is the number of directed edges from to .
If is a multigraph, then the entries in the main diagonal of must be all .
If is a graph, then corresponds to the original definition given in the previous section.
If is a digraph, then entries consists of ’s and ’s and its main diagonal consists of all ’s.
Generally, one can derive a pseudograph from a directed pseudograph by “forgetting” the order in the ordered pairs of vertices. If is a directed pseudograph and is the corresponding derived pseudograph. Let and , then .
In the language of category theory, the above operation is done via a forgetful functor (from the category of directed pseudographs to the category of pseudographs). Other forgetful functors between categories of various types of graphs are possible. In each case, the forgetful functor has an associated operation on the adjacency matrices of the graphs involved.
|Date of creation||2013-03-22 17:22:43|
|Last modified on||2013-03-22 17:22:43|
|Last modified by||CWoo (3771)|