2.2 KiB
2.2 KiB
- #MA284 - Discrete Mathematics
- Previous Topic: Trees
- Next Topic:
- Relevant Slides:
- In a practical setting, a graph must be stored in some computer-readable format.
- One of the most common is an adjacency matrix.
-
Adjacency Matrices
- What is an adjacency matrix? #card
-
Properties of the Adjacency Matrix #card
- The adjacency matrix of a graph is symmetric.
- If
B = A^k
, thenb_{i,j}
is the number of paths of lengthk
from vertexi
to vertexj
. - We can work out if a graph is connected by looking at the eigenvalues of
A
. - If the graphs
G
&H
are isomorphic, and have adjacency matricesA_G
&A_H
, then there is a permutation matrixP
, such thatPA_GP^{-1}=A_H
.
- The adjacency matrix idea is easily extended to allow for multigraphs and pseudographs (graphs with loops).
- For a multigraph,
a_{i,j}
is the number of edges joining verticesi
&j
. - For a pseudograph,
a_{i,i}
means that there is an edge from the vertexi
to itself.
- For a multigraph,
-
Instance Matrices
- Graphs can also be represented by an Incidence Matrix.
- If the graph has
v
vertices, ande
edges, then it is anv \times e
binary matrix. - The rows represent vertices.
- The columns represent edges.
- If the matrix is
B = (b_{i,j})
thenb_{ik} = 1
means that the vertexi
is incident to edgej
.
- If the graph has
- Graphs can also be represented by an Incidence Matrix.
-
Distance Matrices
- What is the eccentricity of a vertex?
- The eccentricity of a vertex is the greatest distance between that vertex & any other vertex in the graph.
- What is the radius of a graph? #card
- The radius of a graph is the minimum eccentricity of any vertex.
- What is the diameter of a graph?
- The diameter of a graph is the maximum eccentricity of any vertex.
- This is also the maximum entry in the distance matrix.
- The diameter of a graph is the maximum eccentricity of any vertex.
- What is the eccentricity of a vertex?