Programming and Data Structures
1
Elementary Graph Theory
•
WE will be looking at :
–
What is a Graph?
–
Adjacency Matrices
–
Adjacency Lists
–
Breadth First Search
–
Depth First Search
–
Minimum Spanning Trees; What are they?
–
Kruskal’s Algorithm for creating a MST
–
Prim’s Algofithm for creating a MST

This ** preview** has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*
Programming and Data Structures
2
A Graph
•
A graph can be thought of a collection of vertices (V) and edges (E), so we
write,
G = (V, E)
•
Graphs can be
directed
, or
undirected
,
weighted
or
unweighted
.
•
A directed graph, or digraph, is a graph where the edge set is an ordered pair.
•
That is, edge 1 being connected to edge 2 does not imply that edge 2 is
connected to edge 1. (i.e. it has direction – trees are special kinds of directed
graphs)
•
An undirected graph is a graph where the edge set in an unordered pair.
•
That is, edge 1 being connected to edge 2 does imply that edge 2 is connected
to edge 1.