## GARSP versus GVANT

GARSP was designed as a replacement for the GVANT program to search for Optimal Golomb Rulers. As such, it is prudent to first discuss the differences between the two.

GARSP versus GVANT
GARSP uses three files versus GVANT's two SAVE.TXT replaces SAVE.DAT SEND.TXT replaces SEND.DAT CHOOSE.DAT is a new file, and must exist apriori (via FTP or choose.c) GARSP saves at the same _or_ one level deeper into the search tree than GVANT The save file format has been updated Revised: Times and nodes are cumulative between saves to the SEND.TXT file Revised: The initial line no longer requires the 4 zero's New: The intermediate savelines start by stating the depth of the save Save frequency is about 10 times higher (or 100 times with run-time option "dsave 1") Saves are limited to a maximum of once per X seconds (X preset to 60, but can be changed) GARSP uses bitmaps versus integer arrays A special CHOOSE array is used with pre-computed minimum lengths for given bitmaps This array can be very large (the bitmaps require 11*2^n bytes to store, with n=16-22) GARSP's search speed is dependent on RAM speed as well as CPU speed

## Getting Started

You need to have downloaded or otherwise recreated the choose.dat file before you can run GARSP. The bits/map in the choose.dat file dictate the largest bits/map setting you can use in GARSP. In other words, if you downloaded a 20 bits/map version of choose.dat, you can run GARSP using 20, 19, 18 ... bits/map. Please refer back to the home page to get this file.

GARSP has several command line options, and can be initiated in two ways. First, GARSP can be used independent of the SAVE.TXT file to search entire OGR's. This is useful to make sure you can get it up and running easily. To start GARSP this way, enter the command:

- GARSP 13 (To run GARSP on OGR-13)
- GARSP 15 (To run GARSP on OGR-15)
- etc etc etc

The more useful was to run GARSP is to create a SAVE.TXT file with the desired search range embedded in the file, and then to run GARSP with the command:

- GARSP

The SAVE.TXT file MUST contain two entries, and may contain a number more, as follows:

- Required: OGR to be searched (e.g., OGR-21 is "21")
- Required: Right side limit to consider (e.g., OGR-21 search limited to 332 or less is "332"). Note, you may use the value "-1" here to have GARSP use some built in values. Do _not_ use "-1" for our OGR-21 search, since we wish to use 332 as a limit, and the built-in default is 333.
- Optional: A starting ruler stub, defined as a string of numbers that measure (1) the distance from the first mark at the left edge of the ruler to the second mark, (2) from the send to the third, (3) etc. An example is "1 18" to define the "stub" [1-18] which is to say that the first three marks are located at 0, 1 and 19 respectively.
- Optional: An ending ruler stub, defined as a string of (negative) numbers that measure (1) the distance from the first mark at the left edge of the ruler to the second mark, (2) from the send to the third, (3) etc. An example is "-1 -19" to define the "stub" [1-19] which is to say that GARSP should stop after it completes searching through the situation where the first three marks are located at 0, 1 and 20 respectively.
- NOT ALLOWED: Any additional entries should be made by the program, not by hand!

So here is a typical example of a SAVE.TXT file, assuming you were assigned the stub [1-18]:

- SAVE.TXT contents: 21 332 1 18 -1 -18

Of course, we added some flexibility to GARSP to handle runs without having to duplicate the program or the choose file. This is done by allowing the user to define alias paths/names to the three files used. The complete command line structure of GARSP is as follows:

- GARSP [options], where [options] can include any combination of the following:

  Run Time Options
  -save save_file_name | Alternate path/name for the save.txt input file
  -send send_file_name | Alternate path/name for the send.txt input file
  -choose choose_file_name | Alternate path/name for the choose.dat input file
  -MAXBITS # | Number of bits to use from the choose.dat file (default = 20) Note: requires 11*2^MAXBITS of RAM
  -dsave # | Increment the depth at which save.txt is updated (default = 0) e.g., use "-dsave 1" for really hard stubs
  -DUMPTIME # | Minimum number of seconds between save.txt updates (default=60)

