for (int t = 0; t < n; t++) {
                for (int i = 0; i < n; i++) {
                    if (graph[i][t] > 0) {
                        for (int j = 0; j < n; j++) {
                            if (graph[t][j] > 0) graph[i][j] = 1;