[Lemon-commits] Peter Kovacs: Extend the graphs section
Lemon HG
hg at lemon.cs.elte.hu
Mon Feb 22 19:46:51 CET 2010
details: http://lemon.cs.elte.hu/hg/lemon-tutorial/rev/236e7061b70d
changeset: 38:236e7061b70d
user: Peter Kovacs <kpeter [at] inf.elte.hu>
date: Sun Feb 21 15:07:35 2010 +0100
description:
Extend the graphs section
diffstat:
graphs.dox | 27 ++++++++++++++++++++++-----
1 files changed, 22 insertions(+), 5 deletions(-)
diffs (56 lines):
diff --git a/graphs.dox b/graphs.dox
--- a/graphs.dox
+++ b/graphs.dox
@@ -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
More information about the Lemon-commits
mailing list