graph_gen.h
Upload User: gzelex
Upload Date: 2007-01-07
Package Size: 707k
Code Size: 4k
Development Platform:

MultiPlatform

  1. /*******************************************************************************
  2. +
  3. +  LEDA-R  3.2.3
  4. +
  5. +  graph_gen.h
  6. +
  7. +  Copyright (c) 1995  by  Max-Planck-Institut fuer Informatik
  8. +  Im Stadtwald, 66123 Saarbruecken, Germany     
  9. +  All rights reserved.
  10. *******************************************************************************/
  11. #ifndef LEDA_GRAPH_GEN_H
  12. #define LEDA_GRAPH_GEN_H
  13. //-----------------------------------------------------------------------------
  14. // graph generators
  15. //-----------------------------------------------------------------------------
  16. #include <LEDA/graph.h>
  17. #include <LEDA/node_array.h>
  18. /*{Manpage {} {graph_gen} {Graph Generators} }*/
  19. extern void complete_graph(graph& G, int n);
  20. /*{Mfuncl   creates a complete graph $G$ with $n$ nodes. }*/
  21. extern void random_graph(graph& G, int n, int m);
  22. /*{Mfuncl   creates a random graph $G$ with $n$ nodes and $m$ edges. }*/
  23. extern void test_graph(graph& G);
  24. /*{Mfuncl   creates interactively a user defined graph $G$. }*/
  25. extern void complete_bigraph(graph& G, int a, int b, list<node>& A, list<node>& B);
  26. /*{Mfuncl   creates a complete bipartite graph $G$ with $a$ nodes 
  27.             on side $A$ and $b$ nodes on side $B$. All edges are 
  28.             directed from $A$ to $B$. }*/
  29. extern void random_bigraph(graph& G, int a, int b, int m, list<node>& A, list<node>& B);
  30. /*{Mfuncl   creates a random bipartite graph $G$ with $a$ nodes on 
  31.             side $A$, $b$ nodes on side $B$, and $m$ edges. All 
  32.             edges are directed from $A$ to $B$. }*/
  33. extern void test_bigraph(graph& G, list<node>& A, list<node>& B);
  34. /*{Mfuncl   creates interactively a user defined bipartite
  35.     graph $G$ with sides $A$ and $B$. All edges are
  36.     directed from $A$ to $B$. }*/
  37. extern void random_planar_graph(graph& G, int n);
  38. /*{Mfuncl   creates a random planar graph $G$ with $n$ nodes. }*/
  39. extern void random_planar_graph(graph& G, node_array<double>& xcoord, node_array<double>& ycoord, int n);
  40. /* cheat the manual extractor:
  41. void random_planar_graph(graph& G, node_array<double>& xcoord, ycoord, int n);
  42. */
  43. /*{Mfuncl   creates a random planar graph $G$ with $n$ nodes embedded into
  44.             the unit sqare. The embedding is given by $xcoord[v]$ and
  45.             $ycoord[v]$ for every node $v$ of $G$. }*/
  46. extern void triangulated_planar_graph(graph& G, int n);
  47. /*{Mfuncl   creates a triangulated planar graph $G$ with $n$ nodes. }*/
  48. extern void triangulated_planar_graph(graph& G, node_array<double>& xcoord, node_array<double>& ycoord, int n);
  49. /*
  50. void triangulated_planar_graph(graph& G, node_array<double>& xcoord, ycoord, int n);
  51. */
  52. /*{Mfuncl   creates a triangulated planar graph $G$ with $n$ nodes embedded
  53.             into the unit sqare. The embedding is given by $xcoord[v]$ and
  54.             $ycoord[v]$ for every node $v$ of $G$. }*/
  55. extern void grid_graph(graph& G,int n);
  56. /*{Mfuncl   creates a grid graph $G$ of size $ntimes n$ nodes. }*/
  57. extern void grid_graph(graph&,node_array<double>& xcoord, node_array<double>& ycoord, int n);
  58. /*{Mfuncl   creates a grid graph $G$ of size $ntimes n$ nodes embedded
  59.             into the unit sqare. The embedding is given by $xcoord[v]$ and
  60.             $ycoord[v]$ for every node $v$ of $G$. }*/
  61. extern void cmdline_graph(graph& G, int argc, char** argv);
  62. /*{Mfuncl   builds graph $G$ as specified by the command line arguments:\
  63. prog hbox to 1.5cm{hfill}       $longrightarrow$ test_graph()\
  64. prog hbox to 1.5cm{$n$hfill}    $longrightarrow$ complete_graph($n$)\
  65. prog hbox to 1.5cm{$n$ $m$hfill} $longrightarrow$ test_graph($n,m$)\
  66. prog hbox to 1.5cm{$file$hfill} $longrightarrow$ $G$.read_graph($file$). 
  67. }*/
  68. #endif