bicomp.c
Upload User: gzelex
Upload Date: 2007-01-07
Package Size: 707k
Code Size: 1k
Development Platform:

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. }