Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.078 X-Spam-Evidence: '*H*': 0.84; '*S*': 0.00; 'wednesday,': 0.07; 'second.': 0.09; 'python': 0.11; 'bug': 0.12; 'posted': 0.15; 'clues': 0.16; 'solver.': 0.16; 'wrote:': 0.18; 'wed,': 0.18; '(the': 0.22; '>>>': 0.22; 'post': 0.26; 'values': 0.27; 'header :In-Reply-To:1': 0.27; 'bigger': 0.30; 'message- id:@mail.gmail.com': 0.30; 'code': 0.31; '25,': 0.31; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'in.': 0.36; 'so,': 0.37; 'filled': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'expect': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'march': 0.61; 'john': 0.61; 'times': 0.62; 'complete': 0.62; 'mar': 0.68; 'await': 0.74; 'million': 0.74; '2015': 0.84; 'milliseconds': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=th0UPf0XL8Gq57WZqWdokXis5Vu7f2N89IfPsTuF6/0=; b=eQQoAOtlxKyEKEWc08xZv6nH6Hgk/M77LogBgWEOuSY3nqV86JjvfUrgOMtQh9vcri i+aWfWPrZk7Tbr91J0uuReox9XPF3NhTPp+czVQTTcDGFyAPs3bk3hK1QeustjQ1Uo/H 7FMw1v5IjXxlMjBCTZ/xHVd3zioZomHZr97Va+zvE4OPS3CDerWTGrCRO/XzAVEdw/WZ iRlMjgJvM6nDoZG+4w/4ifT5hlw4GZXJea9Hx1Ebp0Nb/2OlUl772gneOLgS3cf2epFP StkRKtxzw/7gIKOnODPLr/TcHBwGIk+CNOkBcEbkIYrOOMlABYPX0Eyj+S8NkEmzOH7d Tg0g== X-Received: by 10.66.90.168 with SMTP id bx8mr20320850pab.53.1427314239594; Wed, 25 Mar 2015 13:10:39 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <87twx8amww.fsf@elektro.pacujo.net> References: <87r3sdnw5t.fsf@elektro.pacujo.net> <4e81bdb9-52db-46e6-b449-d4241cb2a3f2@googlegroups.com> <87twx8amww.fsf@elektro.pacujo.net> From: Ian Kelly Date: Wed, 25 Mar 2015 14:09:59 -0600 Subject: Re: Sudoku solver To: Python 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1427314248 news.xs4all.nl 2900 [2001:888:2000:d::a6]:39812 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3831 X-Received-Body-CRC: 2909027058 Xref: csiph.com comp.lang.python:87977 On Wed, Mar 25, 2015 at 1:37 PM, Marko Rauhamaa wrote: > John Ladasky : > >> On Wednesday, March 25, 2015 at 4:39:40 AM UTC-7, Marko Rauhamaa wrote: >> >>> I post below a sudoku solver. I eagerly await neater implementations (as >>> well as bug reports). >> >> So, it's a brute-force, recursive solver? The code is nice and short. >> But I bet it takes a long time to run. > > Try it. > > The C version takes milliseconds to complete (usually). The Python > version can take the bigger part of a second. The test puzzle that you posted has 23 values already filled in. How does it perform on harder puzzles with only 17 clues (the proven minimum)? One would expect it to be around a million times slower.