Вы находитесь на странице: 1из 13

What Is a Graph?

• Graph is a generic model for solving discrete


problems
• A set of vertices
• A set of edges

• A vertex : an object
• An edge : a binary relation (between objects)

Sunday, January 7, 2018 1


What Is a Graph?
• A graph G is a triplet consisting of:
• A vertex set V(G )
• An edge set E(G )
• A relation between an edge and a pair of vertices (not
necessarily distinct)
• Finite graph : a graph whose vertex set and edge
set are finite
• General notation : |V(G )| = n, |E(G )| = m

• Null graph : a graph whose vertex set and edge set


are empty
• We will assume (unless explicitly stated to the
contrary) that all graphs are finite, and that the
vertex set is non-empty.

Sunday, January 7, 2018 2


Loop, Multiple edges
• Loop : An edge whose endpoints are equal
• Multiple edges : Edges have the same pair of
endpoints
• Simple Graph : No loops, No Multiple edges

Multiple
edges loop

Sunday, January 7, 2018 Simple Graph 3


Adjacent, neighbors
• Two vertices are adjacent and are
neighbors if they are the endpoints of an
edge
• Example:
• A and B are adjacent
• A and D are not adjacent

A B

C D
Sunday, January 7, 2018 4
Adjacency, Incidence, and Degree
• Assume ei is an edge whose endpoints are (vj,vk)
• The vertices vj and vk are said to be adjacent
• The edge ei is said to be incident upon vj (and also
v k)
• Degree of a vertex vk is the number of edges
incident upon vk ; more precisely, an edge contributes
one degree to each of its end-points. It is denoted as
d(vk) – usually used only for loop-less graphs.

ei
vj vk

Sunday, January 7, 2018


Basic Result about Vertex Degrees

Proposition 1: Let G be a graph. Then, the sum of the


degrees of the vertices is twice the number of edges, i.e.
 d (v) = 2 | E(G)|
v  V(G)

Proof: Each edge contributes 2 degrees (to the vertices of G);


one to each of its end-points.

Sunday, January 7, 2018 6


Adjacency matrix
• Let G = (V, E), |V| = n and |E|=m
• The adjacency matrix of G written A(G), is
the n-by-n matrix in which entry ai,j is the
number of edges in G with endpoints {vi, vj}.

w w x y z
b w 0 1 1 0
y z x 1 0
a c 2 0
e y 1 2 0 1
x d
z 0 0 1 0

Sunday, January 7, 2018 7


Incidence Matrix
• Let G = (V, E), |V| = n and |E|=m
• The incidence matrix M(G) is the n-by-m
matrix in which entry mi,j is 1 if vi is an
endpoint of ei and otherwise is 0.

w a b c d e
b w 1
y 1 0 0 0
a c z x 1 0 1 1 0
e
d y 0 1 1 1 1
x
z 0 0 0 0 1

Sunday, January 7, 2018 8


Complement
• Complement of G: The complement G’ of a simple
graph G :
• A simple graph
• V(G’) = V(G)
• E(G’) = { uv | uv E(G) }
• The complement is not defined for general graphs
because we want the complement of the complement
to be the original graph, i.e. we want (G’)’ = G to hold.
u
u
y
y v v
G
G’
w x w
x

Sunday, January 7, 2018 9


Subgraphs
• A subgraph of a graph G is a graph H such
that:
• V(H)  V(G) and E(H)  E(G) and
• The assignment of endpoints to edges in H is the
same as in G

• An induced subgraph of G is a subgraph H of G


such that E(H) consists of all edges of G whose
endpoints belong to V(H)

Sunday, January 7, 2018 10


Subgraphs
• Example: H1, H2, and H3 are subgraphs of
G
a b

G c

e d

a b
a b
c H3 c
H1 H2
d e d
e d

Sunday, January 7, 2018 11


Clique and Independent Set
• Complete Graph : a simple graph whose vertices are
pairwise adjacent

• We use the notation Kn to denote a complete graph of n


vertices
• How many edges in Kn ?
• The complement Kn’ of Kn has no edges
• What does an induced subgraph of a complete graph look like?
Sunday, January 7, 2018 12
Clique and Independent Set
• A Clique in a graph: a set of pairwise
adjacent vertices (a complete subgraph)
• An independent set in a graph: a set of
pairwise nonadjacent vertices
• Example: u
• {x, y, u} is a clique in G G
• {u, w} is an independent set y v

x w

Sunday, January 7, 2018 13

Вам также может понравиться