Advertisement
Guest User

Untitled

a guest
May 20th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. while (!pQueue.empty())
  2. {
  3. int u = pQueue.top().first;
  4. pQueue.pop();
  5.  
  6. for (int i = 0; i < edge; i++)
  7. {
  8. int v = incMatrix[][];
  9. int weight = incMatrix[][];
  10.  
  11. if (incMatrix[u][i] == 1)
  12. {
  13. for (int j = 0; j < vertex; j++)
  14. {
  15. if (incMatrix[j][u] == -1)
  16. {
  17. distance[v] = distance[u] + weight;
  18. pQueue.push(std::make_pair(distance[v], v));
  19. }
  20. }
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement