Sealeopard
(KiX Master)
2002-12-18 09:09 PM
KiXGolf: Burrows-Wheeler Transform

Update: Code now has case-sensitivity enabled to eliminate potential problems in sorting algorithms.

=============================
The Burrows-Wheeler Transform
=============================


This month we are going to decode a string mangled with the Burrows Wheeler Transform. Please don't be scared by the somewhat long motivation that follows, even if you are a beginner. At the end you will be shown a few pretty simple algorithms.

Download the complete package at http://people.bu.edu/jenmeyer/kixtart/kixgolf_bwt.zip. You MUST use this package as it includes a UDF that will be used to score your entry automatically.It also includes a printable PDF document outlining the Burrows-Wheeler Transform. Please note the Special Recognition section further down in the desciption.

==========
Motivation
==========


The Burrows-Wheeler Transform (BWT) is a method that takes a block of text as input and rearranges it using a sorting algorithm. The unexpected thing is that the transform is reversible (which you normally don't expect. "sort" rarely comes with an "unsort"). The result of the transform is a block of text where consecutive letters are very often the same, so it can be easily compressed with even very naive algorithms. The BZIP program is based on this.
So how does it work ? It's pretty easy in fact. Let's assume the input text is "DRDOBBS". Write the string and all rotated versions under each other like this:
quote:

D R D O B B S (row 0)
R D O B B S D (row 1)
D O B B S D R (row 2)
O B B S D R D (row 3)
B B S D R D O (row 4)
B S D R D O B (row 5)
S D R D O B B (row 6)

Next sort rows:
quote:

B B S D R D O (row 4)
B S D R D O B (row 5)
D O B B S D R (row 2)
D R D O B B S (row 0)
O B B S D R D (row 3)
R D O B B S D (row 1)
S D R D O B B (row 6)

And finally, write down the last column: "OBRSDDB". Also note that the D in the last column of the second-last row (that's the new row 5, or the old row 1) is the D that starts the word "DRDOBBS". These two together are the result of the transform: "OBRSDDB" and 5.
It's pretty unexpected that this transform is reversible. One way to do that is to recover the (row n) lines in the sorted table. Let's first try to recover the sorted table a bit. We obviously already know:
quote:

. . . . . . O
. . . . . . B
. . . . . . R
. . . . . . S
. . . . . . D
. . . . . . D (row 1)
. . . . . . B

In fact, we also know the first column, because it's just the letters in the last column, but sorted:
quote:

B . . . . . O
B . . . . . B
D . . . . . R
D . . . . . S
O . . . . . D
R . . . . . D (row 1)
S . . . . . B

But this helps a lot ! From the row labeled with "(row 1)" we now know that R follows that D (remember that the strings were rotated, so the letter in the first column follows the letter in the last column). So if we know that the R is the first letter in row 1, we also know it's the last letter in row 2. So we can now extend our table to:
quote:

B . . . . . O
B . . . . . B
D . . . . . R (row 2)
D . . . . . S
O . . . . . D
R . . . . . D (row 1)
S . . . . . B

Now repeat the same reasoning for the row labeled "(row 2)" We see that the letter after R must be a D which corresponds to row 3. We already have one of the D's labeled, so it must be the other one. And let's repeat this process:
quote:

B . . . . . O (row 4)
B . . . . . B
D . . . . . R (row 2)
D . . . . . S
O . . . . . D (row 3)
R . . . . . D (row 1)
S . . . . . B

Oops, here we run into a problem. We know from the row labeled "(row 4)" that the letter after O is a B, but there are two of them in the last column. After which one should we write "(row 5)" ? To answer that, consider the letters that follow each B. By looking at a B in the last column and looking at the corresponding letter in the first column, we know they are B and S respectively. And since all rows are sorted, we in fact know:
quote:

B B . . . . O (row 4)
B S . . . . B
D . . . . . R (row 2)
D . . . . . S
O . . . . . D (row 3)
R . . . . . D (row 1)
S . . . . . B

This B and that S in the second column of course also occur in the first column somewhere (on the second and last row in fact), and since the first column is also sorted, they occur in the same order, B first (on the second row) and the S later (on the last row), and they each have a B in their last column). So after this subtle bit of reasoning we get to a very simple rule: if you have repeated letters in the first row (the B in BB and BS), they correspond to that same letter in the last row in exactly the same order.

So the lines in a picture like this will never cross:

 -

The B in the first column of row one corresponds to the B in the last column of the second row, and the B in the first column of the second row corresponds to the B in the last column of the last row.
Let's go back to our question. We had O which was followed by B due to the top row. This is the first B in column 1, so it corresponds to the first B in the last column, the one on the second row. Therefore that's the one we must label with "(row 5)". So we get:
quote:

B . . . . . O (row 4)
B . . . . . B (row 5)
D . . . . . R (row 2)
D . . . . . S
O . . . . . D (row 3)
R . . . . . D (row 1)
S . . . . . B

The rest is simple (don't forget that after row 6 we get row 0, not row 7):
quote:

B . . . . . O (row 4)
B . . . . . B (row 5)
D . . . . . R (row 2)
D . . . . . S (row 0)
O . . . . . D (row 3)
R . . . . . D (row 1)
S . . . . . B (row 6)

And finally we write down the first letters from the rows labeled "(row 0)", "(row 1)", ..., "(row 6)" and we get "DRDOBBS"

==========
Algorithms
==========


===========
Algorithm 1
===========


Wow, that was hard ! Or was it ? Let's redo the exercise using the special rule we found: "All occurrences of the same letter in the first column will correspond to all occurrences of that letter in the last column in the same order" (see the picture where this rule is demonstrated if the letter is B). Then we can start with the encoded string with below it the sorted string and position 5 marked:
OBRSDDB
BBDDORS
In the sorted string at the bottom we see the first R marked. Now mark the first R in the top string (and the D below it):
OBRSDDB
BBDDORS
So now we have the first D below marked. Now mark the first D at the top and the O below it (forget the old mark):
OBRSDDB
BBDDORS
First O at the bottom marked, mark first O at the top:
OBRSDDB
BBDDORS
First B at the bottom marked (this also happens to be the first time we are processing a B, but "first" here means it's the first B in the string "BBDDORS"), mark the first B at the top (that is, the first B in the string "OBRSDDB"):
OBRSDDB
BBDDORS
Second B at the bottom marked, so mark the second B at the top:
OBRSDDB
BBDDORS
First S at the bottom marked, mark first S at the top:
OBRSDDB
BBDDORS
Second D at the bottom marked, but when we mark the second D at the top, we see we are back at the original:
OBRSDDB
BBDDORS
When we look at each of the letters we marked at the top in order, we see: "DRDOBBS"

===========
Algorithm 2
===========


Another way is to observe that if you know the first few columns in the sorted table, you can fill in the last column too. And since the letters in the last column are prefixes of the string you already have in a row, you can move that letter to the front, and you get a set of strings that must also be in the sorted table (but not sorted yet). Sort them, and we are in the start situation again, but all strings are one letter longer. This leads to the following method:
First write down a column consisting of the encoded string:
O
B
R
S
D
D
B
Then sort it:
B
B
D
D
O
R
S
Now write the encoded string in front of that again:
OB
BB
RD
SD
DO
DR
BS
And sort it again:
BB
BS
DO
DR
OB
RD
SD
Repeat prefixing and sorting until you get:
BBSDRDO
BSDRDOB
DOBBSDR
DRDOBBS
OBBSDRD
RDOBBSD
SDRDOBB
Now take row 5, and move the D at the end to the front, giving:
DRDOBBS
Many more algorithms exist of course. Maybe they even lead to shorter programs...

=============
Specification
=============


You will have to write a KiXtart function called BWTDecode, which will decode a BWT-encoded string with a length between 0 and 999 characters. The valid character space of the encoded string is ASCII codes 32-126. The function will also require an integer offset. The offset number represents the character that will be the first character of the output (counting starts at zero, and the number will be less than the string length, you don't have to handle invalid input).
The function must return the decoded string or an empty string in case the decoding fails.
We use normal ASCII sorting.
So if you get
code:
$encoded = ’OBRSDDB’
$offset = 5
? 'encoded = '+$encoded
? 'offset = '+$offset
$decoded = BWTDecode($encoded,$offset)
? 'decoded = '+$decoded

then the cosole output should be:
code:
encoded = OBRSDDB
offset = 5
decoded = DRDOBBS

=============
General rules
=============


  • The program must be written as one or more lines.
  • The program is expected to finish in a reasonable time, e.g. if it gets started when the challenge opens, it's expected to be finished by the time the challenge closes even on a somewhat slow computer. The program has to be valid during the period that the challenge runs.
  • You can submit scores as often as you want to until the deadline, no reason to wait until the last minute. In fact, other people want to see the score to beat. So don't be a spoilsport by hoarding your score. Submit early and often.
  • The program may only use the KiXtart commands/functions/macros, no other code fragments are allowed.
  • The program should be self-contained (except for any I/O mentioned in the challenge). In particular, you may not do things like fetching extra data from a remote site.
  • You may assume ASCII as character set.
  • You are not allowed to use the included BSort() function. All functions required for the decoding must be placed inside the appropriate section of the script.
When posting KiXtart Golf Scores, please include the kixgolf_bwt.txt file that is created in the script directory. It contains some basic information about the computer that the script is run on.
========
Deadline
========

The game starts December 18 (3:00pm EST). The private coding phase ends Sunday, December 29 at 3pm EST and the public coding phase ends January 5 (3:00pm EST).

============
Test program
============


A test program is provided to help screen entries and to provide the Golf Score.
Any program that passes the test program can be submitted. If you are surprised that your solution passed the test program, please submit it anyway! That will help me identify bugs in the test program.

===================
Special Recognition
===================


Special recognition for the person who can identify the author of input array element 4.

================================================================
KiXtart GOLF - How To Play
================================================================


Most importantly, anybody can play, no age restrictions, no penalties, no handicap!

The object in "real" golf is to hit the ball in the hole in the fewest strokes. The object in KiXtart Golf is to get from input (tee) to target (hole) in the fewest keystrokes.

Example: How many positive elements are in array $a?

Array $a could be of structure $a=[1, 2 ,-3, 4, -5, -7, 8, 9]

One approach:
code:
for $b=0 to ubound($a)
if $a[$b]>0
$c=$c+1
endif
next

for a score of 45.

Another solution is:
code:
DO
$b=$b+1
if $a[$b]>0
$c=$c+1
endif
UNTIL $b>(UBOUND($a)+1)

for a score of 53.

Better approach: Code sample 1

================================================================
KiXtart GOLF - The Rules
================================================================


1) The goal of KiXtart Golf is to score the lowest strokes.

2) Strokes are all characters in a piece of code except whitespace characters, unless the whitespace character is necessary for the line of code to work. Therefore, carriage returns and line feeds do not count or spaces in between the '=' sign when assigning variables, e.g. '$a = $b' scores 5.

3) Code can be constructed any way you like, as long as it is syntactically correct with KiXtart.

4) The final solution MUST pass all test scripts that accompagny the KiXtart golf challenge.

5) The use of '$' as a variable is allowed.

6) In case of questions about a particular way to count the KiXtart Golf Challenge organizer has the last call.

7) During the private coding phase, no code is allowed to be posted. Violations result in disqualification of said player.

8) During the public coding phase, code should be posted, reused, and borrowed from other players.

9) The following script can be used to count the KiXtart Golf score: http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=2;t=003608

================================================================
KiXtart GOLF - The Duration of the Competition
================================================================


1) Private coding phase: From date/time of posting the tournament challenge to the following Sunday, 3pm EST (BBS+6 time)

2) Public coding phase: From Sunday, 3pm EST (BBS+6 time) to the following Sunday, 3pm EST (BBS+6 time)

3) Final results: Sunday, 3pm EST (BBS+6 time)

code:
; KiXtart Golf
;
; Burrows-Wheeler Transform Decoder
;
; UDF ExtGolfStats() will be included at a later time

dim $iRc, $sSource, $sEncoded, $sDecoded, $iOffset, $asSourceArray[5]
dim $iRandomElement, $sShellCmd, $sKiXGolfScrEngVer, $iKiXGolfScore
dim $sResult, $sOutput, $sOutputFile
dim $sGolfStatsUDF, $bExtGolfStats
dim $sGolfScoreUDF, $bGolfScore
dim $sTitle

; set requried options
$sTitle='KiXtart Golf: Burrows-Wheeler Transform'
$iRC=SETTITLE($sTitle)
$iRC=SETOPTION('Explicit','on')
$iRC=SETOPTION('NoVarsInStrings','on')
$iRC=SETOPTION('WrapAtEOL','on')
$iRC=SETOPTION('CaseSensitivity','on')

; load UDFs
$sGolfScoreUDF=@scriptdir+'\'+'kixgolf3.udf'
if exist($sGolfScoreUDF)
call $sGolfScoreUDF
$bGolfScore=1
else
$bGolfScore=0
endif
$sGolfStatsUDF=@scriptdir+'\extgolfstats.udf'
if exist($sGolfStatsUDF)
call $sGolfStatsUDF
$bExtGolfStats=1
else
$bExtGolfStats=0
endif
$sKiXGolfScrEngVer = '3.0.3'

; create a couple of test arrays
$asSourceArray[0]='DRDOBBS'
$asSourceArray[1]='I hope the decoding algorithms make sense.'
$asSourceArray[2]='An optional run-length encoder (RLE) should be placed '
$asSourceArray[2]=$asSourceArray[2]+'right before and after the Burrows-Wheeler '
$asSourceArray[2]=$asSourceArray[2]+'Transform encoder to maximize compression.'
$asSourceArray[3]='This algorithm has first been published in 1996 and is NOT '
$asSourceArray[3]=$asSourceArray[3]+'patented. This means, we could write a custom '
$asSourceArray[3]=$asSourceArray[3]+'UDF to compress/decompress text based on the '
$asSourceArray[3]=$asSourceArray[3]+'Burrows-Wheller Transform and an optional '
$asSourceArray[3]=$asSourceArray[3]+'run-lengh encoding engine.'
$asSourceArray[4]="Marley was dead: to begin with. There is no doubt whatever about '"
$asSourceArray[4]=$asSourceArray[4]+"that. The register of his burial was signed "
$asSourceArray[4]=$asSourceArray[4]+"by the clergyman, the clerk, the undertaker, "
$asSourceArray[4]=$asSourceArray[4]+"and the chief mourner. XXX signed it. And XXX's "
$asSourceArray[4]=$asSourceArray[4]+"name was good upon 'Change, for anything he chose"
$asSourceArray[4]=$asSourceArray[4]+" to put his hand to. Old Marley was as dead as "
$asSourceArray[4]=$asSourceArray[4]+"a door-nail. Mind! I don't mean to say that I "
$asSourceArray[4]=$asSourceArray[4]+"know, of my own knowledge, what there is "
$asSourceArray[4]=$asSourceArray[4]+"particularly dead about a door-nail. I might "
$asSourceArray[4]=$asSourceArray[4]+"have been inclined, myself, to regard a coffin-nail "
$asSourceArray[4]=$asSourceArray[4]+"as the deadest piece of ironmongery in the trade. "
$asSourceArray[4]=$asSourceArray[4]+"But the wisdom of our ancestors is in the simile; "
$asSourceArray[4]=$asSourceArray[4]+"and my unhallowed hands shall not disturb it, or the "
$asSourceArray[4]=$asSourceArray[4]+"Country's done for. You will therefore permit me to "
$asSourceArray[4]=$asSourceArray[4]+"repeat, emphatically, that Marley was as dead as a "
$asSourceArray[4]=$asSourceArray[4]+"door-nail."
$asSourceArray[5]="I'm wishing the KiXtart community and all KiXtart Golfers Happy "
$asSourceArray[5]=$asSourceArray[5]+"Holidays and a joyful New Year"

; select any of the test strings
$iRC=SRND(@TICKS)
$iRandomElement=RND(ubound($asSourceArray))
$sSource=$asSourceArray[$iRandomElement]

; display source string info
? 'Source string = '+$sSource
? 'String length = '+len($sSource)

; encode string
$sEncoded=BWTEncode($sSource)
$iOffset=$sEncoded[1]
$sEncoded=$sEncoded[0]

; display encoded string info
? 'Encoded string = '+$sEncoded
? 'Offset = '+$iOffset

; start the collection of extended KiXtart Golf Statistics
if $bExtGolfStats
$iRc=StartExtGolfStats($sTitle)
endif

; decode string
$sDecoded=BWTDecode($sEncoded,$iOffset)

; stop the collection of extended KiXtart Golf Statistics
if $bExtGolfStats
$iRc=StopExtGolfStats($sTitle)
endif

; display decoded string info
? 'Decoded string = '+$sDecoded

; check validity
select
case $sSource and not $sDecoded
color r+/n
? 'Validation = failed (decoded string is empty)'
color n/n
$sResult='failed'
case $sSource==$sDecoded
? 'Validation = passed (decoded string is identical to encoded string)'
$sResult='passed'
case 1
color r+/n
? 'Validation = failed (unknown error)'
color n/n
$sResult='failed'
endselect

