bicomp.c
上传用户:gzelex
上传日期:2007-01-07
资源大小:707k
文件大小:1k
开发平台:

MultiPlatform

  1. #include <LEDA/graph.h>
  2. #include <LEDA/ugraph.h>
  3. #include <LEDA/graph_alg.h>
  4. main()
  5. {
  6. UGRAPH<int,int> G;
  7. test_ugraph(G);
  8. edge_array<int> compnum(G);
  9. float T = used_time();
  10. cout << "BI_COMPONENTS   ";
  11. cout.flush();
  12. int n = BICONNECTED_COMPONENTS(G,compnum);
  13. cout << string("   %6.2f sec n",used_time(T));
  14. newline;
  15. cout << n << " componentsn";
  16. newline;
  17. if (Yes("ausgabe?")) 
  18.  { edge e;
  19.    forall_edges(e,G) 
  20.    { G.print_edge(e);
  21.      cout << string("  c = %3d  n", compnum[e]);
  22.     }
  23.   }
  24. newline;
  25. return 0;
  26. }