Professional Documents
Culture Documents
Lecture 1
Lecture 1
Lecture 1
GRAPH-THEORY
A Rules
.1
B D .2
C
Your solution
33
Map Graph
A
B
C
River
Island
Island
B C
:Other examples
.Electrical eng •
Biochemistry •
Music Computer science •
Physics •
Applications in computer Science
14
(1)
Since computer science is not a concrete/centralized
.subject, we can introduce graph theory in many areas
But where
Facebook is based in
graph theory
Applications in computer Science
17
(4)
Workflow: It’s sequence of processes through which a
piece of work passes from initiation to completion. Can
.be also represented as directed graph
Applications in computer Science
18
(5)
Neural Networks: A series of algorithms that
attempt to identify underlying relationships in a set
of data by using a process that mimics the way
.the human brain operates
Applications in computer Science
19
(6)
:Google Maps
Graph Operations (1)
20
Basic Operations
Graph Operations (2)
1 1 3
3
5 4 5 4
Presentations of graphs
28
Drawing v3
e2
v4
e3
e5
Incidence matrix v2
e4 v5
e1 e6
v1
e6 e5 e4 e3 e2 e1
2 0 0 0 0 1 v1
0 0 1 0 1 1 v2
Degree of a vertex,
0 1 0 1 1 0 v3
Regular graph
0 0 0 0 0 0 v4 Hand shaking lemma
0 1 1 1 0 0 v5
Presentations of graphs
29
Adjacency matrix v3
e2
v5 v4 v3 v2 v1 v4
0 0 0 1 2 v1 e3
1 0 1 0 1 v2 e4 e5
v5
v2
2 0 0 1 0 v3
e1 e6
v1
0 0 0 0 0 v4
0 0 2 1 0 v5
Directed Graphs
30
e2 v3
v4
Adjacency matrix e3
v5 v4 v3 v2 v1 e4 e5
v5
0 0 0 0 1 v2
v1
e1 e6
0 0 1 0 1 v2 v1
1 0 0 0 0 v3
0 0 0 0 0 v4
0 0 1 1 0 v5
Weighted Graphs
31
2 v3
v4
Adjacency matrix 2
5
v5 v4 v3 v2 v1 3 v5
0 0 0 0 3 v2
v1
1 3
0 0 2 0 1 v2 v1
2 0 0 0 0 v3
0 0 0 0 0 v4
0 0 5 3 0 v5
Graphs as models
32
Personnel
assignment
problems.
(assigning people to
jobs, arranging
weddings, finding
appropriate
roommates, etc.)
Social networks.
Graphs as models
34
women men
w1 m1
w2 m2
w3 m3
w4 m4
w5 m5
women men
w1 m1
w2 m2
w3 m3
w4 m4
w5 m5
workers machines
w1 1 m1
3
1
w2 2 m2
1.5
2
w3 2 m3
1.7 4
w4 m4
3
2
w5 m5
women men
w1 1 m1
1
1 Does there exist a
w2 2 m2 stable marriage?
1.5
2
w3 2 m3
1.7 4
w4 m4
3
2
w5 m5
m teachers, n classes.
T1 C1
Teacher i is required to teach
class j for Pij periods. T2 C2
In a given period a teacher can
be in at most 1 class, and a C3
class can have at most 1
teacher.
Design a timetable with
Cn
minimum no. of periods.
Tractable! Tm
Timetabling problems
42
m teachers, n classes.
T1 C1
Teacher i is required to teach
class j for Pij periods. T2 C2
In a given period a teacher can
be in at most 1 class, and a C3
class can have at most 1
teacher.
Design a timetable with
Cn
minimum no. of periods.
Tractable! Tm
Properly color the edges of G
with as few colors as possible.
Edge coloring of graphs
43
Lahore
Intractable!
Faisalabad Hyderabad
Karachi Islamabad
Peshawar