# HG changeset patch # User Peter Kovacs # Date 1266761255 -3600 # Node ID 236e7061b70dfbb7d2f9db089564591cc95b18cf # Parent c8be1109221b4ac0575315523caf01412c395d0b Extend the graphs section diff -r c8be1109221b -r 236e7061b70d graphs.dox --- a/graphs.dox Sat Feb 20 21:54:52 2010 +0100 +++ b/graphs.dox Sun Feb 21 15:07:35 2010 +0100 @@ -42,8 +42,9 @@ The \ref concepts::Digraph "Digraph concept" describes the common interface of directed graphs (without any sensible implementation), while the \ref concepts::Graph "Graph concept" describes the undirected graphs. -Any generic graph algorithm should only exploit the features of the -corresponding graph concept. (It should compile with the +A generic graph algorithm should only exploit the features of the +corresponding graph concept so that it could be applied to any graph +structure. (Such an algorithm should compile with the \ref concepts::Digraph "Digraph" or \ref concepts::Graph "Graph" type, but it will not run properly, of course.) @@ -54,11 +55,18 @@ An actual graph implementation may have various additional functionalities according to its purpose. +Another advantage of this design is that you can write your own graph classes, +if you would like to. +As long as they provide the interface defined in one of the graph concepts, +all the LEMON algorithms and classes will work with them properly. + [SEC]sec_digraph_types[SEC] Digraph Structures The already used \ref ListDigraph class is the most versatile directed -graph structure. Apart from the general digraph functionalities, it +graph structure. As its name suggests, it is based on linked lists, +therefore iterating through its nodes and arcs is fast and it is quite +flexible. Apart from the general digraph functionalities, it provides operations for adding and removing nodes and arcs, changing the source or target node of an arc, and contracting and splitting nodes or arcs. @@ -68,9 +76,18 @@ provides less functionality. For example, nodes and arcs cannot be removed from it. +The \ref StaticDigraph structure is even more optimized for efficiency, +but it is completely static. It requires less space in memory and +provides faster item iteration than \ref ListDigraph and \ref +SmartDigraph, especially using \ref concepts::Digraph::OutArcIt +"OutArcIt" iterators, since its arcs are stored in an appropriate order. +However, it only provides \ref StaticDigraph::build() "build()" and +\ref \ref StaticDigraph::clear() "clear()" functions and does not +support any other modification of the digraph. + \ref FullDigraph is an efficient implementation of a directed full graph. -This structure is completely static, so you can neither add nor delete -arcs or nodes, and the class needs constant space in memory. +This structure is also completely static, so you can neither add nor delete +arcs or nodes, moreover, the class needs constant space in memory. [SEC]sec_undir_graphs[SEC] Undirected Graphs