Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Detecting transpositions

by Abigail-II (Bishop)
on Aug 06, 2003 at 14:14 UTC ( [id://281406]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Detecting transpositions
in thread Detecting transpositions

You want to use the regexp machine to control the backtracking when searching for a Hamiltonian path? That wouldn't be something I would do, unless to as a 'proof of concept' or so.

I'd probably go for a recursive subroutine, although there's the possibility for an iterative solution as well.

As for the N-queens problem, it basically is the recursive subroutine, except molded to fit the regexp syntax. And the only reason I did this exercise was "because I can". I don't think I would easily do such a thing in production code.

Abigail

Replies are listed 'Best First'.
Re: Re: Detecting transpositions
by BrowserUk (Patriarch) on Aug 06, 2003 at 22:12 UTC

    No production code here, so that's not a problem. I guess the idea stems from my having taken a year to understand how your N-Queens thing worked and maybe because I'd like to be able to say "because I can too":)

    The reality is that the unbounded nature of the datasets involved probably means that I will need to keeps stack usage at each recursion as small as possible, which I wouldn't have control of using the RE. It was a nice thought though.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
    If I understand your problem, I can solve it! Of course, the same can be said for you.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://281406]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-25 16:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found