Documente Academic
Documente Profesional
Documente Cultură
Adjacency matrix
Each cell aij of an adjacency matrix contains 0, if there is an edge between i-th
and j-th vertices, and 1otherwise. Before discussing the advantages and
disadvantages of this kind of representation, let us see an example.
The adjacency matrix, sometimes also called the connection matrix, of a simple
labeled graph is a matrix with rows and columns labeled by graph vertices, with a 1
or 0 in position
according to whether and are adjacent or not. For a simple
graph with no self-loops, the adjacency matrix must have 0s on the diagonal. For
an undirected graph, the adjacency matrix is symmetric.
node i to j. Thus if matrix B has a positive entry on row i and column j then it is
possible to reach node j starting from i. If this happens for all nodes, then the graph
is strongly connected.