Steve Wampler wrote:
> Steve Wampler wrote:
> I thought I'd put out one more variant (then I'll stop, I promise!).
> ... The result is a
> single pass instead of two, so this version is slightly faster.

I lied.  I'm sorry.  But I thought I'd report on one slight change
to this last version.  Changing:

            statePair := min(state1, state2)||":"||max(state1,state2)
            signature := getClassSignature(state1, state2)
            /equivClasses[signature] := set()
            if /statePairs[statePair] := set(state1, state2) then {

into:

            statePair := min(state1, state2)||":"||max(state1,state2)
            if /statePairs[statePair] := set(state1, state2) then {
                signature := getClassSignature(state1, state2)
                /equivClasses[signature] := set()

Gave a major proformance boost *with this input set* (getStates() loaded
6 times instead of once).  Here's a comparison of the string signature,
the Goedel signature with two passes, and the final version (I'm back
on my office machine, so all the times are faster than with my home computer):

String:       0.92s
Goedel 2Pass: 0.35
Goedel 1Pass: 0.09 (!) [Note that this is primarily because the innermost code
                   is performed only on *new* state pairs and the input
                   has a *lot* of duplicates, so the more you push after the
                   test, the better.  In Real Life, this would be a much smaller
                   improvement, if any.]

When run on the original input (i.e. the Old World Order), this final version
completes faster than I can measure:
----------------------------------------
->states3
north dakota:south carolina and north carolina:south dakota
Time: 0.0

-- 
Steve Wampler -- [EMAIL PROTECTED]
The gods that smiled on your birth are now laughing out loud.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Unicon-group mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to