Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (!pQueue.empty())
- {
- int u = pQueue.top().first;
- pQueue.pop();
- for (int i = 0; i < edge; i++)
- {
- int v = incMatrix[][];
- int weight = incMatrix[][];
- if (incMatrix[u][i] == 1)
- {
- for (int j = 0; j < vertex; j++)
- {
- if (incMatrix[j][u] == -1)
- {
- distance[v] = distance[u] + weight;
- pQueue.push(std::make_pair(distance[v], v));
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement