private void createTSPFile(int dimension) throws IOException
    {
        FileWriter writer = new FileWriter(path, false);
        PrintWriter printer = new PrintWriter(writer);
        printer.printf("%s" + "%n", "NAME: " + path);
        printer.printf("%s" + "%n", "TYPE: TSP");
        printer.printf("%s" + "%n", "DIMENSION: " + dimension);
        printer.printf("%s" + "%n", "EDGE_WEIGHT_TYPE: EXPLICIT");
        printer.printf("%s" + "%n", "EDGE_WEIGHT_FORMAT: LOWER_DIAG_ROW");
        printer.printf("%s" + "%n", "EDGE_WEIGHT_SECTION");
        
        for(int i = 0; i < dimension; i++)
        {
            for(int j = 0; j <= i; j ++)
            {
                try
                {
                    printer.printf("%s" + "%n", graph[i][j]);
                }
                catch (NullPointerException e)
                {
                    printer.printf("%s" + "%n", "2");
                }
            }
        }
        
        printer.printf("%s" + "%n", "EOF");
        printer.flush();
        printer.close();
    }