2.8 KiB
2.8 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 card-last-interval:: -1 card-repeats:: 1 card-ease-factor:: 2.5 card-next-schedule:: 2024-05-30T23:00:00.000Z card-last-reviewed:: 2024-05-30T00:17:42.413Z card-last-score:: 1
-
Properties of the Adjacency Matrix #card
card-last-interval:: -1 card-repeats:: 1 card-ease-factor:: 2.5 card-next-schedule:: 2024-05-30T23:00:00.000Z card-last-reviewed:: 2024-05-30T00:17:59.125Z card-last-score:: 1- 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
card-last-interval:: -1
card-repeats:: 1
card-ease-factor:: 2.5
card-next-schedule:: 2024-05-30T23:00:00.000Z
card-last-reviewed:: 2024-05-30T00:18:05.726Z
card-last-score:: 1
- 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?