tools.dox
author Peter Kovacs <kpeter@inf.elte.hu>
Mon, 01 Mar 2010 02:30:00 +0100
changeset 58 10b6a5b7d4c0
parent 46 58557724a139
permissions -rw-r--r--
Improve Algorithms section (it is still under construction)
kpeter@31
     1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
kpeter@31
     2
 *
kpeter@31
     3
 * This file is a part of LEMON, a generic C++ optimization library.
kpeter@31
     4
 *
kpeter@32
     5
 * Copyright (C) 2003-2010
kpeter@31
     6
 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
kpeter@31
     7
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
kpeter@31
     8
 *
kpeter@31
     9
 * Permission to use, modify and distribute this software is granted
kpeter@31
    10
 * provided that this copyright notice appears in all copies. For
kpeter@31
    11
 * precise terms see the accompanying LICENSE file.
kpeter@31
    12
 *
kpeter@31
    13
 * This software is provided "AS IS" with no warranty of any kind,
kpeter@31
    14
 * express or implied, and with no claim as to its suitability for any
kpeter@31
    15
 * purpose.
kpeter@31
    16
 *
kpeter@31
    17
 */
kpeter@31
    18
kpeter@31
    19
namespace lemon {
kpeter@31
    20
/**
kpeter@31
    21
[PAGE]sec_tools[PAGE] Tools
kpeter@31
    22
kpeter@45
    23
\todo This page is under construction.
kpeter@31
    24
kpeter@31
    25
[SEC]sec_aux_structures[SEC] Auxiliary Data Structures
kpeter@31
    26
Graph algorithms depend on various auxiliary data structures and algorithms.
kpeter@31
    27
For example, heaps play an important role in Dijkstra and Prim
kpeter@31
    28
algorithms, both the theoretical and practical performance of them
kpeter@31
    29
are determined by the applied heap implementation.
kpeter@31
    30
kpeter@31
    31
LEMON implements various such auxiliary tools. For instance,
kpeter@31
    32
several data structures are available for maintaining \e disjoint \e sets.
kpeter@31
    33
\ref UnionFind is the classical union-find data structure, which is
kpeter@31
    34
used to implement the \ref Kruskal algorithm.
kpeter@31
    35
The \ref UnionFindEnum and \ref HeapUnionFind classes are used in
kpeter@31
    36
matching algorithms, the first one supports the enumeration of the
kpeter@31
    37
items stored in the sets, while the second one also assigns priorities to the
kpeter@31
    38
elements and an item having minimum priority can be retrieved set-wise.
kpeter@31
    39
kpeter@31
    40
kpeter@45
    41
[SEC]sec_graph_to_eps[SEC] Postscript Exporting
kpeter@31
    42
kpeter@31
    43
Another nice feature of the library is \ref graphToEps(), a highly
kpeter@31
    44
configurable graph displaying tool (using EPS output format).
kpeter@31
    45
Originally, it was developed to evaluate the flexibility and scalability
kpeter@57
    46
of LEMON's approach to implement \ref named-param "named parameters".
kpeter@57
    47
Later it has been evolved into a versatile tool featuring above 35 named
kpeter@32
    48
parameters. The following code demonstrates its typical use.
kpeter@31
    49
kpeter@31
    50
\code
kpeter@31
    51
  graphToEps(g, "graph.eps")
kpeter@31
    52
    .coords(coords)
kpeter@31
    53
    .title("Sample EPS figure")
kpeter@31
    54
    .copyright("(c) 2003-2010 LEMON Project")
kpeter@31
    55
    .absoluteNodeSizes().absoluteArcWidths()
kpeter@31
    56
    .nodeScale(2).nodeSizes(sizes)
kpeter@31
    57
    .nodeShapes(shapes)
kpeter@31
    58
    .nodeColors(composeMap(palette, colors))
kpeter@31
    59
    .arcColors(composeMap(palette, acolors))
kpeter@31
    60
    .arcWidthScale(.4).arcWidths(widths)
kpeter@31
    61
    .nodeTexts(id).nodeTextSize(3)
kpeter@31
    62
    .run();
kpeter@31
    63
\endcode
kpeter@31
    64
kpeter@45
    65
Using this feature, various nice images can be generated from graphs,
kpeter@45
    66
like this one.
kpeter@45
    67
kpeter@45
    68
\image html graph_to_eps.png
kpeter@45
    69
kpeter@57
    70
For more examples, see \ref graph_to_eps_demo.cc in the demo directory
kpeter@57
    71
of the LEMON source.
kpeter@57
    72
kpeter@46
    73
kpeter@46
    74
[SEC]sec_time_count[SEC] Time Measuring and Counting
kpeter@46
    75
kpeter@46
    76
See \ref timecount.
kpeter@46
    77
kpeter@46
    78
kpeter@46
    79
[SEC]sec_random[SEC] Random Number Generation
kpeter@46
    80
kpeter@46
    81
See \ref Random.
kpeter@46
    82
kpeter@46
    83
kpeter@46
    84
[SEC]sec_arg_parser[SEC] Argument Parser
kpeter@46
    85
kpeter@46
    86
See \ref ArgParser.
kpeter@46
    87
kpeter@31
    88
[TRAILER]
kpeter@31
    89
*/
kpeter@31
    90
}