// determining paths of length 2 // from a matrix giving direct connections for (s = 0; s < V; s++) { for (t = 0; t < V; t++) { tc[s][t] = 0; for (i = 0; i < V; i++) { //if (s == i || t == i) continue; if (edges[s][i] && edges[i][t]) { tc[s][t] = 1; break; } } } }