Advertisement
xopsuei

costs

Dec 12th, 2012
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. //iterate until there are no elements
  2. int u, v, c;
  3. while(not pq.empty()){
  4. pq.max(u,v,c);
  5. sides[u] = not sides[u];
  6. sides[v] = not sides[v];
  7.  
  8. //uptate cost or delete
  9. int cost = get_cost(u, v, neighbours, neighbours_position, sides);
  10. if(cost > 0) pq.assign(u, v, cost);
  11. else pq.erase(u, v);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement