home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / diverses / leda / prog / graph / comp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-15  |  649 b   |  42 lines

  1. #include <LEDA/graph.h>
  2. #include <LEDA/ugraph.h>
  3. #include <LEDA/graph_alg.h>
  4.  
  5. declare2(GRAPH,int,int)
  6.  
  7. main()
  8. {
  9.  
  10. GRAPH(int,int) G;
  11.  
  12. test_graph(G);
  13.  
  14. ugraph G2(G);
  15.  
  16. node_array(int) compnum(G2);
  17. node_array(int) compnum1(G2);
  18.  
  19. float T = used_time();
  20. cout << "COMPONENTS   ";
  21. cout.flush();
  22. COMPONENTS(G2,compnum);
  23. cout << form("   %6.2f sec \n",used_time(T));
  24. newline;
  25.  
  26. cout << "COMPONENTS 1 ";
  27. cout.flush();
  28. COMPONENTS1(G2,compnum1);
  29. cout << form("   %6.2f sec \n",used_time(T));
  30.  
  31.  
  32. if (Yes("ausgabe?")) 
  33.  { node v;
  34.    forall_nodes(v,G2) 
  35.    { G2.print_node(v);
  36.      cout << form("  c = %3d   c1 = %3d \n", compnum[v],compnum1[v]);
  37.     }
  38.   }
  39. newline;
  40.  
  41. }
  42.