- Example: GARSP -save 1-18.sav -send 1-18.snd -choose c:\common\choose.dat

### Installation

### I - Create a directory (e.g., c:\GOLOMB21)

To keep things simple we recommend that you create a directory for this project. For the purposes of this documentation, we will assume that you named this directory "GOLOMB21" (if not, just substitute the correct name).

### II - Get the needed program files

(Right where you got this file!)

### III - Install an icon (Windows and OS/2 users)

#### Win 3.x ...

Open your "main" group and double click the icon called "pif editor". Click on "File" / "New"

         Program Name     GARSP.EXE
         Window Title     Golomb Ruler
         Startup Dir      C:\GOLOMB21 (or whatever you called it)
         Display Usage    "Windowed"
         Execution        "Background"
               Note...    clicking on Exclusive lets GARSP run faster but
                          stops other app's when GARSP is in full screen mode
         Click on ADVANCED, Under "Other" click on "Allow Close When Active"

Click on "OK" / "File" / "Save" and save it as GOLOMB21.PIF before exiting from the PIF Editor. The final step is to create an icon and link it to the PIF file. To do this, decide where you want the icon. Let us suppose you decide the "Main" group.

      Click once on the "Main" group.
      Click on "File", "New", "Program File"
         Description      Golomb Ruler
         Command Line     GOLOMB21.PIF
         Working Dir.     C:\GOLOMB21 (or whatever you called it)
      Click on OK

#### Win 95 ...

    Click on "My Computer"
    Click to the directory "C:\GOLOMB21" (or whatever you called it)
    Right-click on the file called "GARSP.EXE" and select COPY
    Right-click on your desktop in an empty area, and select PASTE SHORTCUT

    Right-click the new shortcut icon on your desktop
    Click on "Properties" and select the "Misc" tab on the far right
    Click off (turn off) "Warn if still active"
    When done, select OK.

#### OS/2 ...

Tear off a "Program" template from your Templates Folder. On the "program" page of the settings notebook, enter:

      Path and file name:    C:\GOLOMB21\GARSP.EXE  (adjust path as needed)
      Parameters:            (--none--)
      Working directory:     C:\GOLOMB21  (adjust path as needed)

On the "general" page, give the program object a title (e.g., "GOLOMB21") and associate any icon you like. The defaults on the other pages are probably appropriate, but you may change them if you like.

#### Win 3.x, Win 95, and OS/2 ...

After you test the program, please move this icon to your startup group so that it starts automatically! In Win 95, the startup file folder is usually "c:\windows\start menu\programs\startup".

### IV - Test the program

#### - DOS & OS/2

Change into the GOLOMB21 directory and type the command GARSP 13 (in a DOS window, for OS/2). The test should take a minute or so to complete. To stop the test, press the "CNTL-BREAK" keys simultaneously.

#### - Windows & OS/2

Type "13 -1" into a file called SAVE.TXT in the directory where you placed the program files. Then double click on the GOLOMB21 icon. You should see the output appearing in a DOS window. To stop the test, just close the window (yes, even if you are warned about saving data).

#### - DOS, OS/2 & Windows

When you are done testing, delete the two files in the GOLOMB21 directory called "save.txt" and "send.txt" (more about these later).

## Running GARSP

### Step 1 (Clearing "Send.Txt")

The _first_ time you run the GOLOMB21 program for real, you need to delete the file "send.txt" in your GOLOMB21 directory. It will have been created if you ran the test cited above.

### Step 2 (Starting Point: "Save.Txt")

Next you need to copy the START.TXT file we sent you to SAVE.TXT (overwriting the existing SAVE.TXT if it exists). Now just start the program (like in the test cited above).

As noted above, you can stop a particular run at any time you want by using the "Cntl-Break" keys, or by closing the GOLOMB21 window. When you restart later, it will pick up where it left off. We hope that you will put the program into Windows or OS/2 Start-Up group so that it automatically starts whenever you start Windows.

### Step 3 (Results)

