/* decomp.c graph.h を同じディレクトリに download して用いよ コンパイル命令と実行命令: gcc decomp.c -o decomp ./decomp K. Shiota 2005.6.12 */ #define MAXORDER 64 #include "graph.h" main() { Graph g; // 探索対象グラフ Graph h; // 連結成分 List o; // 連結成分の頂点数のリスト List s; // 連結成分の頂点数インデックスのリスト List v; // 連結成分の頂点のリスト int i,j,n,t,k; // 乱数の初期化 srand(time(NULL)); // ランダムなグラフの場合 g=RandomGraph(64,0.03); printf("\nGraph :\n"); WriteGraph(g); printf("\nHit any key."); getchar(); k=ConnectedDecompose(g,&o,&s,&v); printf("\nConnected Decomposition :\n"); for(i=0;i