Research Article
Information Spread of Emergency Events: Path Searching on Social Networks
function Dijkstra(Graph, source): | for each vertex v in Graph: | distv infinity | previousv undefined | // save the specific path | distsource 0 | Qthe set of all nodes in Graph | //initialize the graph | while Q is not empty: | u node in Q with smallest dist | remove u from Q | for each neighbor v of u: | newdist distu + | dist_between(u, v) | if newdist < distv | //do relaxation operation | distv alt | previousv u | return previous |
|