Advertisement
Guest User

distributed BFS

a guest
Oct 28th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. lets say there are n computers, C(1), ..., C(n)
  2. load 6gb of table space into each one
  3.  
  4. start:
  5.  
  6. on C(k), loop i=(6e9)(k-1) to (6e9)k-1
  7. decode i, apply move, encode puzzle into new number j
  8. if (6e9)(k-1) <= j < (6e9)k, update the table as normal
  9. else, find the integer k' such that (6e9)(k'-1) <= j < (6e9)k' and append j to the list l[k']
  10. save each list l[r] to a file "ck_cr.txt" (a "communication file" from computer k to computer r)
  11. wait for every computer to get to this point
  12.  
  13. on C(k), loop through the files "ci_ck.txt" for all i=1..n where i!=k
  14. for each number in the file, set the corresponding value in the table to the right depth
  15. delete "ci_ck.txt"
  16. wait for every computer to get to this point
  17.  
  18. goto start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement