s9.1 Graphs and Models

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Graphs and Graph Models

Graphs and Graph Models 1


Definition: Pair

Definition
Let V be a set and u and v be two elements belonging to this set.
A pair in V is a set of two elements of V . In other words, a pair in
V is a set {u, v } such as u, v ∈ V .

Remarks:
The two pairs {u, v } and {v , u} are identical; the order of the
elements in the set has no significance.
The pair {u, v } implies that u 6= v .
The pair {u, u} is written like a singleton {u}.

Graphs and Graph Models 2


Definition: Ordered Pair

Definition
The ordered pair (u, v ) is the ordered collection that has u as its
first element and v as its second element.

Let V be a set. The Cartesian product in V , written V × V , is

V × V = {(u, v ) | u ∈ V ∧ v ∈ V }.

Remarks:
Two ordered pairs are equal only if the corresponding
elements are equal.
There is an order: (u, v ) 6= (v , u).
The ordered pair (u, u) is an element of the set V × V .

Graphs and Graph Models 3


Definition: Graph

Definition (p. 589)


A graph G = (V , E ) consists of V , a non empty set of vertices
(or nodes) and E , a set of edges. Each edge has either one or
two vertices associated with it, called its endpoints. An edge is
said to connect its endpoints.

Graphs and Graph Models 4


Remarks

Remark: The set of vertices can not be empty. The set of


vertices V of a graph G may be infinite. A graph with an infinite
Vertex set is called an infinite graph, and in comparison, a graph
with a finite vertex set is called a finite graph. ⋄
Remark: The set of edges may be empty. ⋄

Graphs and Graph Models 5


Definition: Edges

Vertices are linked two by two by a possibly empty set E of edges.


An edge between the vertices u and v can be bidirectional
(or undirected) and is defined by the pair {u, v }.
An edge between the vertices u and v can be directional (or
directed). It is defined by the ordered pair (u, v ).
We can allow (or not) many edges between two vertices.
We can allow (or not) edges to be between a vertex and itself
(a loop).
According to the type of edges allowed, graphs are classified
as simple graphs, multigraphs, pseudographs, directional
graphs and directional multigraphs.

Graphs and Graph Models 6


Definition: Simple Graph

Definition
A simple graph G = (V , E ) consists of a non empty set V of
vertices and a set E of edges made of pairs of distinct elements of
V.

Remarks:
E = {{u, v } | u, v ∈ V ∧ u 6= v }.
Edges are not directed.
A simple graph is also a undirected graph.
There can not be more than one edge between two vertices.
There can not be a loop.

Graphs and Graph Models 7


Definition: Multigraph

Definition
A multigraph G = (V , E ) consists of a non empty set V of
vertices, a set E of edges made of pairs of distinct elements of V ,
and a function f from E to {{u, v } | u, v ∈ V ∧ u 6= v }. Edges e1
and e2 are called multiple edges (or parallel edges) if
f (e1 ) = f (e2 ).

Remarks:
Edges are not directed.
There can be more than one edge between two vertices.
When there are m different edges associated to the same pair
of vertices {u, v }, we also say that {u, v } is an edge of
multiplicity m.
There can not be a loop.

Graphs and Graph Models 8


Definition: Pseudograph

Definition
A pseudograph G = (V , E ) consists of a non empty set V of
vertices, a set E of edges made of pairs of elements of V , and a
function f from E to {{u, v } | u, v ∈ V ∧ u 6= v }. An edge is a
loop if f (e) = {u, u} = {u} for a u ∈ V .

Remarks:
Edges are not directed.
There can be more than one edge between two vertices.
There can be a loop.

Graphs and Graph Models 9


Definition: Simple Directed Graph

Definition
A simple directed graph (or digraph) G = (V , E ) consists of a
non empty 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 .

Remarks:
E = {(u, v ) | u, v ∈ V } ⊆ V × V .
The edges are directed.
There can not be multiple edges in the same direction
between two vertices.
There can not be loops.

Graphs and Graph Models 10


Definition: Directed Multigraph

Definition
A directed multigraph G = (V , E ) consists of a non empty set of
vertices V and a set of directed edges (or arcs) E , and a
function f from E to {(u, v ) | u, v ∈ V }. Edges e1 and e2 are
called multiple directed edges if f (e1 ) = f (e2 ).

Remarks:
The edges are directed.
There can be multiple edges in the same direction between
two vertices.
There can be loops.

Graphs and Graph Models 11


Graph Terminology

Type Edges Multiple Loops?


Edges?
Simple graph Undirected No No
Multigraph Undirected Yes No
Pseudograph Undirected Yes Yes
Simple directed graph Directed No No
Directed multigraph Directed Yes Yes
Mixed graph Both Yes Yes
Note: The generic term graph describes graphs with or without
directed edges, loops and multiple edges.

Graphs and Graph Models 12

You might also like