private void createGrid(int m, int n, boolean edges) {
        double dy = 20 + 50 / Math.sqrt(m);
        double dx = 20 + 50 / Math.sqrt(n);
        System.out.println(dx + " " + dy);
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                createVertex(j * dx, i * dy, getNewVertexID());
            }
        }
        if (edges) {
            for (int i = 0; i < m; i++) {
                for (int j = 0; j < n; j++) {
                    if (j != n - 1) {
                        createEdge(vertices.get(i * n + j), vertices.get(i * n + j + 1));
                    }
                    if (i != m - 1) {
                        createEdge(vertices.get(i * n + j), vertices.get(i * n + j + n));
                    }
                }
            }
        }
        type = GraphType.grid;
    }