; generate KiXtart Golf Score
if $bGolfScore
$iKiXGolfScore=KixGolf(@scriptdir+'\'+@scriptname)
else
$iKiXGolfScore='Please download the KiXtart Golf package at '
$iKixGolfScore=$iKixGolfScore+'http://people.bu.edu/jenmeyer/kixtart/kixgolf_bwt.zip'
endif

; generating official KiXGolf Score
$sOutput=$sOutput+@CRLF+'KiXtart'
$sOutput=$sOutput+@CRLF+'KiXtart Version = '+@KIX
$sOutput=$sOutput+@CRLF+'KiXGolf Script = '+@SCRIPTNAME
$sOutput=$sOutput+@CRLF+''
$sOutput=$sOutput+@CRLF+'Computer'
$sOutput=$sOutput+@CRLF+'OS = '+@PRODUCTTYPE
$sOutput=$sOutput+@CRLF+'CPU = '+@CPU
$sOutput=$sOutput+@CRLF+'Speed = '+@MHZ+' MHz'
$sOutput=$sOutput+@CRLF+''
$sOutput=$sOutput+@CRLF+'KiXGolf Scoring Engine'
$sOutput=$sOutput+@CRLF+'Scoring Engine = '+$sKiXGolfScrEngVer
$sOutput=$sOutput+@CRLF+''
$sOutput=$sOutput+@CRLF+'KiXtart Golf Score'
$sOutput=$sOutput+@CRLF+'Tournament = '+$sTitle
$sOutput=$sOutput+@CRLF+'Date & Time = '+@DATE+' '+@TIME
$sOutput=$sOutput+@CRLF+'KiXGolf Result = '+$sResult
$sOutput=$sOutput+@CRLF+'KiXGolf Score = '+$iKiXGolfScore
$sOutput=$sOutput+@CRLF+' '
if $bExtGolfStats
$sOutput=$sOutput+@CRLF+GetExtGolfStats()
endif
$sOutput=$sOutput+@CRLF+'Thank you for participating in KiXtart Golf!'

; saving and displaying official KiXtart Golf Score
$sOutputFile=@scriptdir+'\'+left(@scriptname,instrrev(@scriptname,'.'))+'txt'
$iRC=redirectoutput($sOutputFile,1)
? '[QUOTE]'
? $sOutput
? '[/QUOTE]'
$iRC=redirectoutput('')
? $sOutput

exit 0

; begin Burrows-Wheeler Transfrom Encoder
function BWTEncode($sSource)
dim $aEncoded[1], $asShftSrc, $iIndex, $iSourceLength
dim $sOffsetString

$aEncoded[0]=''
$aEncoded[1]=0

if not $sSource
$BWTEncode=$aEncoded
exit 0
endif

$iSourceLength=len($sSource)

; create encoded matrix
redim $asShftSrc[$iSourceLength-1]
$asShftSrc[0]=''+$sSource
for $iIndex=1 to $iSourceLength-1
$asShftSrc[$iIndex]=''+substr($asShftSrc[$iIndex-1],2)+left($asShftSrc[$iIndex-1],1)
next
$sOffsetString=$asShftSrc[1]

; sort encoded matrix
$asShftSrc=bsort($asShftSrc)

; retrieve last column
$aEncoded[0]=''
for $iIndex=0 to $iSourceLength-1
$aEncoded[0]=$aEncoded[0]+''+right($asShftSrc[$iIndex],1)
next

; determine offset
$iIndex=0
while not $asShftSrc[$iIndex]==$sOffsetString and $iIndex<($iSourceLength-1)
$iIndex=$iIndex+1
loop
$aEncoded[1]=$iIndex

$BWTEncode=$aEncoded
endfunction
; end Burrows-Wheeler Transfrom Encoder

; begin BSort sorting algorithm
;FUNCTION BSort()
;
;ACTION Bubble sort for kixtart arrays
;
;AUTHOR Shawn Tassie
;
;SYNTAX ARRAY = BSORT(ARRAY [, ORDER])
;
;PARAMETERS ARRAY
; A single dimensional kixtart array
;
; ORDER
; The sort order (0/1). If omitted or set to zero, the array will be sorted in
; ascending order. If set to 1, the array will be sorted in descending order.
;
;RETURN The sorted array
;
;REMARKS To my knowledge, this is as good (fast) as bubble sorts get. Would love to compare
; benchmarks and/or get feedback in terms of performance improvements.
;
;DEPENDENCIES none
;
;EXAMPLE $array = Peach,Pumpkin,Orange,Grape,Lime,Apple,Rasberry,Cherry,Lemon
; $array = bsort($array)
;
;KIXTART BBS http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000070
;
function bsort($array, optional $order)
dim $i,$j,$m

if ubound($array)
for $i = 0 to ubound($array)
$m = $array[$i]
for $j = $i + 1 to ubound($array)
if ($array[$j] < $m and not $order) or ($array[$j] > $m and $order)
$m = $array[$j]
$array[$j] = $array[$i]
$array[$i] = $m
endif
next
next
$bsort = $array
else
$bsort = 0
endif
endfunction
; end BSort sorting algorithm
; any modifications above this line will result in immediate disqualification

; begin Burrows-Wheeler Transfrom Decoder

;!
function BWTDecode($sEncoded, $iOffset)
endfunction
;!
;!

; end Burrows-Wheeler Transfrom Decoder

; any modifications below this line will result in immediate disqualification



[ 23. December 2002, 21:35: Message edited by: sealeopard ]


LonkeroAdministrator
(KiX Master Guru)
2002-12-18 09:10 PM
Re: KiXGolf: Burrows-Wheeler Transform

sweet

{edit}
just one beer... then I'll start...
{/edit}

[ 18. December 2002, 21:21: Message edited by: Lonkero ]


Sealeopard
(KiX Master)
2002-12-18 09:27 PM
Re: KiXGolf: Burrows-Wheeler Transform

What do you mean? Not done yet?

LonkeroAdministrator
(KiX Master Guru)
2002-12-18 09:28 PM
Re: KiXGolf: Burrows-Wheeler Transform

I have tight MSN conversation going on for next generation kixCode
the beer is still in freezer.


MightyR1
(MM club member)
2002-12-18 10:49 PM
Re: KiXGolf: Burrows-Wheeler Transform

Breaking my head over this one...

Jooel, just for you: Cheers


LonkeroAdministrator
(KiX Master Guru)
2002-12-18 10:54 PM
Re: KiXGolf: Burrows-Wheeler Transform

I have auto update... that MS thingie...
it broke my mediaplayer, will look that out later.

anyway, I got bored after 20 lines of reading.
jens, where is task so I can skip to that?


Sealeopard
(KiX Master)
2002-12-18 10:57 PM
Re: KiXGolf: Burrows-Wheeler Transform

Code is at the bottom, additionally, the ZIP file reference on the top contains everything you'll need including an external Golf Score UDF (kixgolf3.udf). It also includes the background as a PDF document.

LonkeroAdministrator
(KiX Master Guru)
2002-12-19 12:37 AM
Re: KiXGolf: Burrows-Wheeler Transform

ok, finally, I got it to bottom.
still skipped half [Razz]

trying again...


LonkeroAdministrator
(KiX Master Guru)
2002-12-19 01:21 AM
Re: KiXGolf: Burrows-Wheeler Transform

what is the special stuff?
didn't get it, didn't get it at all...


Sealeopard
(KiX Master)
2002-12-19 01:34 AM
Re: KiXGolf: Burrows-Wheeler Transform

quote:

===================
Special Recognition
===================

Special recognition for the person who can identify the author of input array element 4.

I guess it's time to read the complete post [Wink]

Or download the ZIP package!


LonkeroAdministrator
(KiX Master Guru)
2002-12-19 01:37 AM
Re: KiXGolf: Burrows-Wheeler Transform

I might later, I found myself sleeping at my desk...

anyway, I don't think checking the package will clear the person up and what to do with him.

will check it anyway.


maciep
(Korg Regular)
2002-12-19 02:33 PM
Re: KiXGolf: Burrows-Wheeler Transform

look familiar?

http://perlgolf.sourceforge.net/TPR/0/6/


Sealeopard
(KiX Master)
2002-12-19 04:00 PM
Re: KiXGolf: Burrows-Wheeler Transform

Yes, that's one of my sources for KiXGolf. However, their solutions will not help you much as external programs are prohibited and thus a call to perl wouldn't work [Wink]

BTW, another inspirational website is at http://www.mathworks.com/contest/protein.cgi/home.html. Unfortunately, most of their contests are a little bit too much for KiXtart, though the Protein-folding one was very interesting.

[ 19. December 2002, 16:21: Message edited by: sealeopard ]


maciep
(Korg Regular)
2002-12-19 04:54 PM
Re: KiXGolf: Burrows-Wheeler Transform

Not to mention the fact the contest is closed, so you can't see any of their perl solutions.

Richard H.Administrator
(KiX Supporter)
2002-12-19 05:07 PM
Re: KiXGolf: Burrows-Wheeler Transform

Actually yes you can browse all the results.

Go to the home page and follow the "post-mortem" link for the exercise.


Sealeopard
(KiX Master)
2002-12-19 05:54 PM
Re: KiXGolf: Burrows-Wheeler Transform

Yes, they have very interesting Perl solutions. You can't even tell whether the solution is encrypted or not by the way some of the code looks.

Anyway, what's going on here? Nobody's posted anything yet, not even an answer to the 'Special Recognition' challenge. [Confused]


ShawnAdministrator
(KiX Supporter)
2002-12-19 05:59 PM
Re: KiXGolf: Burrows-Wheeler Transform

Im in - just doing my homework ... Charles Dickens ?

ShawnAdministrator
(KiX Supporter)
2002-12-19 06:02 PM
Re: KiXGolf: Burrows-Wheeler Transform

Or should I say: DC*hirknsaceesl ?

Sealeopard
(KiX Master)
2002-12-19 06:02 PM
Re: KiXGolf: Burrows-Wheeler Transform

Congrats!

And which story? Just kidding!

I thought it would be fitting to test the encoder/decoder with the first two paragraphs of Charles Dicken's "A Christmas Carol".

Anyway, good luck with coding the BWT-Decoder.


ShawnAdministrator
(KiX Supporter)
2002-12-19 06:15 PM
Re: KiXGolf: Burrows-Wheeler Transform

oh - i wish Split() was more powerful [Wink]

ShawnAdministrator
(KiX Supporter)
2002-12-19 07:15 PM
Re: KiXGolf: Burrows-Wheeler Transform

Jens - you got those %?#@!@$ strict options turned on .... erggg [Wink]

lol [Wink]


ShawnAdministrator
(KiX Supporter)
2002-12-19 07:18 PM
Re: KiXGolf: Burrows-Wheeler Transform

ok - i just got this - is this good:

quote:


Source string = DRDOBBS
String length = 7
Encoded string = OBRSDDB
Offset = 5BBDDORSDRDOBBS
Decoded string = DRDOBBS
Validation = failed (unknown error)



Howard Bullock
(KiX Supporter)
2002-12-19 07:28 PM
Re: KiXGolf: Burrows-Wheeler Transform

Well if Shawn is close to providing a solution I guess I will have to start investigating this challenge.

ShawnAdministrator
(KiX Supporter)
2002-12-19 07:36 PM
Re: KiXGolf: Burrows-Wheeler Transform

I think i got a solution - just trying to get it to verify with Jen`s checker thingy ... something is broke somewhere - prob my routine - highly HIGHLY un-optimized at 800+ chars ...

Jens - can we use the bsort routine included in the checker ? [Wink]

[ 19. December 2002, 19:37: Message edited by: Shawn ]


Howard Bullock
(KiX Supporter)
2002-12-19 07:48 PM
Re: KiXGolf: Burrows-Wheeler Transform

From above: [Razz]
quote:
You are not allowed to use the included BSort() function. All functions required for the decoding must be placed inside the appropriate section of the script.



ShawnAdministrator
(KiX Supporter)
2002-12-19 07:59 PM
Re: KiXGolf: Burrows-Wheeler Transform

Im not using Jens`s bsort routine - just fun'n

ShawnAdministrator
(KiX Supporter)
2002-12-19 08:29 PM
Re: KiXGolf: Burrows-Wheeler Transform

Jens,

Haven't dug deep into your checker or anything, but shouldn't this line here:

case $sEncoded==$sDecoded

be like this:

case $sSource==$sDecoded

-Shawn


Sealeopard
(KiX Master)
2002-12-19 08:52 PM
Re: KiXGolf: Burrows-Wheeler Transform

Shawn:

Yes, you're right. I will correct this and post updated code both in the ZIP package and the top post in the thread. I also cleaned up those long lines a little bit.


Sealeopard
(KiX Master)
2002-12-19 09:02 PM
Re: KiXGolf: Burrows-Wheeler Transform

The validation routine has been updated due to a bug that Shawn found. Both the ZIP package and the posted code have now been corrected.

BTW, if you'd like to post official results then you can use the kixgolf_bwt.txt file that is created in the script directory.

Ultimately, this file will contain some info about the Kixtart process that ran the challenge.

The idea is to create some kind of weighted average of keystrokes, running time, and memory usage to create the final score. This way somebody might be able to achieve a better score by e.g. optimizing memory usage but using up more keystrokes. This might make it more interesting.

Comments on this idea are welcome.


maciep
(Korg Regular)
2002-12-19 09:03 PM
Re: KiXGolf: Burrows-Wheeler Transform

Shawn,

I got the same thing. It looks like my function works, but I get "Validation = failed (unknown error)"

-Eric


maciep
(Korg Regular)
2002-12-19 09:07 PM
Re: KiXGolf: Burrows-Wheeler Transform

Oh...There's two pages in this topic. I'm an idiot. Disregard the my last post.

-Eric


Sealeopard
(KiX Master)
2002-12-19 09:14 PM
Re: KiXGolf: Burrows-Wheeler Transform

There will be more! I think we average 5 pages and 100+ post for each of the phases (private/public).

[ 19. December 2002, 21:14: Message edited by: sealeopard ]


LonkeroAdministrator
(KiX Master Guru)
2002-12-19 09:17 PM
Re: KiXGolf: Burrows-Wheeler Transform

ok, now as had time, I got the mission and the transform into my head.
jens, it was matter of 2 not so clear statements.

anyway, this looks nice and I'm sad that can't participate on the first round.


maciep
(Korg Regular)
2002-12-20 01:41 AM
Re: KiXGolf: Burrows-Wheeler Transform

Well, I have a working solution.

quote:

Source string = DRDOBBS
String length = 7
Encoded string = OBRSDDB
Offset = 5
Decoded string = DRDOBBS
Validation = passed (decoded string is identical to encoded string)

KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt2.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium II
Speed = 350 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/19 19:43:26
KiXGolf Result = passed
KiXGolf Score = 628

ExtGolfStats
Thank you for participating in KiXtart Golf!


It works for all of the input strings. Now it's time to start chopping it down.


LonkeroAdministrator
(KiX Master Guru)
2002-12-20 01:44 AM
Re: KiXGolf: Burrows-Wheeler Transform

maciep, have you tried it with longer input?
if yes, then congratulations.


maciep
(Korg Regular)
2002-12-20 05:52 AM
Re: KiXGolf: Burrows-Wheeler Transform

Yeah, it works for all of them. I just didn't want to display the results from the longer ones because well...they're long. But there's still some trimming to do.

ShawnAdministrator
(KiX Supporter)
2002-12-20 06:27 AM
Re: KiXGolf: Burrows-Wheeler Transform

I would like to propose a recommendation here - not sure if this is a requirement or not, but I think it is ...

The Checker should make the following setting:

setoption("casesensitivity","on")

I believe (and correct me if im wrong) but this has to be done to get consistency across diff versions of sort routines ... it ensures that a series of mixed-cased letters are in proper order.

Currently, bsort is NOT case sensitive so depdending on the string, you could have a series like this:

mmmMMmmm

then if you change the string slightly (add chars etc) the series could flip for no good reason:

MmmmmmmM

The mix of upper and lower is random ... if you actually dump the sorted string for minor variations of strings, might see it.

Anyone have any comments ?


cj
(MM club member)
2002-12-20 07:53 AM
Re: KiXGolf: Burrows-Wheeler Transform

Maybe we could ask Ruud to see if there is something that KiXtart does internally that would be suitable for a KiXgolf score. It could be an undocumented macro like @KIXGOLF or disguised as something legit like @COMMANDSUSED maybe?

cj


LonkeroAdministrator
(KiX Master Guru)
2002-12-20 07:54 AM
Re: KiXGolf: Burrows-Wheeler Transform

ceej, you are alive! [Eek!]

[ 20. December 2002, 07:54: Message edited by: Lonkero ]


cj
(MM club member)
2002-12-20 08:04 AM
Re: KiXGolf: Burrows-Wheeler Transform

I thought someone said my name 3 times [Smile]

cj


MightyR1
(MM club member)
2002-12-20 10:18 AM
Re: KiXGolf: Burrows-Wheeler Transform

Tadaa...

quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium III
Speed = 547 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/20 10:16:18
KiXGolf Result = passed
KiXGolf Score = 369

ExtGolfStats
Thank you for participating in KiXtart Golf!

Long text takes very long... [Frown] Must be the sorting... Will dig...


LonkeroAdministrator
(KiX Master Guru)
2002-12-20 10:43 AM
Re: KiXGolf: Burrows-Wheeler Transform

who cares about speed?

Schuliebug
(Hey THIS is FUN)
2002-12-20 01:33 PM
Re: KiXGolf: Burrows-Wheeler Transform

quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt.KIX

Computer
OS = Windows XP Professional
CPU = Intel Pentium III
Speed = 797 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Date & Time = 2002/12/20 13:33:51
KiXGolf Result = passed
KiXGolf Score = 338

Thank you for participating in KiXtart Golf!



Sealeopard
(KiX Master)
2002-12-20 01:34 PM
Re: KiXGolf: Burrows-Wheeler Transform

As posted above, I playing with the idea of a weighted average of keystrokes, memory, and processing time [Big Grin]

I will also implement the SETOPTION('CaseSensitivity','on') into the code after a short test.


LonkeroAdministrator
(KiX Master Guru)
2002-12-20 01:36 PM
Re: KiXGolf: Burrows-Wheeler Transform

but, that is just play right?
that it does not count in this golf yet, right?


Schuliebug
(Hey THIS is FUN)
2002-12-20 01:45 PM
Re: KiXGolf: Burrows-Wheeler Transform

Bummer, in some cases i loose Uppercase characters ??? Will check code [Smile] Posted my score to early, it seems [Wink]

[ 20. December 2002, 13:51: Message edited by: Schuliebug ]


ShawnAdministrator
(KiX Supporter)
2002-12-20 02:17 PM
Re: KiXGolf: Burrows-Wheeler Transform

Hey guys - the thingy with the case sensitivity is this - my premise is that this statement is required for both the checker sort and the solution sort. Obviously if the solution script doesn't need sorting than this is a non-issue.

I think the thing that I would like to know is - of the people that have already submitted a solution script - did you need to turn on case sensitivity. If yes, then suggest we turn it on in the checker script - if no then obviously this isn't required and we should not turn it on.

-Shawn


maciep
(Korg Regular)
2002-12-20 02:20 PM
Re: KiXGolf: Burrows-Wheeler Transform

No, I didn't have to turn on case sensitivity. Works fine without it.

I think that as long as the encoder and decoder are sorting the same way, it's not an issue.


ShawnAdministrator
(KiX Supporter)
2002-12-20 02:35 PM
Re: KiXGolf: Burrows-Wheeler Transform

I suggest that we turn it on anyways - just on matter of principle (i think). Don't think we can make the assumption that the encoder and decoder will be using the same sort routine. imho - think its more important that the encoder perform a proper (perfect) mixed-case ascii sort especially when this game gets down to the short strokes.

Sealeopard
(KiX Master)
2002-12-20 02:35 PM
Re: KiXGolf: Burrows-Wheeler Transform

I think I should have Shawn check the KiXGolf codes before posting as he already found two issues (nothing beats peer-review). [Wink] Well done, Shawn.

I tested the case-sensitivity and the encoded string differs based on whether case-sensitivity is enabled or not. Therefore, I have enabled case-sensitivity in order to guarantee correct ASCII sorting.

Both the posted code and the downloadable ZIP file have been updated.

There are still two modifications planned for the test script.

Modification #1 would put the actual KiXGolf function BWTDecode() into it's own external UDF. This would easy upgrades to the test script.

Modification #2 will be the implementation of extended statistics about the UDF. However, the extended stats will not influence the scoring process.

I might do a third round of coding in the second week of January where we can experiment with those extended stats and see whether they would create interesting programming challenges.


maciep
(Korg Regular)
2002-12-20 03:05 PM
Re: KiXGolf: Burrows-Wheeler Transform

I don't know how much more I can trim down.
quote:


KiXtart
KiXtart Version = 4.11 RC 1
KiXGolf Script = kixgolf_bwt3.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium III
Speed = 730 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/20 09:04:09
KiXGolf Result = passed
KiXGolf Score = 557

ExtGolfStats
Thank you for participating in KiXtart Golf!



maciep
(Korg Regular)
2002-12-20 05:36 PM
Re: KiXGolf: Burrows-Wheeler Transform

Still going...

quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium III
Speed = 730 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/20 11:39:33
KiXGolf Result = passed
KiXGolf Score = 462

ExtGolfStats
Thank you for participating in KiXtart Golf!



ShawnAdministrator
(KiX Supporter)
2002-12-20 05:42 PM
Re: KiXGolf: Burrows-Wheeler Transform

This is where im at right now:

quote:

KiXtart
KiXtart Version = 4.12
KiXGolf Script = score.KIX

Computer
OS = Windows XP Professional
CPU = Intel Pentium II
Speed = 446 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Date & Time = 2002/12/20 11:39:37
KiXGolf Result = passed
KiXGolf Score = 464

Thank you for participating in KiXtart Golf!



[ 20. December 2002, 17:43: Message edited by: Shawn ]


maciep
(Korg Regular)
2002-12-20 06:09 PM
Re: KiXGolf: Burrows-Wheeler Transform

I read through the rules, but I'm still not sure about something. Are we allowed to change the parameter names of our function. For Example:

code:
  

function BWTDecode($s, $o)
.
.
.
endfunction



Sealeopard
(KiX Master)
2002-12-20 06:19 PM
Re: KiXGolf: Burrows-Wheeler Transform

Yes, you can change the names of the parameters inside your function, thus
code:
function BWTDecode($,$a)
endfunction

would be valid. You cannot rename the name of the function though as this is fixed in the calling script.


maciep
(Korg Regular)
2002-12-20 06:39 PM
Re: KiXGolf: Burrows-Wheeler Transform

That's what I thought, but I just wanted to make sure. Here's my latest stats.

quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt3.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium III
Speed = 730 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/20 12:43:09
KiXGolf Result = passed
KiXGolf Score = 389

ExtGolfStats
Thank you for participating in KiXtart Golf!



ShawnAdministrator
(KiX Supporter)
2002-12-20 06:39 PM
Re: KiXGolf: Burrows-Wheeler Transform

Broke 400 but still a bit away from Jan ... curious to see what maciep throws at us next though ...

code:
KiXtart
KiXtart Version = 4.12
KiXGolf Script = score.KIX

Computer
OS = Windows XP Professional
CPU = Intel Pentium II
Speed = 446 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Date & Time = 2002/12/20 12:36:06
KiXGolf Result = passed
KiXGolf Score = 399

Thank you for participating in KiXtart Golf!

[edit]

A curve ball I see ! [Wink]

[ 20. December 2002, 18:40: Message edited by: Shawn ]


maciep
(Korg Regular)
2002-12-20 06:51 PM
Re: KiXGolf: Burrows-Wheeler Transform

Still looking. Here's the last run.

quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium III
Speed = 730 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/20 12:54:33
KiXGolf Result = passed
KiXGolf Score = 377

ExtGolfStats
Thank you for participating in KiXtart Golf!



ShawnAdministrator
(KiX Supporter)
2002-12-20 07:07 PM
Re: KiXGolf: Burrows-Wheeler Transform

"Hey Rocky - watch me pull a rabbit out of my hat ... (flop) ... hmmm ... think Im going to need a new hat!"

-- Bullwinkle Moose


Schuliebug
(Hey THIS is FUN)
2002-12-20 07:13 PM
Re: KiXGolf: Burrows-Wheeler Transform

If CaseSensitive is turned on my score stands.

maciep
(Korg Regular)
2002-12-20 07:46 PM
Re: KiXGolf: Burrows-Wheeler Transform

Here's the last one.

quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt3.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium III
Speed = 730 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/20 13:48:53
KiXGolf Result = passed
KiXGolf Score = 353

ExtGolfStats
Thank you for participating in KiXtart Golf!



Pamb
(Lurker)
2002-12-20 07:48 PM
Re: KiXGolf: Burrows-Wheeler Transform

Is Kix version 4.20 Alpha 1 ok?

quote:


KiXtart
KiXtart Version = 4.20 Alpha 1
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows 2000 Professional
CPU = Intel(R) Pentium(R) 4 CPU 1700MHz
Speed = 1707 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Date & Time = 2002/12/20 13:46:22
KiXGolf Result = passed
KiXGolf Score = 246

Thank you for participating in KiXtart Golf!



Sealeopard
(KiX Master)
2002-12-20 08:03 PM
Re: KiXGolf: Burrows-Wheeler Transform

I think we will have to exclude v4.20 alpha 1 as it is not publicly available. However, you will now have several people who would do anything to get their hand on this version just for the fact that you've been able to shave off another 100 keystrokes [Wink] (Me included!)

[ 21. December 2002, 22:31: Message edited by: sealeopard ]


Chris S.
(MM club member)
2002-12-20 08:07 PM
Re: KiXGolf: Burrows-Wheeler Transform

Well, it's not publically available unless you go to the DX21 website. [Roll Eyes]

Welcome to the board, Pamb.


maciep
(Korg Regular)
2002-12-20 08:36 PM
Re: KiXGolf: Burrows-Wheeler Transform

I think I still have some room to work.

quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium III
Speed = 730 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/20 14:39:39
KiXGolf Result = passed
KiXGolf Score = 324

ExtGolfStats
Thank you for participating in KiXtart Golf!



Pamb
(Lurker)
2002-12-20 08:36 PM
Re: KiXGolf: Burrows-Wheeler Transform

Ok, being a fair person...it has now been tested in version 4.12. [Smile]

quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows 2000 Professional
CPU = Intel(R) Pentium(R) 4 CPU 1700MHz
Speed = 1707 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Date & Time = 2002/12/20 14:38:24
KiXGolf Result = passed
KiXGolf Score = 246

Thank you for participating in KiXtart Golf!



Sealeopard
(KiX Master)
2002-12-20 08:38 PM
Re: KiXGolf: Burrows-Wheeler Transform

Now that is MUCH better! That'll make some people real antsy now [Big Grin]

MightyR1
(MM club member)
2002-12-20 08:53 PM
Re: KiXGolf: Burrows-Wheeler Transform

Bummer...

Have to change my algorithm....

quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium III
Speed = 547 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/20 20:55:02
KiXGolf Result = passed
KiXGolf Score = 317


Thank you for participating in KiXtart Golf!



maciep
(Korg Regular)
2002-12-20 09:46 PM
Re: KiXGolf: Burrows-Wheeler Transform

I'm done with this for today. Don't think I can squeeze anymore out of it anyhow. And I know I'm not going to catch Pamb.

quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium III
Speed = 730 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/20 15:44:49
KiXGolf Result = passed
KiXGolf Score = 319

ExtGolfStats
Thank you for participating in KiXtart Golf!



ShawnAdministrator
(KiX Supporter)
2002-12-21 04:48 PM
Re: KiXGolf: Burrows-Wheeler Transform

KiXGolf Score = 328

ShawnAdministrator
(KiX Supporter)
2002-12-21 06:24 PM
Re: KiXGolf: Burrows-Wheeler Transform

KiXGolf Score = 298

ShawnAdministrator
(KiX Supporter)
2002-12-21 07:52 PM
Re: KiXGolf: Burrows-Wheeler Transform

KiXGolf Score = 275

maciep
(Korg Regular)
2002-12-21 08:26 PM
Re: KiXGolf: Burrows-Wheeler Transform

KiXGolf Score = 309

Gotta go do some Christmas shopping. I'll get back to this later.


ShawnAdministrator
(KiX Supporter)
2002-12-21 09:58 PM
Re: KiXGolf: Burrows-Wheeler Transform

KiXGolf Score = 267

Howard Bullock
(KiX Supporter)
2002-12-21 10:14 PM
Re: KiXGolf: Burrows-Wheeler Transform

c:\data\scripts>C:\Data\Kix2001\KiX2001.412\kix32 golf\bwt\kixgolf_bwt.kix

Source string = DRDOBBS
String length = 7
Encoded string = OBRSDDB
Offset = 5
Decoded string = DRDOBBS
Validation = passed (decoded string is identical to encoded string)

KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 848 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/21 16:18:00
KiXGolf Result = passed
KiXGolf Score = 239

Thank you for participating in KiXtart Golf!


MightyR1
(MM club member)
2002-12-21 11:33 PM
Re: KiXGolf: Burrows-Wheeler Transform

[Eek!] [Eek!] [Eek!]

Howard Bullock
(KiX Supporter)
2002-12-22 04:07 AM
Re: KiXGolf: Burrows-Wheeler Transform

Jens, please don't disqualify me. I added a Start time so that I could see how long the program runs on the longer text. No other modification was done in the forbidden zone. I can send you the updated code if you want to see it.
quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 848 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Start (Date/Time) = 2002/12/21 22:01:09
Finish (Date/Time) = 2002/12/21 22:01:28
KiXGolf Result = passed
KiXGolf Score = 231


Thank you for participating in KiXtart Golf!

If I need a faster sorting algorithm then:

quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 848 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Start (Date/Time) = 2002/12/21 22:08:50
Finish (Date/Time) = 2002/12/21 22:08:57
KiXGolf Result = passed
KiXGolf Score = 256


Thank you for participating in KiXtart Golf!

String length = 42 for both tests.

[ 22. December 2002, 05:17: Message edited by: Howard Bullock ]


ShawnAdministrator
(KiX Supporter)
2002-12-22 04:36 AM
Re: KiXGolf: Burrows-Wheeler Transform

Does speed count ? [Wink]

Howard Bullock
(KiX Supporter)
2002-12-22 05:21 AM
Re: KiXGolf: Burrows-Wheeler Transform

Only if the "String length = 749" does not finish in time for the end of the competition.

[ 22. December 2002, 05:45: Message edited by: Howard Bullock ]


Sealeopard
(KiX Master)
2002-12-22 04:42 PM
Re: KiXGolf: Burrows-Wheeler Transform

Execution time and memory usage will be added through the extended statistics UDF as soon as I finish writing that UDF. The calling code is already in place.

Neither execution speed nor memory usage will be used to create the KiXGolf scores in this round.

However, they will be used to experiment with alternative scoring methods to make the challenges more challenging (pun intended [Big Grin] )


Howard Bullock
(KiX Supporter)
2002-12-22 05:00 PM
Re: KiXGolf: Burrows-Wheeler Transform

Five hours and ten minutes of 99% CPU utilization to execute on the 749 character string. [Eek!] [Eek!] If I shorten my code by 15 characters, my score would be 231 but the execution time would be greatly extended. On a short string the 15 characters buys me a 300% improvement in performance. But on a long string the work content is much greater. I am not sure how long it would run. [Confused]
quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 848 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
String length = 749
Start (Date/Time) = 2002/12/21 22:27:40
Finish (Date/Time) = 2002/12/22 03:37:46
KiXGolf Result = passed
KiXGolf Score = 246


Thank you for participating in KiXtart Golf!



[ 22. December 2002, 17:00: Message edited by: Howard Bullock ]


Sealeopard
(KiX Master)
2002-12-22 05:07 PM
Re: KiXGolf: Burrows-Wheeler Transform

Now that is interesting [Eek!]

5 hours? I wonder what the fastest solution is for the 700+ charcter string?

I think I really need to get going on the extended stats.


ShawnAdministrator
(KiX Supporter)
2002-12-22 05:57 PM
Re: KiXGolf: Burrows-Wheeler Transform

Five hours ??? Using the performance script you sent me Howard, and using the 749 length sting, the algorithm im using takes 7 SECS (the entire running time)!!!

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Start (Date/Time) = 2002/12/22 12:01:21
Finish (Date/Time) = 2002/12/22 12:01:28
KiXGolf Result = passed
KiXGolf Score = 267

The actual Decoder UDF itself takes about 441 msecs How come so long ???

[ 22. December 2002, 18:18: Message edited by: Shawn ]


ShawnAdministrator
(KiX Supporter)
2002-12-22 06:22 PM
Re: KiXGolf: Burrows-Wheeler Transform

So obviously this is the case of smaller code but huge performance penalty ?

Howard Bullock
(KiX Supporter)
2002-12-22 06:30 PM
Re: KiXGolf: Burrows-Wheeler Transform

Maybe we used different methodologies to solve the problem. Maybe I'm am just an idiot. [Wink] Regardless of the reason, I still have a better score. [Razz]

maciep
(Korg Regular)
2002-12-23 04:13 AM
Re: KiXGolf: Burrows-Wheeler Transform

Found a new approach.

KiXGolf Score = 286


maciep
(Korg Regular)
2002-12-23 04:17 AM
Re: KiXGolf: Burrows-Wheeler Transform

KiXGolf Score = 277

maciep
(Korg Regular)
2002-12-23 04:43 AM
Re: KiXGolf: Burrows-Wheeler Transform

KiXGolf Score = 271.

Schuliebug
(Hey THIS is FUN)
2002-12-23 01:15 PM
Re: KiXGolf: Burrows-Wheeler Transform

Wow, 7 seconds [Eek!] [Eek!] I'm beaten, my minimal length would be 288 [Smile]

maciep
(Korg Regular)
2002-12-23 03:21 PM
Re: KiXGolf: Burrows-Wheeler Transform

KiXGolf Score = 266

Sealeopard
(KiX Master)
2002-12-23 03:32 PM
Re: KiXGolf: Burrows-Wheeler Transform

Nevertheless, Howard still has the lead with a KiXGolf score of 231. Of course, that assumes that his algorithm will actually finish the long string by December 29 [Wink]

maciep
(Korg Regular)
2002-12-23 03:47 PM
Re: KiXGolf: Burrows-Wheeler Transform

Don't know if I can squeeze out another 20. But I'll give it a whirl.

KiXGolf Score = 251


MightyR1
(MM club member)
2002-12-23 04:03 PM
Re: KiXGolf: Burrows-Wheeler Transform

Still 317...

maciep
(Korg Regular)
2002-12-23 04:19 PM
Re: KiXGolf: Burrows-Wheeler Transform

KiXGolf Score = 243

maciep
(Korg Regular)
2002-12-23 04:59 PM
Re: KiXGolf: Burrows-Wheeler Transform

Alright, I'm throwing in the towel. I can't trim off anymore code.

quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium III
Speed = 730 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/23 11:00:28
KiXGolf Result = passed
KiXGolf Score = 243

ExtGolfStats
Thank you for participating in KiXtart Golf!



kholm
(Korg Regular)
2002-12-23 09:34 PM
Re: KiXGolf: Burrows-Wheeler Transform

I Think that the xmas present from Ruud is improved performance

I’m not in contest.
My score is 270, and i don’t intend to improve it (cannot) [Wink]

I just took this as a chance to compare the performance of the newer KiX version:

String lenght: 218

Time for KiX 4.11 to complete: 1:59

Time for KiX 4.12 to complete: 1:39

Time for KiX 4.20 to complete: 1:01

So if not for other reasons, you should upgrade to the latest KiX version for speed.

I believe I’m following the same path as Howard (slow, but the job is done)
This was just a great opportunity to compare the different KiX versions for speed.

Howard: Score = 231, i’m getting curious
Shawn: 7 seconds, i’m getting even more curious

-Erik


Sealeopard
(KiX Master)
2002-12-23 09:42 PM
Re: KiXGolf: Burrows-Wheeler Transform

Just in case somebody thinks about it. As KiXtart 4.20 beta 1 is public you are of course free to use it.

kholm
(Korg Regular)
2002-12-23 10:02 PM
Re: KiXGolf: Burrows-Wheeler Transform

Jens, this is a late call,

Are you sure ?

This allows two more buildin functions and an improved Join():
  • AScan()
  • IIf()
  • Join() has extra parameter
It would be nice to se the scripts before 4.20 was allowed and after.
-Erik


Sealeopard
(KiX Master)
2002-12-23 10:05 PM
Re: KiXGolf: Burrows-Wheeler Transform

I didn't expect v4.20 to go public that fast. however, any public KiXtart version is allowed. KiXtat 4.20 alpha 1 was excluded since it was not public (sounded more like it leaked out). Anyway, there more than enough time to work on the code.

The private coding phase will end on Sunday, December 29, 3pm EST and the public coding phase will end Sunday, January 5, 3pm EST.


Howard Bullock
(KiX Supporter)
2002-12-24 04:48 AM
Re: KiXGolf: Burrows-Wheeler Transform

Wow! [Eek!] [Eek!] [Cool]

I just run my code on 4.20B1 and Wow! Execution time on the 749 byte string went from 5 hours 10 minutes to 2 hours 27 minutes.

Good job Ruud.

quote:


KiXtart
KiXtart Version = 4.20 Beta 1
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 848 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Start (Date/Time) = 2002/12/23 20:06:41
Finish (Date/Time) = 2002/12/23 22:33:31
KiXGolf Result = passed
KiXGolf Score = 244


Thank you for participating in KiXtart Golf!



maciep
(Korg Regular)
2002-12-24 05:47 AM
Re: KiXGolf: Burrows-Wheeler Transform

I'm picking the towel back up for now. Execution time is somewhere under a minute

KiXGolf Score = 241


Howard Bullock
(KiX Supporter)
2002-12-24 05:48 AM
Re: KiXGolf: Burrows-Wheeler Transform

Is that for the 749 byte string?

maciep
(Korg Regular)
2002-12-24 05:51 AM
Re: KiXGolf: Burrows-Wheeler Transform

Yeah. The actual decoding part takes around 25 seconds. That's on a 350(mhz)

ShawnAdministrator
(KiX Supporter)
2002-12-24 06:31 AM
Re: KiXGolf: Burrows-Wheeler Transform

Just an update where i am. I've got two algorithms in the works ... a really slow one and a really fast one. The numbers are like follows:

slow one: 232

fast one: 267

The fast one does the big string in under half a second. The slow one does the medium string in like 30 minutes or something - can't even bear to wait for it to finish [Wink]

[ 24. December 2002, 07:11: Message edited by: Shawn ]


Howard Bullock
(KiX Supporter)
2002-12-24 06:33 AM
Re: KiXGolf: Burrows-Wheeler Transform

Sounds like your really stupid one is the same one I am using with a score of 231.

I am now working on a super fast one (I hope).

Still trying to understand what I am doing but it looks promising.


ShawnAdministrator
(KiX Supporter)
2002-12-24 06:38 AM
Re: KiXGolf: Burrows-Wheeler Transform

Ive been staring at this fast one for over two days now - i've found a way to shave a couple more bytes, but I think a kixtart bug is getting in the way. hopefully, once the contest is over we can raise bring this Ruud attention.

more importantly, not too sure which script I want to stare at for the next few days ... the smart one or the stupid one.


Howard Bullock
(KiX Supporter)
2002-12-24 06:41 AM
Re: KiXGolf: Burrows-Wheeler Transform

I think my stupid one is pretty tight at 231. I can't seem to find any way to trim it.

The smart method seems have a requirement that necessitates more code than the stupid way.

[ 24. December 2002, 06:41: Message edited by: Howard Bullock ]


ShawnAdministrator
(KiX Supporter)
2002-12-24 06:47 AM
Re: KiXGolf: Burrows-Wheeler Transform

Well - I finally now understand your comments re: the slow sort vs the fast sort [Wink]

Whats your time for the processing string #2 (len=139) ???


Howard Bullock
(KiX Supporter)
2002-12-24 06:52 AM
Re: KiXGolf: Burrows-Wheeler Transform

I can't find any saved data on that one. Sorry.

I am currently executing the 749 byte string using the slow sort on 4.20B1 to see how long it takes.


ShawnAdministrator
(KiX Supporter)
2002-12-24 06:57 AM
Re: KiXGolf: Burrows-Wheeler Transform

This may sound weird, but I can't remember my CPU FAN ever being on for this length of time - no joking !!!

[ 24. December 2002, 06:58: Message edited by: Shawn ]


Howard Bullock
(KiX Supporter)
2002-12-24 06:59 AM
Re: KiXGolf: Burrows-Wheeler Transform

Yeah, I have never heard my fan stay on for a couple minutes let alone hours like now. At least I am finnally using the potential of the CPU. [Big Grin] I new there was some reason I bought a faster computer.

[ 24. December 2002, 07:07: Message edited by: Howard Bullock ]


ShawnAdministrator
(KiX Supporter)
2002-12-24 07:06 AM
Re: KiXGolf: Burrows-Wheeler Transform

The 139 byte string took 1336181 msecs on a 500mhz P3 ... think thats about 22 minutes ... i got that right ?

ShawnAdministrator
(KiX Supporter)
2002-12-24 07:46 AM
Re: KiXGolf: Burrows-Wheeler Transform

Score = 229

Howard Bullock
(KiX Supporter)
2002-12-24 07:48 AM
Re: KiXGolf: Burrows-Wheeler Transform

Arrggghhh!!!

Now I have to stop working on the fast one to look at the slow one again. [Frown] [Mad]


Howard Bullock
(KiX Supporter)
2002-12-24 07:58 AM
Re: KiXGolf: Burrows-Wheeler Transform

Start (Date/Time) = 2002/12/24 02:01:47
Finish (Date/Time) = 2002/12/24 02:01:50
KiXGolf Result = passed
KiXGolf Score = 229

Damn, that was an obvious fix. Why didn't I see that before. Now you have the lead. [Mad] Our code must be identical. [Confused]


ShawnAdministrator
(KiX Supporter)
2002-12-24 08:13 AM
Re: KiXGolf: Burrows-Wheeler Transform

I figured you would have went down to 228 because you have (had) a byte edge ... what happened to that ?

Howard Bullock
(KiX Supporter)
2002-12-24 08:16 AM
Re: KiXGolf: Burrows-Wheeler Transform

See, you're still alert enough to realize that. I am winding down fast. Still looking for the wayward byte. [Wink]

[ 24. December 2002, 08:26: Message edited by: Howard Bullock ]


ShawnAdministrator
(KiX Supporter)
2002-12-24 05:08 PM
Re: KiXGolf: Burrows-Wheeler Transform

Score = 226

MightyR1
(MM club member)
2002-12-24 06:11 PM
Re: KiXGolf: Burrows-Wheeler Transform

quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium II
Speed = 400 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/24 18:14:04
KiXGolf Result = passed
KiXGolf Score = 269


Thank you for participating in KiXtart Golf!



ShawnAdministrator
(KiX Supporter)
2002-12-24 06:15 PM
Re: KiXGolf: Burrows-Wheeler Transform

My 226 script just failed on the 139 length string ... so the game is still afoot !

Howard Bullock
(KiX Supporter)
2002-12-24 06:16 PM
Re: KiXGolf: Burrows-Wheeler Transform

I am sorry to here that, but [Big Grin]

ShawnAdministrator
(KiX Supporter)
2002-12-24 06:21 PM
Re: KiXGolf: Burrows-Wheeler Transform

Im re-running it inside the checker itself ... just to double-check ...

maciep
(Korg Regular)
2002-12-24 06:52 PM
Re: KiXGolf: Burrows-Wheeler Transform

Score = 235

For the 749 length string, decoding part takes about 10 seconds (733mhz)


Howard Bullock
(KiX Supporter)
2002-12-24 07:08 PM
Re: KiXGolf: Burrows-Wheeler Transform

maciep, I can't wait to see your code. Small code + fast [Cool] Don't get get it too small though [Wink]

maciep
(Korg Regular)
2002-12-24 07:12 PM
Re: KiXGolf: Burrows-Wheeler Transform

score = 228

My code is barely making sense to me anymore.


Howard Bullock
(KiX Supporter)
2002-12-24 07:13 PM
Re: KiXGolf: Burrows-Wheeler Transform

[Eek!] Now I'm upset [Mad]

maciep
(Korg Regular)
2002-12-24 07:19 PM
Re: KiXGolf: Burrows-Wheeler Transform

score = 226

Works for all inputs

Sorry Howard [Wink]

[ 24. December 2002, 19:21: Message edited by: maciep ]


ShawnAdministrator
(KiX Supporter)
2002-12-24 08:08 PM
Re: KiXGolf: Burrows-Wheeler Transform

I just double-checked my 226 and it ran fine ! Theres no way im running the biggy on this though ...

maciep - do you have a slow 226 or a fast 226 ?

[edit] re-read the thread - guess that would be a fast 226 - Howard, looks as if both you and I are going to need a new hat [Frown]

[ 24. December 2002, 20:12: Message edited by: Shawn ]


maciep
(Korg Regular)
2002-12-24 08:10 PM
Re: KiXGolf: Burrows-Wheeler Transform

226 fast.

Howard Bullock
(KiX Supporter)
2002-12-24 08:24 PM
Re: KiXGolf: Burrows-Wheeler Transform

It's back to brain storming... (trial and error) [Roll Eyes]

ShawnAdministrator
(KiX Supporter)
2002-12-24 09:45 PM
Re: KiXGolf: Burrows-Wheeler Transform

ok - the gloves are off and sanity is being thrown out the window:

StringLength = 139
RunningTime = 1 hour !!!!
KixGolfScore = 220

Im just trying to wear you down now !

[ 24. December 2002, 21:47: Message edited by: Shawn ]


Howard Bullock
(KiX Supporter)
2002-12-24 09:55 PM
Re: KiXGolf: Burrows-Wheeler Transform

My slow method has now been running on the 749 byte string for 18+ hours. [Frown]

220 [Eek!] My brain has been fried switching back and forth on these two methods. Can I do this in Perl please [Wink]

I haven't given up yet.

[ 24. December 2002, 21:55: Message edited by: Howard Bullock ]


MightyR1
(MM club member)
2002-12-24 11:13 PM
Re: KiXGolf: Burrows-Wheeler Transform

Longest string takes 50 minutes...

quote:


KiXtart
KiXtart Version = 4.12
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium III
Speed = 696 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/24 22:38:20
KiXGolf Result = passed
KiXGolf Score = 266


Thank you for participating in KiXtart Golf!



ShawnAdministrator
(KiX Supporter)
2002-12-25 12:04 AM
Re: KiXGolf: Burrows-Wheeler Transform

Im a little confused about how we are going to "validate" a winner. The checker script uses a "random" string ... which one of those strings are we going to use to valid the winner ? If the winner takes two days running time to validate against the biggest string - whats that going to mean ?

maciep
(Korg Regular)
2002-12-25 12:14 AM
Re: KiXGolf: Burrows-Wheeler Transform

Well, it's time to do the holiday thing. I'll jump back into this in a couple of days. Try to keep those scores nice and high for me.

Last Run:

Score = 223


kholm
(Korg Regular)
2002-12-25 04:01 AM
Re: KiXGolf: Burrows-Wheeler Transform

Stil not in contest [Wink]

I have implemented the 'hard' way = 'fast' way

This brought my score up to 586 (more than double the smallest in contest [Eek!] )

But the time for the executing the long string (749) got down to 4 secs. instead of X hours

I noticed a post from maciep:
quote:
My code is barely making sense to me anymore.
It would be nice to have a third round of golf (Club house discussion [Smile] ), where the function-/variables-names where discriptive.

It would spare us all from trying to understand the brilliant code from the winner.

I use a lot of the ideas from the INI-write golf competition, BUT you have to participate to understand the problem/code fully.

-Erik


Howard Bullock
(KiX Supporter)
2002-12-25 05:15 AM
Re: KiXGolf: Burrows-Wheeler Transform

25+ hours and still churning.

I cannot fathom how anyone can implement the fast process in less than 260 characters at this time. My fast process is currently around 270 characters. I am sure there are some things that could be improved upon, but the slow method employs less processes and therefore less code. How can the fast process be implemented in 226 characters? I'm still scratching my head how you Shawn got to 220.

Still scratching my head. [Confused]


ShawnAdministrator
(KiX Supporter)
2002-12-25 05:37 AM
Re: KiXGolf: Burrows-Wheeler Transform

Well, if its any consolation I don't think I can squeeze any more out of this 220 script - in fact since I really dont want to test it on the 700+ string - it might not even qualify as a valid score. Might have to start looking at yet another algorithm ...

Maybe we should have two prizes in this round ... one for the shortest script and one the fastest script ...


Howard Bullock
(KiX Supporter)
2002-12-26 03:14 AM
Re: KiXGolf: Burrows-Wheeler Transform

45 hours 15 minutes and still churning... the simple slow method is indeed sloowww!!!!

maciep
(Korg Regular)
2002-12-26 09:53 PM
Re: KiXGolf: Burrows-Wheeler Transform

Well, I've tried just about everything I can think of to cut three more stokes off my score, but to no avail.

Decoding takes about 5 seconds on the large string input. (ver 4.20 and 730mhz)

quote:


KiXtart
KiXtart Version = 4.20 Beta 1
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium III
Speed = 730 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/26 15:50:51
KiXGolf Result = passed
KiXGolf Score = 223

ExtGolfStats
Thank you for participating in KiXtart Golf!



Howard Bullock
(KiX Supporter)
2002-12-26 09:54 PM
Re: KiXGolf: Burrows-Wheeler Transform

You did write your own sorting code, right?

maciep
(Korg Regular)
2002-12-26 10:00 PM
Re: KiXGolf: Burrows-Wheeler Transform

You mean we can't use the provided b-sort function?

Just Kidding!! [Big Grin] . Yeah, I wrote my own sorting method. It's all in the BWTDecode function.


Howard Bullock
(KiX Supporter)
2002-12-26 10:05 PM
Re: KiXGolf: Burrows-Wheeler Transform

Can't wait to this code [Cool]

Howard Bullock
(KiX Supporter)
2002-12-26 10:22 PM
Re: KiXGolf: Burrows-Wheeler Transform

Still testing the core code on the long string: CPU so far: 64 hours 10 minutes

This change occurs after the core processing.

Source string = DRDOBBS
String length = 7
Encoded string = OBRSDDB
Offset = 5
Decoded string = DRDOBBS
Validation = passed (decoded string is identical to encoded string)

KiXtart
KiXtart Version = 4.20 Beta 1
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 848 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Start (Date/Time) = 2002/12/26 16:22:06
Finish (Date/Time) = 2002/12/26 16:22:09
KiXGolf Result = passed
KiXGolf Score = 225


MightyR1
(MM club member)
2002-12-27 01:16 PM
Re: KiXGolf: Burrows-Wheeler Transform

quote:


KiXtart
KiXtart Version = 4.20 Beta 1
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium II
Speed = 400 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/27 13:40:12
KiXGolf Result = passed
KiXGolf Score = 243
String length = 749
Elapsed time = 34089 msec


Thank you for participating in KiXtart Golf!

{edit - changed the output file to also include the string length and the elapsed time...}

[ 27. December 2002, 13:37: Message edited by: MightyR1 ]


MightyR1
(MM club member)
2002-12-27 01:51 PM
Re: KiXGolf: Burrows-Wheeler Transform

8 to go...

quote:


KiXtart
KiXtart Version = 4.20 Beta 1
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium II
Speed = 400 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/27 13:55:22
KiXGolf Result = passed
KiXGolf Score = 228
String length = 749
Elapsed time = 41229 msec


Thank you for participating in KiXtart Golf!



MightyR1
(MM club member)
2002-12-27 01:59 PM
Re: KiXGolf: Burrows-Wheeler Transform

Getting closer: Score = 224...

maciep
(Korg Regular)
2002-12-27 02:03 PM
Re: KiXGolf: Burrows-Wheeler Transform

Nice!

Now stop


MightyR1
(MM club member)
2002-12-27 02:11 PM
Re: KiXGolf: Burrows-Wheeler Transform

ANYBODY OUT THERE???

quote:


KiXtart
KiXtart Version = 4.20 Beta 1
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium II
Speed = 400 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/27 14:15:16
KiXGolf Result = passed
KiXGolf Score = 223
String length = 749
Elapsed time = 41229 msec


Thank you for participating in KiXtart Golf!



maciep
(Korg Regular)
2002-12-27 02:18 PM
Re: KiXGolf: Burrows-Wheeler Transform

Alright. I guess I have to study my code a little more. Maybe I can get a couple more chopped off my score.

MightyR1
(MM club member)
2002-12-27 02:28 PM
Re: KiXGolf: Burrows-Wheeler Transform

Let's beat the 220 limit!!!

maciep
(Korg Regular)
2002-12-27 02:30 PM
Re: KiXGolf: Burrows-Wheeler Transform

I'm with you.

MightyR1
(MM club member)
2002-12-27 05:15 PM
Re: KiXGolf: Burrows-Wheeler Transform

DID IT...

quote:


KiXtart
KiXtart Version = 4.20 Beta 1
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium II
Speed = 400 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/27 17:19:41
KiXGolf Result = passed
KiXGolf Score = 218
String length = 749
Elapsed time = 44484 msec


Thank you for participating in KiXtart Golf!



Howard Bullock
(KiX Supporter)
2002-12-27 05:18 PM
Re: KiXGolf: Burrows-Wheeler Transform

You guys have me pulling out what hair is left on my head. [Eek!]

I can't seem to find a methodology to get the performance up and shave strokes. [Frown]


maciep
(Korg Regular)
2002-12-27 05:32 PM
Re: KiXGolf: Burrows-Wheeler Transform

Nice job Patrick. I'm still stuck at 223.

ShawnAdministrator
(KiX Supporter)
2002-12-27 05:43 PM
Re: KiXGolf: Burrows-Wheeler Transform

Well done Patrick.

Howard Bullock
(KiX Supporter)
2002-12-28 02:47 AM
Re: KiXGolf: Burrows-Wheeler Transform

[Big Grin] [Big Grin] [Big Grin]
KiXGolf Score = 207
String length = 749
quote:
KiXtart
KiXtart Version = 4.20 Beta 1
KiXGolf Script = kixgolf_bwt2.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 848 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Start (Date/Time) = 2002/12/27 20:50:15
Finish (Date/Time) = 2002/12/27 20:50:21
KiXGolf Result = passed
KiXGolf Score = 207

Thank you for participating in KiXtart Golf!



Les
(KiX Master)
2002-12-28 02:50 AM
Re: KiXGolf: Burrows-Wheeler Transform

WOW! [Eek!]
Start and finish on the same day.
Obviously you found another methodology.


Howard Bullock
(KiX Supporter)
2002-12-28 02:52 AM
Re: KiXGolf: Burrows-Wheeler Transform

This was the same basic methodology as my 284 script but a light bulb went on after dinner and this is the result.

Since this works, I decided to kill my old process which has been consuming 99% of my CPU for 92 hours 20 minutes.


ShawnAdministrator
(KiX Supporter)
2002-12-28 02:58 AM
Re: KiXGolf: Burrows-Wheeler Transform

[Eek!]
[Eek!]
[Eek!]

Way to go Howard !!!


Howard Bullock
(KiX Supporter)
2002-12-28 04:18 AM
Re: KiXGolf: Burrows-Wheeler Transform

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Start (Date/Time) = 2002/12/27 22:22:38
Finish (Date/Time) = 2002/12/27 22:22:41
KiXGolf Result = passed
KiXGolf Score = 206


Howard Bullock
(KiX Supporter)
2002-12-28 05:49 AM
Re: KiXGolf: Burrows-Wheeler Transform

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Start (Date/Time) = 2002/12/27 23:53:40
Finish (Date/Time) = 2002/12/27 23:53:42
KiXGolf Result = passed
KiXGolf Score = 203


MightyR1
(MM club member)
2002-12-28 01:51 PM
Re: KiXGolf: Burrows-Wheeler Transform

Ouch...

You've hit me hard Howard!!! Well done [Eek!]

Will see if I can take 16 chars off...

[ 28. December 2002, 13:54: Message edited by: MightyR1 ]


Howard Bullock
(KiX Supporter)
2002-12-28 02:32 PM
Re: KiXGolf: Burrows-Wheeler Transform

I don't see me being able to make mine much smaller if at all. Good luck to all.

MightyR1
(MM club member)
2002-12-28 03:12 PM
Re: KiXGolf: Burrows-Wheeler Transform

208...

MightyR1
(MM club member)
2002-12-28 06:16 PM
Re: KiXGolf: Burrows-Wheeler Transform

204...

quote:


KiXtart
KiXtart Version = 4.20 Beta 1
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium II
Speed = 400 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/28 18:28:14
KiXGolf Result = passed
KiXGolf Score = 204
String length = 749
Elapsed time = 10115 msec


Thank you for participating in KiXtart Golf!



[ 28. December 2002, 18:25: Message edited by: MightyR1 ]


MightyR1
(MM club member)
2002-12-28 08:55 PM
Re: KiXGolf: Burrows-Wheeler Transform

[Big Grin] [Big Grin] YAHOOOOO [Big Grin] [Big Grin]
quote:


KiXtart
KiXtart Version = 4.20 Beta 1
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium II
Speed = 401 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/28 20:56:49
KiXGolf Result = passed
KiXGolf Score = 202
String length = 749
Elapsed time = 11316 msec


Thank you for participating in KiXtart Golf!



Howard Bullock
(KiX Supporter)
2002-12-28 08:57 PM
Re: KiXGolf: Burrows-Wheeler Transform

good work, but [Frown] [Mad] [Eek!]

I guess the ball is back in my court. [Wink]


MightyR1
(MM club member)
2002-12-28 09:02 PM
Re: KiXGolf: Burrows-Wheeler Transform

Howard,

Let your brains squeeek [Wink] [Wink]

When is the closing of fase 1 --> 2002-12-29;21:00:00 BBS time???


Howard Bullock
(KiX Supporter)
2002-12-28 09:07 PM
Re: KiXGolf: Burrows-Wheeler Transform

24 hours from now (notice the time on this post).

MightyR1
(MM club member)
2002-12-28 09:09 PM
Re: KiXGolf: Burrows-Wheeler Transform

OK....

Squeek..Sqiiirt..

Can't get anymore out of my brains...


Howard Bullock
(KiX Supporter)
2002-12-28 09:32 PM
Re: KiXGolf: Burrows-Wheeler Transform

Still on top [Big Grin]

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Start (Date/Time) = 2002/12/28 15:36:16
Finish (Date/Time) = 2002/12/28 15:36:22
KiXGolf Result = passed
KiXGolf Score = 201


MightyR1
(MM club member)
2002-12-29 12:19 AM
Re: KiXGolf: Burrows-Wheeler Transform

Congrats,

I think I'll trow in the towel...


Howard Bullock
(KiX Supporter)
2002-12-29 12:20 AM
Re: KiXGolf: Burrows-Wheeler Transform

I was there a couple days ago. Are you sure that you can't tweak a little more?

MightyR1
(MM club member)
2002-12-29 12:22 AM
Re: KiXGolf: Burrows-Wheeler Transform

Will sleep a night over it (2002-12-29;00:30 over here) [Wink]

20.5 hrs to go...

{edit - noticed BB time is behind... HENRI???}

[ 29. December 2002, 00:24: Message edited by: MightyR1 ]


MightyR1
(MM club member)
2002-12-29 01:04 AM
Re: KiXGolf: Burrows-Wheeler Transform

RECLAIM TOWEL... IT'S A TIE...

(for now... [Big Grin] )

quote:


KiXtart
KiXtart Version = 4.20 Beta 1
KiXGolf Script = kixgolf_bwt.kix

Computer
OS = Windows XP Professional
CPU = Intel Pentium II
Speed = 400 MHz

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Date & Time = 2002/12/29 01:07:03
KiXGolf Result = passed
KiXGolf Score = 201
String length = 749
Elapsed time = 11356 msec


Thank you for participating in KiXtart Golf!



MightyR1
(MM club member)
2002-12-29 01:13 AM
Re: KiXGolf: Burrows-Wheeler Transform

Can the 200 char barrier be broken???

YES it CAN:

[Big Grin] score=197 [Big Grin]

Howard, it's in your hands again...


Howard Bullock
(KiX Supporter)
2002-12-29 01:41 AM
Re: KiXGolf: Burrows-Wheeler Transform

Patrick, I thought you were going to sleep. [Frown]

Now I have to stop my movie and work on this again. [Wink]


Howard Bullock
(KiX Supporter)
2002-12-29 03:17 AM
Re: KiXGolf: Burrows-Wheeler Transform

[Big Grin] [Razz] [Big Grin] Yippee [Big Grin] [Razz] [Big Grin]

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Start (Date/Time) = 2002/12/28 21:20:18
Finish (Date/Time) = 2002/12/28 21:20:20
KiXGolf Result = passed
KiXGolf Score = 195


Howard Bullock
(KiX Supporter)
2002-12-29 03:21 AM
Re: KiXGolf: Burrows-Wheeler Transform

KiXtart Golf Score
Tournament = KiXtart Golf: Burrows-Wheeler Transform
Start (Date/Time) = 2002/12/28 21:25:32
Finish (Date/Time) = 2002/12/28 21:25:35
KiXGolf Result = passed
KiXGolf Score = 193


MightyR1
(MM club member)
2002-12-29 01:21 PM
Re: KiXGolf: Burrows-Wheeler Transform

[Eek!] [Eek!] [Eek!]

MightyR1
(MM club member)
2002-12-29 04:54 PM
Re: KiXGolf: Burrows-Wheeler Transform

quote:
Come on Brain, give me all you've got...
Sorry Captain, I've got no power...



Howard Bullock
(KiX Supporter)
2002-12-29 05:43 PM
Re: KiXGolf: Burrows-Wheeler Transform

I think it is all wrung out. It was a pleasure going down to the wire with you. Please don't make think anymore [Wink]

MightyR1
(MM club member)
2002-12-29 09:57 PM
Re: KiXGolf: Burrows-Wheeler Transform

Congrats from me...

I'm stuck at 197