in reply to String Compression Optimization (repeated concatenated subsequences)

I'm not sure this is relevant, but perhaps this solution of mine to a similar problem could give you some ideas: Re: Minimal password check, again.

Here's the sample use and output from Re: Minimal password check, again:

check_reps('xattattttatty'); __END__ att repeated 2 times, covers 46% ttatt repeated 2 times, covers 76% tt repeated 2 times, covers 30% t repeated 3 times, covers 23% t repeated 2 times, covers 15% t repeated 2 times, covers 15%

Hope this helps,
ihb

Read argumentation in its context!

Replies are listed 'Best First'.
Re^2: String Compression Optimization (repeated concatenated subsequences)
by QM (Parson) on Sep 14, 2004 at 01:44 UTC
    Thanks for the suggestion. I've tried something essentially similar. The problem is one of scaling, and the fact that the real problem doesn't use chars and strings (see Update 1).

    I'm not sure you need the lookahead, but I'm more worried about how it affects execution time. Maybe I'll benchmark something on that while I'm taking a break from this problem ;)

    Update: I see that the lookahead captures overlaps, while the other doesn't.

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of