You are on page 1of 19

Lecture 6:  

Graph  Theory  and


Longest  Paths

©  J.  Christopher  Beck  2015 1


Outline
n What  is  Graph  Theory?
n Graph  Theory  Basics
n Finding  the  Longest  Path
n Why?
n How?

©  J.  Christopher  Beck  2015 2


Readings

n Wikipedia  (“Graph  Theory”),  accessed  


May  5th,  2016
n Wikipedia  (“Seven  Bridges  of  
Königsberg”),  accessed  May  5th,  2016
n If  you  want  to  know  more:  Gibbons,
Algorithmic  Graph  Theory,  Cambridge  
University  Press,  1985
©  J.  Christopher  Beck  2015 3
n Who  is  
this  man?

©  J.  Christopher  Beck  2015 4


The  Bridges  of  Königsberg
n Can  you  walk  a  
route  that  crosses  
each  bridge
exactly  once?
n Euler,  1736

Islands Bridges

©  J.  Christopher  Beck  2015 5


The  Bridges  of  Königsberg
Edge  or  arc

Node  or  vertex

©  J.  Christopher  Beck  2015 6


The  Bridges  of  Königsberg
n So,  now  the  
problem  is:  can  
you  traverse  every  
edge  exactly  once?
n Any  ideas?

©  J.  Christopher  Beck  2015 7


Graph  Theory
n Nodes  and  edges  form  a  graph,  G(V,E),  
with  V  being  the  set  of  nodes,  E  being  
the  set  of  edges
n Edges  may  be  directed  or  un-­directed
n Edges  may  have  a  weight
n A  number  associated  with  each  edge

©  J.  Christopher  Beck  2015 8


The  Bridges  of  Konigsberg
n So,  now  the  
problem  is:  can  
you  traverse  every  
edge  exactly  once?
n Any  ideas?

©  J.  Christopher  Beck  2015 9


The  Bridges  of  Königsberg
n Can you  traverse every
edge  exactly  once?

n Eulerian Path
n Eulerian Circuit
n A graph  with  an  Eulerian circuit  or  
path  is  called  an  Eulerian graph

©  J.  Christopher  Beck  2015 10


The  Bridges  of  Königsberg
n Thm 6.1  [Gibbons]:  An  undirected  
multi-­graph  G,  has  an  Eulerian circuit  
(or  path)  if  and  only  if  it  is  connected  
and  the  number  of  vertices  with  odd  
degree  is  0  or  2.
n Proof:  
n (see  Gibbons,  p.  155)

©  J.  Christopher  Beck  2015 11


Graph  Theory
n Graph  theory  is  
the  secret  to  the
universe
n A  tremendous  number  of  problems  can  
be  modeled  and reasoned  about  using  
graph  theory
n OR,  epidemiology,   geometry,  IT  (the  web  
is  a  graph),  social  networks,  biological  
pathways,  chemical  reactions,  …
12
©  J.  Christopher  Beck  2015
n Where  did  we
already  use  graph  
theory?

©  J.  Christopher  Beck  2015 13


Cuts  Sets  &  Minimal  Cut  Sets
V  is  a  set  of  nodes
n Given  a  graph  G(V,E) E  is  set  of  edges  (arcs)
n A  cut  set is  a  set  of  nodes S ⊂ V
such  that  in  the  graph  formed  by  
removing  the  nodes  in  S  from  G  there  is  
no  path  from  the  source  to  the  sink
n A  minimal  cut  set is  i)  a  cut  set  such  
that  ii)  none of  its  proper  subsets  is  a  
cut  set
©  J.  Christopher  Beck  2015 14
CPM
n Can  we  pose  this  as  a
graph  theory  problem?
n Why  would  we  want  to?

©  J.  Christopher  Beck  2015 15


CPM  Model
n Job          Node
n Precedence   Directed  Edge
n Processing  time          Edge  Weight
n This  is  the  job-­on-­arc  format  [Pinedo,  p52]

©  J.  Christopher  Beck  2015 16


Our  Small  Example
1

Job p(j) Predecessors


2 4 6
1 2 -­
2 3 -­
3 1 -­ 3 5

4 4 1,2 1 2
5 2 2 3 4
2 4 6
6 1 4 3
3 5

©  J.  Christopher  Beck  2015 What  are  we  missing? 17


Dummy  Nodes
1

2 4 6

3 5 1 2
0
0 3 4
0 2 4 6 1
3 7
0 2
3 5
1

Two  dummy  nodes


©  J.  Christopher  Beck  2015 (0  and  n+1) 18
Makespan?
n How  do  we  find  the  
makespan?
n Critical  Path?

1 2
0
0 3 4
0 2 4 6 1
3 7
0 2
3 5
1

©  J.  Christopher  Beck  2015 19

You might also like