Closed sebdied closed 10 years ago
Pseudocode Implementation
vars Start, Queue, End, Visited
Start = a node
End = a node
Queue = a queue
Visited = a map
while (Queue has items)
Current = Queue removefirst
for Node in Current
if Node == End
break
endif
if not Node in Visited
Visited add Node
endif
Nodescore = (Current score) + (getedgescore Current to Node)
if Nodescore < (Visited getscore Node)
Visited setparent Node to Current
Visited setscore Node to (Current score) + (getedgescore Current to Node)
endif
endfor
endwhile
if not End in Visited
Error "End not in graph"
else
Success "Path found, Score: " + Visited getscore End
endif
Finished as of d45b9cb
breadth - Breitensuche