Files

Instructions

To use this tool, you must modify your program to read from standard in and writes to standard out. Note that this does not effect that code that you submit, which must simply implement the described methods. The protocol for reading and writing input and output can be described most simply by the following pseudocode:
  function readArray() {
    length = readInt()
    for (i = 0; i < length; i++) {
      ret[i] = readInt()
    }
    return ret
  }
  function main() {
    G = readArray()
    initialize(G)
    while(timeLeft()) {
      H = readArray()
      f = query(H)
      for(i = 0; i < length(f); i++) {
        printLine(f[i])
      }
      flush(stdout)
    }
  }
  
The readInt() function should simply read an integer from standard in. Each integer will be on a line by itself. Note that it is up to you to keep track of time when using the offline tester, as it will not kill your process when time has expired.

As standard out is now reserved for communication with the testing harness, you cannot debug by printing to it. Instead, you should print debugging output to standard error, which will be forwarded to the console by the testing program.

To run the tool, you should simply execute:
java -jar Tester.jar -exec <cmd> -seed <seed>
Here <cmd> is the command to execute and <seed> is a seed for the random number generator. Note that if <cmd> has a space in it, as in java SubgraphIsomorphism, you must surround it with quotes.

To speed up testing, graphs will be cached to disk in the directory you run the command in (in files named cache.<seed>). If you would like to disable this feature, add the -nocache flag.