warshall algorithm to compute closure amtrix