diff --git a/Transitive Closure of a graph b/Transitive Closure of a graph new file mode 100644 index 0000000..3dcfd76 --- /dev/null +++ b/Transitive Closure of a graph @@ -0,0 +1,61 @@ +#include +using namespace std; + + +int in_graph[6][6] = +{ + {0, 1, 0, 0, 0, 0}, + {0, 0, 0, 1, 0, 0}, + {0, 1, 0, 0, 0, 0}, + {1, 0, 1, 0, 1, 0}, + {0, 1, 0, 1, 0, 1}, + {1, 0, 0, 0, 0, 0} + +}; + + +void trans_c(int in_graph[6][6],int n) +{ + int N=n; + int out_graph[N][N]; + int i,j,k; + + for(i=0; i>n; + cout<<"The Transitive closure matrix is:\n"; + trans_c(in_graph,n); +