Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'algorithm': 0.04; 'odd': 0.07; 'test,': 0.07; 'counting': 0.09; 'historic': 0.09; 'cc:addr :python-list': 0.11; 'ah,': 0.16; 'cease': 0.16; 'force.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'knock': 0.16; 'wizard': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'cc:addr:python.org': 0.22; 'instance,': 0.24; 'tend': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'point': 0.28; 'absolute': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; "d'aprano": 0.31; 'dramatic': 0.31; 'steven': 0.31; 'open': 0.33; '"the': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'representing': 0.36; 'pm,': 0.38; 'does': 0.39; 'either': 0.39; 'even': 0.60; "you'll": 0.62; "you've": 0.63; 'mar': 0.68; 'square': 0.74; '2015': 0.84; 'divide': 0.84; 'dust': 0.84; 'improvement,': 0.84; 'lift': 0.91; 'mean.': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=LaDjlwfsLDZjX4OHeXtnuyBzdfDVlu3Nrk4K+ETtcoA=; b=vSf+5gikVA4i0o1gdyomB8xypmmfyLR2Y2V9T0OjNdCdpYUK+DBHY6J5AcxNcrhD10 210DKEjVYI8eVJzmXUl1yudZFu7tWrI/Sna4BBf4I/sfvC5xXumZQwDKXlnf7PTA4+Sz zWxr6rFBtYUc52n01FI+SVzTvMVrTXhA/ODk2DAnMMRuN1I64uevncfmB59VdDW/uxnR c9D8gSyhjxiZn3IMnExxy35Xyd6zrV8RYrTRwssQJiRTFxnAYEM6Ta+4ydxMIKIARw0B reXHNUDmmowF2BWhWrQJq7RfJfgl95ELQDYAwHq74Dg8zzYLobC+ZcNiUVvhdIIs9jQj 9/WA== MIME-Version: 1.0 X-Received: by 10.50.9.97 with SMTP id y1mr10718107iga.34.1427626444279; Sun, 29 Mar 2015 03:54:04 -0700 (PDT) In-Reply-To: <5517d590$0$12982$c3e8da3$5496439d@news.astraweb.com> References: <87r3sdnw5t.fsf@elektro.pacujo.net> <4e81bdb9-52db-46e6-b449-d4241cb2a3f2@googlegroups.com> <87twx8amww.fsf@elektro.pacujo.net> <82e7c5b9-2f0f-405b-859c-b74916c475e0@googlegroups.com> <55176c2c$0$13009$c3e8da3$5496439d@news.astraweb.com> <5517d590$0$12982$c3e8da3$5496439d@news.astraweb.com> Date: Sun, 29 Mar 2015 21:54:04 +1100 Subject: Re: Sudoku solver From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1427626447 news.xs4all.nl 2921 [2001:888:2000:d::a6]:43623 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:88258 On Sun, Mar 29, 2015 at 9:35 PM, Steven D'Aprano wrote: > Anyway, we don't really know where the confusion lies. Perhaps the > description is misleading, or I'm just confused, or Bart's idea of brute > force is not the same as my idea of brute force, or perhaps he really is a > super-genius who has casually relegated C to the dust bin of historic > languages... Ah, I see what you mean. I tend to describe an algorithm as "brute force" even if it has a few simplifications and early cut-offs. A brute-force primality test, for instance, might divide the target number by every counting number since 1, looking for a remainder; does it cease to be brute-force if you check only 2 and odd numbers? only those up to its square root? Either of those tiny optimizations will give a dramatic speed improvement, without representing a flaw; and I would still consider them brute force. The purest form is a barbarian trying to lift a gate; the slightly-optimized is a wizard trying to lift the same gate; but neither algorithm is using a Knock spell to open it by magic. And if you've seen "The Gamers", you'll know that brute force is as fickle as a roll of the dice..... Point is, "brute force" isn't a pure absolute from which there can be no variation. ChrisA