If you can find the best O (N ^ 2) algorithm, you can post it!
This problem is 3-SUM Hard , and is there a sub-quadratic algorithm (i.e. better than O (N ^ 2)) since this is an open problem. It has been shown that many common computational geometry problems (including yours) are 3SUM complex, and this class of problems is growing. Like NP-Hardness, the 3SUM-Hardness concept has proven useful in proving the βhardnessβ of some problems.
To prove that your problem is 3SUM, refer to the excellent paper with the inscription here: http://www.cs.mcgill.ca/~jking/papers/3sumhard.pdf
Your problem appears on page 3 (conveniently called 3-POINTS-ON-LINE) in the above article.
So, the most famous algorithm at present is O (N ^ 2), and you already have it :-)
Aryabhatta May 7 '10 at 4:58 a.m. 2010-05-07 04:58
source share