tools/lgf-gen.cc
changeset 859 ac5f72c48367
parent 623 7c1324b35d89
child 1001 89e1877e335f
equal deleted inserted replaced
6:4bd5c9c2350b 7:64701ea2035c
    16  *
    16  *
    17  */
    17  */
    18 
    18 
    19 /// \ingroup tools
    19 /// \ingroup tools
    20 /// \file
    20 /// \file
    21 /// \brief Special plane digraph generator.
    21 /// \brief Special plane graph generator.
    22 ///
    22 ///
    23 /// Graph generator application for various types of plane graphs.
    23 /// Graph generator application for various types of plane graphs.
    24 ///
    24 ///
    25 /// See
    25 /// See
    26 /// \code
    26 /// \code
    27 ///   lgf-gen --help
    27 ///   lgf-gen --help
    28 /// \endcode
    28 /// \endcode
    29 /// for more info on the usage.
    29 /// for more information on the usage.
    30 
    30 
    31 #include <algorithm>
    31 #include <algorithm>
    32 #include <set>
    32 #include <set>
    33 #include <ctime>
    33 #include <ctime>
    34 #include <lemon/list_graph.h>
    34 #include <lemon/list_graph.h>
   684   std::string ndist("disc");
   684   std::string ndist("disc");
   685   ap.refOption("n", "Number of nodes (default is 100)", N)
   685   ap.refOption("n", "Number of nodes (default is 100)", N)
   686     .intOption("g", "Girth parameter (default is 10)", 10)
   686     .intOption("g", "Girth parameter (default is 10)", 10)
   687     .refOption("cities", "Number of cities (default is 1)", num_of_cities)
   687     .refOption("cities", "Number of cities (default is 1)", num_of_cities)
   688     .refOption("area", "Full relative area of the cities (default is 1)", area)
   688     .refOption("area", "Full relative area of the cities (default is 1)", area)
   689     .refOption("disc", "Nodes are evenly distributed on a unit disc (default)",disc_d)
   689     .refOption("disc", "Nodes are evenly distributed on a unit disc (default)",
       
   690                disc_d)
   690     .optionGroup("dist", "disc")
   691     .optionGroup("dist", "disc")
   691     .refOption("square", "Nodes are evenly distributed on a unit square", square_d)
   692     .refOption("square", "Nodes are evenly distributed on a unit square",
       
   693                square_d)
   692     .optionGroup("dist", "square")
   694     .optionGroup("dist", "square")
   693     .refOption("gauss",
   695     .refOption("gauss", "Nodes are located according to a two-dim Gauss "
   694             "Nodes are located according to a two-dim gauss distribution",
   696                "distribution", gauss_d)
   695             gauss_d)
       
   696     .optionGroup("dist", "gauss")
   697     .optionGroup("dist", "gauss")
   697 //     .mandatoryGroup("dist")
       
   698     .onlyOneGroup("dist")
   698     .onlyOneGroup("dist")
   699     .boolOption("eps", "Also generate .eps output (prefix.eps)")
   699     .boolOption("eps", "Also generate .eps output (<prefix>.eps)")
   700     .boolOption("nonodes", "Draw the edges only in the generated .eps")
   700     .boolOption("nonodes", "Draw only the edges in the generated .eps output")
   701     .boolOption("dir", "Directed digraph is generated (each arcs are replaced by two directed ones)")
   701     .boolOption("dir", "Directed graph is generated (each edge is replaced by "
   702     .boolOption("2con", "Create a two connected planar digraph")
   702                 "two directed arcs)")
       
   703     .boolOption("2con", "Create a two connected planar graph")
   703     .optionGroup("alg","2con")
   704     .optionGroup("alg","2con")
   704     .boolOption("tree", "Create a min. cost spanning tree")
   705     .boolOption("tree", "Create a min. cost spanning tree")
   705     .optionGroup("alg","tree")
   706     .optionGroup("alg","tree")
   706     .boolOption("tsp", "Create a TSP tour")
   707     .boolOption("tsp", "Create a TSP tour")
   707     .optionGroup("alg","tsp")
   708     .optionGroup("alg","tsp")
   708     .boolOption("tsp2", "Create a TSP tour (tree based)")
   709     .boolOption("tsp2", "Create a TSP tour (tree based)")
   709     .optionGroup("alg","tsp2")
   710     .optionGroup("alg","tsp2")
   710     .boolOption("dela", "Delaunay triangulation digraph")
   711     .boolOption("dela", "Delaunay triangulation graph")
   711     .optionGroup("alg","dela")
   712     .optionGroup("alg","dela")
   712     .onlyOneGroup("alg")
   713     .onlyOneGroup("alg")
   713     .boolOption("rand", "Use time seed for random number generator")
   714     .boolOption("rand", "Use time seed for random number generator")
   714     .optionGroup("rand", "rand")
   715     .optionGroup("rand", "rand")
   715     .intOption("seed", "Random seed", -1)
   716     .intOption("seed", "Random seed", -1)