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

MultiPlatform

  1. #include <LEDA/graph_alg.h>
  2. main(int argc,char** argv)
  3. {
  4. node v;
  5. int  i = 0;
  6. GRAPH<int,int> G;
  7. cmdline_graph(G,argc,argv);
  8. node_array<int> xcoord(G), ycoord(G);
  9. cout << "Planarity Test ... " << flush;
  10. float T = used_time();
  11. bool plan = PLANAR(G);  
  12. cout << string(" time = %.2f sec", used_time(T)) << endl;
  13. if (plan)  
  14.     cout << "Graph is planar" << endl;
  15. else
  16.    { cout << "Graph is not planar." << endl;
  17.      cout << "I compute a a Kuratowsky Subgraph ..." << endl;
  18.      list<edge> L;
  19.      edge e;
  20.      PLANAR(G,L);  
  21.      forall(e,L) 
  22.      { G.print_edge(e);
  23.        newline;
  24.       }
  25.      newline;
  26.     }
  27.   return 0;
  28. }