Welcome to the SPACE FILLING CURVE (SFC) Heuristic Program!  This program was 

originally coded by W. B. Carter (1990), and extended by Chan (2005) in the 

"Measuring spatial separation" chapter of LOCATION, TRANSPORT & LAND USE. 



SFC is primarily a heuristic vehicle-routing algorithm. This directory holds 

the capability to accomplish 2- and 3- dimensional space-filling-curves.



SOFTWARE

********



The contents of this directory consist of the following:



1) GWBASIC is the executable file for compiling a source BASIC program.



2) SFC.BAS is a basic program performing the space-filling-curve 

calculations.



3) SFC.BAT is a DOS batch-file that starts GWBASIC, loading , compiling and 

running SFC.BAS.



4) Several sample text files (delimited) are also included, containing data 

and operating instructions.



HOW TO USE THIS SOFTWARE

************************



I. Copy the contents of the SPACEFIL directory to a hard-drive directory.



II. At the appropriate DOS prompt, type "sfc"



III. Now just answer the questions!



(At any time, one can exit by pressing 'CTRL' and c, and then typing "system" 

to exit GWBASIC. A short text-file that explains the most basic of GWBASIC 

commands can be located under the BASIC.TXT file at the root directory)



INPUTS

******



The files named after major U.S. cities are good examples of how input data 

files must be set up.



EXAMPLE:  (BOSTON)



"ALBANY",314,37

"BOSTON",331,34

"NORTHAMPTON",325,37



This program was originally designed for use with global (latitude-longitude) 

positions converted to grid positions.  The first value must be a name for 

its associated geographic-location and must be enclosed in quotation marks " 

".  The next two values are the x and y coordinates (navigational grid values 

for the example).  As with  any delimited file, you must include the commas 

to separate the inputs. The space-filling-curve heuristic uses these last two 

values to transform a two- or three-dimensional space into the unit interval. 

(For 3-dimensional problems the program will prompt for the third dimension 

for each geographic location while it is executing.)



For example, say you have points 1,2, and 3.  Their x-y coordinates are 

(1,1), (2,2) and (3,3) respectively.  The input file should read:



"1",1,1

"2",2,2

"3",3,3



In a 2-dimensional calculation, the theta values (the unit-interval or 

Sierpinski-curve values) will be produced normally.  For a 3-dimensional 

problem the program will ask for the z coordinate for each geographic 

location, as mentioned above.



Another value the program prompts for is the "number of binary digits."  This 

value tells the program how many times to divide the "unit square or cube" 

for mapping to the unit interval.  The object here is to use the smallest 

value possible that will return a unique theta value for each point.  This 

holds true for both the 2- and 3-dimensional cases.  Three-dimensional cases 

are tricky.  The best way to obtain answers in 3-dimensional cases is to 

start with a "binary digit" value of 1, then try 2, then try 3, etc.  The 

program runs fast, so this does not take as much time as one would think. 

(NOTE:  The 3-dimensional cases cause the arrays to grow rapidly, eating up 

memory!  This program has returned good results for up to 52 3-dimensional 

points.  Above this number, the 3-dimensional capability is unknown!  The 2-

dimensional capability has been tested to 89 2-dimensional points.)



				*	*	*



GOOD LUCK and have fun! The Space Filling Curve is an amazingly versatile 

tool!

