1 - Introduction To Graphs
1 - Introduction To Graphs
Introduction
• Graphs are data structures consisting of
vertices and edges that connect these
vertices.
Eg.
Eg.
Since there is a direction between
Vertices. Vertices pairs are called ordered
pairs.
(A,B) is an ordered pair
(B,A) does not exist in this graph
Terminologies
• Formal Definition
• A directed graph (or digraph) (V, E) consists of a nonempty set of
vertices V and a set of directed edges (or arcs) E. Each directed edge is
associated with an ordered pair of vertices. The directed edge
associated with the ordered pair (u, v) is said to start at u and end at v.
• Directed graphs that may have multiple directed edges from a vertex
to a second (possibly the same) vertex are called directed
multigraphs.
Terminologies
• When there are m directed edges, each
associated to an ordered pair of vertices (u, v),
we say that (u, v) is an edge of multiplicity m.
Example
How many edges are there in a graph with 10 vertices each of degree six?