We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Minimum conflict algorithm was very slow for me. But I could optimize it using intensive parallelism and an observation to count straight line conflicts.
The observation is, if and are two lattice points, then an other lattice point on the straight line would have this form,
where and .
Using this would reduce number of iteration in huge factor. Parallelism helps because most of the work in each iteration is independent.
Using this, I was able to find a solution within one hour.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Spies, Revised
You are viewing a single comment's thread. Return to all comments →
Minimum conflict algorithm was very slow for me. But I could optimize it using intensive parallelism and an observation to count straight line conflicts.
The observation is, if and are two lattice points, then an other lattice point on the straight line would have this form,
Using this would reduce number of iteration in huge factor. Parallelism helps because most of the work in each iteration is independent.
Using this, I was able to find a solution within one hour.