Dijkstra

From Algowiki
Revision as of 17:26, 22 September 2014 by JanR (talk | contribs)
Jump to navigation Jump to search

Das is de Disjkstra


dhg

Pseudocode

DIJKSTRA(G,w,s)
INITIALIZE-SINGLE-SOURCE(G,s) 
     S = ∅
     Q = G.V
      while Q  ∅
           u = EXTRACT-MIN(Q)
           S = S {u} 
           for each vertex v  G.Adj[u]
                RELAX(u,v,w)

INSERTION-SORT(A)
   for j=2 to A.länge
      schlüssel=A[j]
      //füge A[j] in den sortierten Beginn des Arrays A[1..j-1] ein
      i=j-1
      while i>0 und A[i]>schlüssel
         A[i+1]=A[i]
         i=i-1
      A[i+1]=schlüssel