CompoundGraphDrawing Visualization

To aid in the development of your submission, we are providing a visualization tool to competitors. The tool is packaged as an executable jar, which can be run either by double clicking it (in windows anyway) or from the command line as "java -jar CGD.jar".

As in previous contests, to use this visualization tool, you should create an application that communicates with the tool via standard in and standard out. Note that this does not effect the way your program should work when you submit it on the TopCoder website. The program that you write for the visualizer should start by reading the parameters, N, M, C, L, S, and P from standard in, all given on one line. You should then read N lines, where line i describes node i in the format "PARENT MINWIDTH MINHEIGHT". You should then read M lines describing M edges in the same format described in the problem statement. You should then print N+M lines to standard out in the same format as the elements of the string array you would return.

For instance, to use the visualizer, you might implement the following pseudocode, and adapt your solution to use it:
        N = nextInt()
        M = nextInt()
        C = nextInt()
        L = nextInt()
        S = nextInt()
        P = nextInt()
        for(i = 0; i<N; i++){
            parent[i] = nextInt()
            width[i] = nextInt()
            height[i] = nextInt()
        nextLine()   //make sure to finish consuming the last line describing the nodes
        for(int i = 0; i<M; i++){
            hyperedges[i] = sc.nextLine();
        s = draw(parent,width,height,hyperedges,C,L,S,P);
        for(int i = 0; i<N+M; i++)

Using the visualizer

To use the visualizer, you must have Java 1.5 or greater installed. To run the visualizer, you can execute the command "java -jar CHD.jar". This will open up a new window containing the visualization, along with a number of controls. The first thing you will need to do is specify the executable you have made for your drawing code. You may either enter its path, or select it via the button provided. If your executable requires arguments, enter them in the provided field. For example, if your executable is a Java class CompoundGraphDrawing.class, you should enter something like "java CompoundGraphDrawing" (without the quotes) in this field (replacing "java" with the full path to the Java executable if necessary). The exact details of what you enter here will depend on your language choice. In particular, in Java, you will need to make sure that the class file is in the same directory as CGD.jar, or else you will need to specify a classpath along with the executable location and class name.

To test the examples, you must specify a file containing tests. The file should be formatted like the provided examples file, and the uncompressed tests.gz file. The line parameter gives the line number into the file, and hence the test number. For both files, 0-9 correspond to the examples of the same number. For the tests.gz file, 10-10009 correspond to the remaining tests. The seed field is used to seed the random number generator for the minimum sizes and C, L, S and P parameters.

Finally, the slider on the left of the display controls the zoom, while clicking and dragging move the image around.

Command Line Options

You can specify a number of parameters on the command line to simplify the automation of testing (though you don't need to use any of them). For example, "java -jar Polygon.jar -line 5" will set line to 5 when running the tool.
-file <file> Specify file
-line <line> Specify line
-seed <seed> Specify the initial seed
-exec <command> Specify the command to execute your code
-novisRun the test case without the visualizer (requires -exec, implies -go)
-goStart running immediately (requires -exec)
-onewindowRun with one window instead of 3

Final Notes