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@31
|
23 |
\todo Clarify this section.
|
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@31
|
41 |
[SEC]sec_graph_to_eps[SEC] Graph to EPS
|
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@31
|
46 |
of LEMON's approach to implement named parameters. Later it
|
kpeter@31
|
47 |
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@31
|
65 |
[TRAILER]
|
kpeter@31
|
66 |
*/
|
kpeter@31
|
67 |
}
|