\bɹˈuːt fˈɔːs], \bɹˈuːt fˈɔːs], \b_ɹ_ˈuː_t f_ˈɔː_s]\
Definitions of BRUTE FORCE
Sort: Oldest first
A primitive programming style in which theprogrammer relies on the computer's processing power insteadof using his own intelligence to simplify the problem, oftenignoring problems of scale and applying naive methods suitedto small problems directly to large ones. The term can alsobe used in reference to programming style: brute-forceprograms are written in a heavy-handed, tedious way, full ofrepetition and devoid of any elegance or useful abstraction(see also brute force and ignorance).The canonical example of a brute-force algorithm isassociated with the "travelling salesman problem" (TSP), aclassical NP-hard problem:Suppose a person is in, say, Boston, and wishes to drive to Nother cities. In what order should the cities be visited inorder to minimise the distance travelled?The brute-force method is to simply generate all possibleroutes and compare the distances; while guaranteed to work andsimple to implement, this algorithm is clearly very stupid inthat it considers even obviously absurd routes (like goingfrom Boston to Houston via San Francisco and New York, in thatorder). For very small N it works well, but it rapidlybecomes absurdly inefficient when N increases (for N = 15,there are already 1,307,674,368,000 possible routes toconsider, and for N = 1000 - well, see bignum). Sometimes,unfortunately, there is no better general solution than bruteforce. See also NP-complete.A more simple-minded example of brute-force programming isfinding the smallest number in a large list by first using anexisting program to sort the list in ascending order, and thenpicking the first number off the front.Whether brute-force programming should actually be consideredstupid or not depends on the context; if the problem is notterribly big, the extra CPU time spent on a brute-forcesolution may cost less than the programmer time it would taketo develop a more "intelligent" algorithm. Additionally, amore intelligent algorithm may imply more long-term complexitycost and bug-chasing than are justified by the speedimprovement.When applied to cryptography, it is usually known as bruteforce attack.Ken Thompson, co-inventor of Unix, is reported to haveuttered the epigram "When in doubt, use brute force". Heprobably intended this as a ha ha only serious, but theoriginal Unix kernel's preference for simple, robust andportable algorithms over brittle "smart" ones does seem tohave been a significant factor in the success of thatoperating system. Like so many other tradeoffs in softwaredesign, the choice between brute force and complex,finely-tuned cleverness is often a difficult one that requiresboth engineering savvy and delicate aesthetic judgment.
By Denis Howe