Graphs PDF
Graphs PDF
A graph consists of
– a set of vertices (or nodes)
– and a set of edges (or arcs)
In a directed graph (or digraph), the edges
go from one vertex (the source) to another
(the destination).
In an undirected graph, the edges simply go
between two vertices
Loops and multiple edges
A loop is an edge
– from a vertex to itself in the directed case
– between a vertex and itself in the undirected case
In either case, we usually disallow loops
We usually disallow multiple edges between
the same pair of vertices.
Directed and undirected graphs