

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The implementation and analysis of two las vegas style algorithms to find a single solution to the n-queens problem using mpi. Pseudo-code for both algorithms and discusses the challenges of determining an effective exit strategy for the parallel solution. A comparison to dr. Rolfe's java threads implementation is also mentioned.
Typology: Exams
1 / 2
This page cannot be seen from the preview
Don't miss anything!
repeat set valid to true shuffle the current permutation vector set the two diagonal vectors to all false mark the row 0 queen in the two diagonal vectors for row = 1 to n- set test = row+ while this queen is on an in-use diagonal if test = n set valid to false break out of the while loop else swap positions row and test increment test end if/else end while if not valid break out of the for loop mark this row’s queen in the diagonal vectors end for loop until valid
repeat set valid to true boolean matrix blocked[n][n] set to all false for row = 0 to n– randomly select col as an unblocked cell if there is NO unblocked cell set valid to false and break from for loop save col as part of the solution vector for all rows below the current row mark as blocked the col cell also diagonal cells blocked by [row][col] end for end for loop until valid