Harolds Undirected Graphs and Trees Cheat Sheet 2022
Harolds Undirected Graphs and Trees Cheat Sheet 2022
Cheat Sheet
22 October 2022
Definitions
Self-Loop
An edge that connects a vertex to itself.
(Loop)
G = (V, E)
d-Regular
All the vertices have degree d.
Graph
2-Regular Graph:
Common
Graphs
P5: A path
Term Description
Each vertex has a list of all its neighbors.
Adjacency List
Matrix
Preserved:
• Number of vertices (|V|)
• Number of edges (|E|)
Graph Theory
• Degree sequence (degrees listed high to low)
• Total degree (2·|E|)
Not Preserved:
• The lowest numbered vertex has degree 3
• Every even numbered vertex has odd degree
Graph Types
No repeated …
Walk
Edge Vertex or Edge
Open Trail Path
Closed Circuit Cycle
Theorem:
An undirected graph G has an Euler trail if Euler trail begins and
Characterizations of
and only if G is 1) connected and 2) has ends with vertices of
graphs that have an Euler
exactly two vertices with odd degree. odd degree.
trail
Tree Theorems
Tree Traversals
T := ∅.
Pick any vertex in G and add it to T.
Prim's Algorithm
For j = 1 to n-1
Let C be the set of edges with one endpoint
inside T and one endpoint outside T.
Let e be a minimum weight edge in C.
Add e to T.
Add the endpoint of e not already in T to T.
End-for
Sources:
• SNHU MAT 230 - Discrete Mathematics, zyBooks.
• See also “Harold’s Directed Graphs Cheat Sheet”.