Anda di halaman 1dari 6

c 

     
        

 
 
 

     
  

     
      
     !"        ! 
   !     #  
    
  
 $  



c 

 
1.V INITIALIZE SINGLE-SOURCE (G, s)
2.V S і { } // S will ultimately contains vertices of final
shortest-path weights from s
3.V Initialize priority queue Q i.e., Q і V[G]
4.V while priority queue Q is not empty do
5.V u і EXTRACT_MIN(Q) // Pull out new vertex
6.V S і S† †{u}
// Perform relaxation for each vertex adjacent to u
7.V for each vertex v in Adj[u] do
8.V Relax (u, , )
VV



VV

V V
V V    V V V  V


!%$     
 $&'"()         
     * 

!+#            ,    -
./ *  !0     1 '
   
  )   


!23    0     1
   '
      
  )


!45         !0   
 '   6)

!75      3    
 
 


!8#             
      







‰ 
(903:;5<'")  ="=     
+
    (903:;5    <'" )!      

     =(=     =(=    
  
<'%) >  
   
    
+
    <'" ?()&<'"+)


‰       


 (903:;5  <'
")  ="= 
 
     <'") 
< c(30(!('  0(@9)<'
")   
   
>  
   
        

  
 <''"?()
")5     <'(
")   
 
         



‰ 
    -    ="=(90:;5   <'
")
< c(30(!(:A(B    0(@9   <'%)
  -     =(=

     c 
       
 
  
 

5 
       c 

          3   
    
"&CD(&C')')')D @')&%@')&+@')&
+
c 
  
./&%./&+E  
 

@'
)       %+&%

 V
V V V V
V

V   V

V   V V V V

Vë  


VV V   V  V  V   V V V V V V V  V V V V
V V V V VV V

V   V VVV V V V V V   V V V V V V V V
V  V  
VV 
!"#$
V V VVV  V V  V

  V V V   V V V   %V V V  V V V

&V '  VV  V V V V   V V V  V

(V '  VV V V   V V V V VV V V  V) V V VV

 V  VV V V  VV V V V   V V V V  V
$  V V   V V VV V)V V 
VV   V V VV V V V
  V V V V  V
V V V V V V  V) V V V V

V   V V V V  VV V   V 


VV *V V V V
 VV  V  V

º 

[hide]

V 1 Disadvantages of Flooding

V 2 Advantages of Flooding

V 3 See also

V 4 Examples

  +!   V VV

  V V V   V V V    V V  V, VV V   VV  V V V  V  V
  V V V V VV VV  V V V VV V V V  V V  V V
 )V V VV V  V

# V V VV VV V  V   V  V V VV V  V  V VV
V - V V  VV V) V V  V V V

V   V V V Vselective floodingV  V  V VVVVV  V V   VV


V V  V

  +  V VV

 V V   V V VV V  V   V VV V  V VV V VVV
 V V  VV V V  V VV  V  V V   V V  V,V  
V V VV   V
V  V  V V   VV V