On Wed, Feb 4, 2015 at 8:16 AM, Dave Angel wrote:
>> Obviously you have to define the branch somehow, but there are plenty
>> of times when you might want to break out of "everything up to here".
>> How do you define that? How do you return lots of levels all at once?
>> I remember facing this exa
On 01/25/2015 08:45 PM, Chris Angelico wrote:
On Mon, Jan 26, 2015 at 12:31 PM, Marko Rauhamaa wrote:
Backtracking means the part of depth-first traversal where you retreat
to the parent node. If you implement your traversal with a recursive
function, backtracking means — more or less — a retur
On Sunday, January 25, 2015 at 4:15:58 PM UTC-4, Johannes Bauer wrote:
> Hi folks,
>
> I have a problem at hand that needs code for backtracking as a solution.
> And I have no problem coding it, but I can't get rid of the feeling that
> I'm always solving backtracking problems in a non-Pythonic
>
On 26/01/2015 00:32, Ben Finney wrote:
Johannes Bauer 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 rand
On Monday, January 26, 2015 at 12:52:04 PM UTC+5:30, Jussi Piitulainen wrote:
> Rustom Mody writes:
>
> > To add to Ian:
> >
> > The classic way of doing it in a functional framework is called:
> > "Replace failure by list of successes"
> >
> > https://rkrishnan.org/files/wadler-1985.pdf
> >
>
Rustom Mody writes:
> To add to Ian:
>
> The classic way of doing it in a functional framework is called:
> "Replace failure by list of successes"
>
> https://rkrishnan.org/files/wadler-1985.pdf
>
> The things that have to go into it are
> 1. Extensive use of list comprehensions
> 2. Lazy lists
On Monday, January 26, 2015 at 2:21:34 AM UTC+5:30, Ian Foote wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hi,
>
> I think a very idiomatic way to implement backtracking is using a
> recursive generator (python 3):
>
> def backtrack_solver(data=None):
> if data is None:
>
On Mon, Jan 26, 2015 at 12:31 PM, Marko Rauhamaa wrote:
> Backtracking means the part of depth-first traversal where you retreat
> to the parent node. If you implement your traversal with a recursive
> function, backtracking means — more or less — a return from the
> function.
But possibly you ne
Ben Finney :
> “Back-tracking” doesn't have a general meaning I recognise beyond
> random access into a data structure.
Backtracking means the part of depth-first traversal where you retreat
to the parent node. If you implement your traversal with a recursive
function, backtracking means — more o
On 2015-01-26 00:32, Ben Finney wrote:
Johannes Bauer 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 rand
Johannes Bauer 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 P
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi,
I think a very idiomatic way to implement backtracking is using a
recursive generator (python 3):
def backtrack_solver(data=None):
if data is None:
yield from backtrack_solver(data=initial_data)
if cannot_be_valid(data):
Hi folks,
I have a problem at hand that needs code for backtracking as a solution.
And I have no problem coding it, but I can't get rid of the feeling that
I'm always solving backtracking problems in a non-Pythonic
(non-idiomatic) way. So, I would like to ask if you have a Pythonic
approach to bac
13 matches
Mail list logo