You are on page 1of 22

 SejarahGraf: masalah jembatan Knigsberg

(tahun 1736)

 Bisakah
melalui setiap jembatan tepat sekali
dan kembali lagi ke tempat semula?
C

A D

B
Aplikasi Graph

Rembang
Kudus
Brebes Demak
Tegal Pemalang Kendal
Semarang

Pekalongan
Slawi Blora

Temanggung Purwodadi
Salatiga
Wonosobo
Purbalingga
Purwokerto
Sragen
Banjarnegara Boyolali Solo

Kroya Sukoharjo
Cilacap Kebumen Magela ng
Klate n
Purworejo
Wonogir i
Living room
Living room
Sitting
room Hall
study study Sitting room Hall

playroom kitchen Dining room


playroom kitchen Dining room

Definitions. A Graph G consists of a non-empty set of


elements, called vertices, and a list of unordered pairs of
these elements, called edges.
The set of vertices : vertex-set (V(G).
The list of edges : edge-list (E(G))
• Edge vw or wv : join v and w
• Two or more edges joining the same pair of vertices : multiple
edges
• Edge joining a vertex to itself : loop
• Graph with no loops or multiple edges : simple
• Graph
– in one pieces : connected
– splits to several pieces : disconnected

connected non-simple graph disconnected simple graph


v b d

Multiple edge

u loop a c e
w
Subgraph
• Definition. Let G be a graph with vertex-set V(G) and edge-list E(G). A subgraph of G
is a graph all of whose vertices belong to V(G) and all of whose edges belong to E(G).

G a subgraph of G

v v

Multiple edge

u loop loop
w w
The degree of a vertex
• Definition. Let G be a graph without loops, and v be a vertex
of G. The degree of v is the number of edges meeting at v,
denoted by deg v.

• All vertices of G have the same degree : G is regular

• The hand shaking lemma. In any graph , the sum of all the
vertex-degrees is equal to twice the number of edges.
• Proof. Each edge has two ends : it must contribute exactly 2
to the sum of the degrees.
Isomorphic graph

• Definition. Two Graphs G and H are isomorphic if H


can be obtained from G by relabelling the vertices.

v w v

w v
w
Paths and Sycles
Definition. A walk of length k in a graph G is a succesion of k
edges of G of the form uv,vw,wx,…yz. (denote this walk by
uvwx…yz and refer to it as a walk beetwen u and z)

– all the edges are different: trail


– all the edges and all the vertices are different: path
– Walk of the form uv,vw,wx,…yz,zu: closed walk
– Closed trail whose vertices are all different : cycle

Definition. A graph G is connected if there is a path in G


between any given pair of vertices, and disconnected
otherwise.
Examples of graphs
Complete graphs: every two distinct vertices are joined
by exactly one edge.
Null graphs: containing no edges.
Cycle graphs: consisting of a single cycle.
Path graphs: consisting of a single path.
Bipartite graph: whose vertex-set can be split into sets
A and B in such a way that each edge of the graph joins
a vertex in A to B.
Tree: connected graph containing no cycles.
Adjacency and Incidence
 Definition. Let v and w be vertices of a graph. If v and w
are joined by an edge e, then
 v and w are said to be adjacent

 v and w are said to be incident with e

 e is said to be incident with v and w.


Tinjau graf dibawah :

2 3

 titik 1 bertetangga dengan4 titik 2 dan 3, titik 1 tidak


bertetangga dengan titik 4.
 garis (2, 3) bersisian dengan titik 2 dan titik 3, garis (2, 4)
bersisian dengan titik 2 dan titik 4, tetapi garis (1, 2) tidak
bersisian dengan titik 4.
 Definition. Let G be a graph without loops, with n vertices
labeled 1,2,3,…,n. The adjacency matrix M(G) is the n x n
matrix in which the entry in row i and column j is the number
of edges joining the vertices i and j.

 Definition. Let G be a graph without loops, with n vertices


labeled 1,2,3,…,n and m edges labeled 1,2,3,…,m. The
incidence matrix I(G) is the n x m matrix in which the entry in
row i and column j is
 1 if vertex i is incident with edge j, and

 0 otherwise.
DIGRAPH
 Definition. A digraph D consist of a set of elements, called
vertices, and a list of ordered pairs of these elements, called
arcs.
 The set of vertices : vertex-set (V(D).

 The list of arcs : arcs-list (A(D)).


 Definition. Let D be a digraph. The underlying graph of D
is the graph obtained by replacing each arch of D by the
corresponding (undirected) edge.
 Two or more arcs joining the same pair of
vertices in the same direction : multiple arcs
 Arch joining a vertex to itself : loop
 Digraph with no loops or multiple arcs :
simple

loop
Multiple
arcs
 Definition. Let D be a digraph with vertex-set
V(D) and arc-list A(D). A subdigraph of D is a
digraph all of whose vertices belong to V(D)
and all of whose arcs belong to A(D).

 Digraph D Subdigraph of D
v
v

u u
w w
 Definition. Two digraphs C and D are
isomorphic if D can be obtained from C by
relabelling the vertices.

v 1 3

 Noteu that: w 2
 uv corresponds to 12
 vw corresponds to 23
 wv corresponds to 32
 uw corresponds to 13
Adjacency and Incidence
 Definition. Let v and w be vertices of a
digraph. If v and w are joined by an arc e, then
 v and w are said to be adjacent

 e is said to be incident from v

 e is said to be incident to w

Example:
e
v w
 Definition. Let D be a digraph without loops,
with n vertices labeled 1,2,3,…,n. The adjacency
matrix M(D) is the n x n matrix in which the
entry in row i and column j is the number of arcs
from vertex i to vertex j.
 Definition. Let D be a digraph without loops,
with n vertices labeled 1,2,3,…,n and m arcs
labeled 1,2,3,…,m. The incidence matrix I(D) is
the n x m matrix in which the entry in row i and
column j is
 1, if arc j is incident from vertex i,
 -1, if arc j is incident to vertex i,
 0, otherwise.
Paths and Sycles
 Definition. A walk of length k in a digraph D is a
succesion of k arcs of D of the form uv,vw,wx,…yz.
(denote this walk by uvwx…yz and refer to it as a walk
from u to z)
 all the arcs are different: trail
 all the arcs and all the vertices are different: path
 Walk of the form uv,vw,wx,…yz,zu: closed walk
 Closed trail whose vertices are all different : cycle
 Definition. A digraph D is connected if its underlying
graph is a connected graph. It is strongly connected if
there is a path in D from any vertex to any other.
 Definition. A graph G is orientable if it is the
underlying graph of strongly connected
digraph.

 Definition. An edge in a connected graph is a


bridge if its removal leaves a diconnected
graph.

 Theorem. A connected graph G is orientable iff


it has no bridge.
The degree of a vertex
 Definition. Let D be a digraph without loops, and v
be a vertex of D. The out-degree of v is the number of
arcs incident from v, denoted by outdeg v. Similarly,
the in-degree of v is the number of arcs incident to v,
and denoted by indeg v.
 The out-degree sequence of D is the sequence
obtained by listing the out-degrees in non-decreasing
order. The in-degree sequence is defined analogously.
 The hand shaking lemma. In any digraph, the sum of
all the out-degrees and the sum of all in-degrees are
equal to the number of arcs.
Proof. Each arc has two ends : it must contribute
exactly 1 to the sum of the in-degrees.
SELESAI

• TERIMA KASIH

You might also like