ski
Well-Known Member
- Joined
- Feb 12, 2010
- Messages
- 3,720
Brute force is often times the worst solution, it's runtime is exponential O(c^n) which is inefficient. There are plenty of generic algorithms available publicly, for doing searches for instances you have merge sort O(n log n) or quick sort O(n log n) (but, can be faster by some multiple). I am sure you could implement some efficient algorithm although, when your dealing with graphs (which I am assuming) finding shortest paths can be difficultbut, certainly better than brute force for instance Floyd algorithm for shortest path is average O(|v|^3) v= vertices.
He was joking
