Idiomatic backtracking in Python

Mark Lawrence breamoreboy at yahoo.co.uk
Mon Jan 26 03:06:16 EST 2015


On 26/01/2015 00:32, Ben Finney wrote:
> Johannes Bauer <dfnsonfsduifb at gmx.de> writes:
>
>> So, I would like to ask if you have a Pythonic approach to
>> backtracking problems? If so, I'd love to hear your solutions!
>
> I'm not aware of what the problem is. “Back-tracking” doesn't have a
> general meaning I recognise beyond random access into a data structure.
> So a Python list is the obvious starting point.
>
> Do you have a specific meaning of “back-tracking” that implies
> particular problems that are difficult to solve?
>

As good a definition here http://en.wikipedia.org/wiki/Backtracking as 
any.  As elsewhere in this thread it mentions sudoku.  To me this 
http://norvig.com/sudoku.html is a classic example of putting theory 
into practice.  Read and weep :)

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence




More information about the Python-list mailing list