LEMON Tutorial
59
|
Graph algorithms depend on various auxiliary data structures and algorithms. For example, heaps play an important role in Dijkstra and Prim algorithms, both the theoretical and practical performance of them are determined by the applied heap implementation.
LEMON implements various such auxiliary tools. For instance, several data structures are available for maintaining disjoint sets. UnionFind is the classical union-find data structure, which is used to implement the Kruskal algorithm. The UnionFindEnum and HeapUnionFind classes are used in matching algorithms, the first one supports the enumeration of the items stored in the sets, while the second one also assigns priorities to the elements and an item having minimum priority can be retrieved set-wise.
Another nice feature of the library is graphToEps(), a highly configurable graph displaying tool (using EPS output format). Originally, it was developed to evaluate the flexibility and scalability of LEMON's approach to implement named parameters. Later it has been evolved into a versatile tool featuring above 35 named parameters. The following code demonstrates its typical use.
Using this feature, various nice images can be generated from graphs, like this one.
For more examples, see graph_to_eps_demo.cc in the demo directory of the LEMON source.
See Time Measuring and Counting.
See Random.
See ArgParser.
<< 11 LEMON Graph Format | Home | 13 gLemon >>