Changes in doc/groups.dox [455:5a1e9fdcfd3a:440:88ed40ad0d4f] in lemon-1.1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/groups.dox
r455 r440 63 63 64 64 /** 65 @defgroup graph_adaptors Adaptor Classes for Graphs65 @defgroup graph_adaptors Adaptor Classes for graphs 66 66 @ingroup graphs 67 \brief Adaptor classes for digraphs and graphs 68 69 This group contains several useful adaptor classes for digraphs and graphs. 67 \brief This group contains several adaptor classes for digraphs and graphs 70 68 71 69 The main parts of LEMON are the different graph structures, generic 72 graph algorithms, graph concepts , which couple them, and graph70 graph algorithms, graph concepts which couple these, and graph 73 71 adaptors. While the previous notions are more or less clear, the 74 72 latter one needs further explanation. Graph adaptors are graph classes … … 76 74 77 75 A short example makes this much clearer. Suppose that we have an 78 instance \c g of a directed graph type ,say ListDigraph and an algorithm76 instance \c g of a directed graph type say ListDigraph and an algorithm 79 77 \code 80 78 template <typename Digraph> … … 84 82 (in time or in memory usage) to copy \c g with the reversed 85 83 arcs. In this case, an adaptor class is used, which (according 86 to LEMON \ref concepts::Digraph "digraph concepts") works as a digraph.87 The adaptor uses the original digraph structure and digraph operations when 88 methods of the reversed oriented graph are called. This means that the adaptor 89 haveminor memory usage, and do not perform sophisticated algorithmic84 to LEMON digraph concepts) works as a digraph. The adaptor uses the 85 original digraph structure and digraph operations when methods of the 86 reversed oriented graph are called. This means that the adaptor have 87 minor memory usage, and do not perform sophisticated algorithmic 90 88 actions. The purpose of it is to give a tool for the cases when a 91 89 graph have to be used in a specific alteration. If this alteration is 92 obtained by a usual construction like filtering the node or the arcset or90 obtained by a usual construction like filtering the arc-set or 93 91 considering a new orientation, then an adaptor is worthwhile to use. 94 92 To come back to the reverse oriented graph, in this situation … … 99 97 \code 100 98 ListDigraph g; 101 ReverseDigraph<List Digraph> rg(g);99 ReverseDigraph<ListGraph> rg(g); 102 100 int result = algorithm(rg); 103 101 \endcode 104 During running the algorithm, the original digraph \c g is untouched.105 This techniques give rise to an elegant code, and based on stable102 After running the algorithm, the original graph \c g is untouched. 103 This techniques gives rise to an elegant code, and based on stable 106 104 graph adaptors, complex algorithms can be implemented easily. 107 105 108 In flow, circulation and matching problems, the residual106 In flow, circulation and bipartite matching problems, the residual 109 107 graph is of particular importance. Combining an adaptor implementing 110 this with shortest path algorithms orminimum mean cycle algorithms,108 this, shortest path algorithms and minimum mean cycle algorithms, 111 109 a range of weighted and cardinality optimization algorithms can be 112 110 obtained. For other examples, the interested user is referred to the … … 115 113 The behavior of graph adaptors can be very different. Some of them keep 116 114 capabilities of the original graph while in other cases this would be 117 meaningless. This means that the concepts that they meet depend 118 on the graph adaptor, and the wrapped graph. 119 For example, if an arc of a reversed digraph is deleted, this is carried 120 out by deleting the corresponding arc of the original digraph, thus the 121 adaptor modifies the original digraph. 122 However in case of a residual digraph, this operation has no sense. 123 115 meaningless. This means that the concepts that they are models of depend 116 on the graph adaptor, and the wrapped graph(s). 117 If an arc of \c rg is deleted, this is carried out by deleting the 118 corresponding arc of \c g, thus the adaptor modifies the original graph. 119 120 But for a residual graph, this operation has no sense. 124 121 Let us stand one more example here to simplify your work. 125 Rev erseDigraphhas constructor122 RevGraphAdaptor has constructor 126 123 \code 127 124 ReverseDigraph(Digraph& digraph); 128 125 \endcode 129 This means that in a situation, when a <tt>const %ListDigraph&</tt>126 This means that in a situation, when a <tt>const ListDigraph&</tt> 130 127 reference to a graph is given, then it have to be instantiated with 131 <tt>Digraph=const %ListDigraph</tt>.128 <tt>Digraph=const ListDigraph</tt>. 132 129 \code 133 130 int algorithm1(const ListDigraph& g) { 134 Rev erseDigraph<const ListDigraph> rg(g);131 RevGraphAdaptor<const ListDigraph> rg(g); 135 132 return algorithm2(rg); 136 133 }
Note: See TracChangeset
for help on using the changeset viewer.