public static void main(String[] args) {
        for (int i = 0; i < GRAPH_SIZE; i++) {
            for (int j = 0; j < GRAPH_SIZE; j++) {
                if (graph[i][j] == 0) {
                    // Set a huge number for initial distance if there is no
                    // direct path i-j in order comparison below to be easier.
                    // Do not use Integer.MAX_VALUE in order to escape overflow.
                    graph[i][j] = Integer.MAX_VALUE / 2;
                }
            }
        }

        for (int k = 0; k < GRAPH_SIZE; k++) {
            for (int i = 0; i < GRAPH_SIZE; i++) {
                for (int j = 0; j < GRAPH_SIZE; j++) {
                    if (i == j) {
                        continue;
                    }
                    if (graph[i][j] > graph[i][k] + graph[k][j]) {
                        // there is a path i-j through k which is shorter
                        graph[i][j] = graph[i][k] + graph[k][j];
                    }
                }
            }
        }

        printGraph();
    }