Periodically (every week or so ... but not any more frequently) we would appreciate an email with the SEND.TXT file attached or embedded to the email. When you get close to needing a new ruler stub to work on we will send a new one with instructions. As stubs are completed, we will update the WEB page. We hope to have an automated server in late February 1998, so hopefully these procedures will change by then :)

## Appendices

### Special Note: Multitasking In Windows

This program has been setup to allow you to multitask. Multitask means that while the program is running, you can still use your computer to do other things.

If you do not have a Pentium or better, you may want to set the priority of the program to a low value so that you can multitask without any slowdown in speed. To do this in Windows 3.x, use the PIF Editor (in "Main" group) to edit the "C:\GOLOMB21.PIF" file, select "Advanced" and change the "Background Priority" to a lower value such as 25 (seems OK on average for a 486-33). In Windows 95, right-click on the shortcut icon, select the "Misc" tab and move the "Idle Sensitivity" slider to the right (higher sensitivity), or better yet, use the "idle" priority client that can be downloaded from the web page.

To multitask, all you need to do is to start the program. After it starts, just do whatever you would to start your other program, and GOLOMB21 will continue running in the background.

For those of you not familiar with multitasking, here are a few good tips. To cycle through all open applications hold down the "ALT" button and press the "TAB" key repeatedly until you see the application you want to work in. You can also do this in Win 3.1 by using the "CNTL" "ESC" key combo, but it puts you directly into the Task Manager. For DOS programs like GOLOMB21, remember you can switch from Full Screen to Windowed by using the "ALT" "ENTER" key combo. (The GOLOMB21 program runs faster in Full Screen mode, but if you want to shut it down, you have to switch back to Windowed mode and then close the window).

### About The GARSP Program

The GARSP program was designed to allow users to interrupt it without losing too much work, and then to pick up again later where they left off. The program does this by storing its progress in a file called "SAVE.TXT". This file is started at a known ruler stub, and the program then proceeds to search from this point forward. The term "ruler stub" is defined in detail in the GVANT program documentation, but briefly: it refers to a particular combination for the first 5 or so marks on the ruler.

The program outputs results to both the screen and to the SAVE.TXT file. What you'll see on the screen is a summary of each ruler stub being tested, with the following items:

      1. The number of tick marks (in our case, 21)
      2. The shortest known GOLOMB Ruler for that # of tick marks (333 so far)
      3. The ruler stub's first 5 tick mark locations (e.g., 1 3 5 7, with "0" also assumed)
      4. The number of seconds it took to solve the ruler stub (usually 0-10,000)
      5. The number of nodes it took to test this ruler stub (multiply this by 10^6).
      6. The number of nodes it took to test this ruler stub (add this to above).

As you see the stubs being output to the screen, glance at the second item (333 for a 21 mark ruler). We have arbitrarily decided to limit our search to 332, since we wish to "beat" 333! If you see this drop to 331 or less, EMAIL US IMMEDIATELY. Your program has found a shorter 21-mark ruler than any such ruler previously found! We want to know about such discoveries as soon as possible as the information can be used to speed up the search for other starting ruler stubs which have yet to be tested.

Also, note that it is up to you as to when to send results back to us. We would prefer that you run an entire ruler stub (e.g., if you started with 0 1 3 0 0, the stub is completed as soon as the "3" changes to a "4"). This can take a week or more depending on

      *  Your machine speed
      *  How long you keep your PC running (all night?)
      *  If you are multitasking in Windows
      *  What ruler stub you are working on.

We can send you simpler stubs at first to let you determine how difficult a stub you really want to work on.

When a stub is completed, please EMAIL us a copy of the "SEND.TXT" file with the phrase "SEND.TXT" in the comment field.

For those who are inquisitive about the send.txt file, please refer to the program to see how progress is stored along with any found rulers. The rulers are always stored on a single line beginning with a zero. If you don't see any ... don't worry, chances are only one or maybe two of us will find one for the OGR-21 ruler! BTW, as a safety precaution, newly found rulers are also stored in a second file called "newruler.txt".

Page last updated: Feb 17, 1998