1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
3 * This file is a part of LEMON, a generic C++ optimization library.
5 * Copyright (C) 2003-2008
6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 * (Egervary Research Group on Combinatorial Optimization, EGRES).
9 * Permission to use, modify and distribute this software is granted
10 * provided that this copyright notice appears in all copies. For
11 * precise terms see the accompanying LICENSE file.
13 * This software is provided "AS IS" with no warranty of any kind,
14 * express or implied, and with no claim as to its suitability for any
20 @defgroup datas Data Structures
21 This group describes the several data structures implemented in LEMON.
25 @defgroup graphs Graph Structures
27 \brief Graph structures implemented in LEMON.
29 The implementation of combinatorial algorithms heavily relies on
30 efficient graph implementations. LEMON offers data structures which are
31 planned to be easily used in an experimental phase of implementation studies,
32 and thereafter the program code can be made efficient by small modifications.
34 The most efficient implementation of diverse applications require the
35 usage of different physical graph implementations. These differences
36 appear in the size of graph we require to handle, memory or time usage
37 limitations or in the set of operations through which the graph can be
38 accessed. LEMON provides several physical graph structures to meet
39 the diverging requirements of the possible users. In order to save on
40 running time or on memory usage, some structures may fail to provide
41 some graph features like arc/edge or node deletion.
43 You are free to use the graph structure that fit your requirements
44 the best, most graph algorithms and auxiliary data structures can be used
45 with any graph structures.
51 \brief Map structures implemented in LEMON.
53 This group describes the map structures implemented in LEMON.
55 LEMON provides several special purpose maps that e.g. combine
56 new maps from existing ones.
60 @defgroup graph_maps Graph Maps
62 \brief Special graph-related maps.
64 This group describes maps that are specifically designed to assign
65 values to the nodes and arcs of graphs.
70 \defgroup map_adaptors Map Adaptors
72 \brief Tools to create new maps from existing ones
74 This group describes map adaptors that are used to create "implicit"
77 Most of them are \ref lemon::concepts::ReadMap "read-only maps".
78 They can make arithmetic and logical operations between one or two maps
79 (negation, shifting, addition, multiplication, logical 'and', 'or',
80 'not' etc.) or e.g. convert a map to another one of different Value type.
82 The typical usage of this classes is passing implicit maps to
83 algorithms. If a function type algorithm is called then the function
84 type map adaptors can be used comfortable. For example let's see the
85 usage of map adaptors with the \c digraphToEps() function.
87 Color nodeColor(int deg) {
89 return Color(0.5, 0.0, 0.5);
90 } else if (deg == 1) {
91 return Color(1.0, 0.5, 1.0);
93 return Color(0.0, 0.0, 0.0);
97 Digraph::NodeMap<int> degree_map(graph);
99 digraphToEps(graph, "graph.eps")
100 .coords(coords).scaleToA4().undirected()
101 .nodeColors(composeMap(functorToMap(nodeColor), degree_map))
104 The \c functorToMap() function makes an \c int to \c Color map from the
105 \e nodeColor() function. The \c composeMap() compose the \e degree_map
106 and the previously created map. The composed map is a proper function to
107 get the color of each node.
109 The usage with class type algorithms is little bit harder. In this
110 case the function type map adaptors can not be used, because the
111 function map adaptors give back temporary objects.
115 typedef Digraph::ArcMap<double> DoubleArcMap;
116 DoubleArcMap length(graph);
117 DoubleArcMap speed(graph);
119 typedef DivMap<DoubleArcMap, DoubleArcMap> TimeMap;
120 TimeMap time(length, speed);
122 Dijkstra<Digraph, TimeMap> dijkstra(graph, time);
123 dijkstra.run(source, target);
125 We have a length map and a maximum speed map on the arcs of a digraph.
126 The minimum time to pass the arc can be calculated as the division of
127 the two maps which can be done implicitly with the \c DivMap template
128 class. We use the implicit minimum time map as the length map of the
129 \c Dijkstra algorithm.
133 @defgroup paths Path Structures
135 \brief Path structures implemented in LEMON.
137 This group describes the path structures implemented in LEMON.
139 LEMON provides flexible data structures to work with paths.
140 All of them have similar interfaces and they can be copied easily with
141 assignment operators and copy constructors. This makes it easy and
142 efficient to have e.g. the Dijkstra algorithm to store its result in
143 any kind of path structure.
145 \sa lemon::concepts::Path
150 @defgroup auxdat Auxiliary Data Structures
152 \brief Auxiliary data structures implemented in LEMON.
154 This group describes some data structures implemented in LEMON in
155 order to make it easier to implement combinatorial algorithms.
160 @defgroup algs Algorithms
161 \brief This group describes the several algorithms
162 implemented in LEMON.
164 This group describes the several algorithms
165 implemented in LEMON.
169 @defgroup search Graph Search
171 \brief Common graph search algorithms.
173 This group describes the common graph search algorithms like
174 Breadth-first search (Bfs) and Depth-first search (Dfs).
178 @defgroup shortest_path Shortest Path algorithms
180 \brief Algorithms for finding shortest paths.
182 This group describes the algorithms for finding shortest paths in graphs.
186 @defgroup spantree Minimum Spanning Tree algorithms
188 \brief Algorithms for finding a minimum cost spanning tree in a graph.
190 This group describes the algorithms for finding a minimum cost spanning
195 @defgroup utils Tools and Utilities
196 \brief Tools and utilities for programming in LEMON
198 Tools and utilities for programming in LEMON.
202 @defgroup gutils Basic Graph Utilities
204 \brief Simple basic graph utilities.
206 This group describes some simple basic graph utilities.
210 @defgroup misc Miscellaneous Tools
212 \brief Tools for development, debugging and testing.
214 This group describes several useful tools for development,
215 debugging and testing.
219 @defgroup timecount Time measuring and Counting
221 \brief Simple tools for measuring the performance of algorithms.
223 This group describes simple tools for measuring the performance
228 @defgroup exceptions Exceptions
230 \brief Exceptions defined in LEMON.
232 This group describes the exceptions defined in LEMON.
236 @defgroup io_group Input-Output
237 \brief Graph Input-Output methods
239 This group describes the tools for importing and exporting graphs
240 and graph related data. Now it supports the LEMON format
241 and the encapsulated postscript (EPS) format.
245 @defgroup lemon_io LEMON Input-Output
247 \brief Reading and writing \ref lgf-format "LEMON Graph Format".
249 This group describes methods for reading and writing
250 \ref lgf-format "LEMON Graph Format".
254 @defgroup eps_io Postscript exporting
256 \brief General \c EPS drawer and graph exporter
258 This group describes general \c EPS drawing methods and special
259 graph exporting tools.
264 @defgroup concept Concepts
265 \brief Skeleton classes and concept checking classes
267 This group describes the data/algorithm skeletons and concept checking
268 classes implemented in LEMON.
270 The purpose of the classes in this group is fourfold.
272 - These classes contain the documentations of the concepts. In order
273 to avoid document multiplications, an implementation of a concept
274 simply refers to the corresponding concept class.
276 - These classes declare every functions, <tt>typedef</tt>s etc. an
277 implementation of the concepts should provide, however completely
278 without implementations and real data structures behind the
279 interface. On the other hand they should provide nothing else. All
280 the algorithms working on a data structure meeting a certain concept
281 should compile with these classes. (Though it will not run properly,
282 of course.) In this way it is easily to check if an algorithm
283 doesn't use any extra feature of a certain implementation.
285 - The concept descriptor classes also provide a <em>checker class</em>
286 that makes it possible to check whether a certain implementation of a
287 concept indeed provides all the required features.
289 - Finally, They can serve as a skeleton of a new implementation of a concept.
295 @defgroup graph_concepts Graph Structure Concepts
297 \brief Skeleton and concept checking classes for graph structures
299 This group describes the skeletons and concept checking classes of LEMON's
300 graph structures and helper classes used to implement these.
306 @defgroup demos Demo programs
308 Some demo programs are listed here. Their full source codes can be found in
309 the \c demo subdirectory of the source tree.
311 It order to compile them, use <tt>--enable-demo</tt> configure option when