# Changes in doc/groups.dox[434:ad483acf1654:478:5a1e9fdcfd3a] in lemon

Ignore:
File:
1 edited

Unmodified
Added
Removed
• ## doc/groups.dox

 r434 * This file is a part of LEMON, a generic C++ optimization library. * * Copyright (C) 2003-2008 * Copyright (C) 2003-2009 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). /** @defgroup graph_adaptors Adaptor Classes for graphs @defgroup graph_adaptors Adaptor Classes for Graphs @ingroup graphs \brief This group contains several adaptor classes for digraphs and graphs \brief Adaptor classes for digraphs and graphs This group contains several useful adaptor classes for digraphs and graphs. The main parts of LEMON are the different graph structures, generic graph algorithms, graph concepts which couple these, and graph graph algorithms, graph concepts, which couple them, and graph adaptors. While the previous notions are more or less clear, the latter one needs further explanation. Graph adaptors are graph classes A short example makes this much clearer.  Suppose that we have an instance \c g of a directed graph type say ListDigraph and an algorithm instance \c g of a directed graph type, say ListDigraph and an algorithm \code template (in time or in memory usage) to copy \c g with the reversed arcs.  In this case, an adaptor class is used, which (according to LEMON digraph concepts) works as a digraph.  The adaptor uses the original digraph structure and digraph operations when methods of the reversed oriented graph are called.  This means that the adaptor have minor memory usage, and do not perform sophisticated algorithmic to LEMON \ref concepts::Digraph "digraph concepts") works as a digraph. The adaptor uses the original digraph structure and digraph operations when methods of the reversed oriented graph are called.  This means that the adaptor have minor memory usage, and do not perform sophisticated algorithmic actions.  The purpose of it is to give a tool for the cases when a graph have to be used in a specific alteration.  If this alteration is obtained by a usual construction like filtering the arc-set or obtained by a usual construction like filtering the node or the arc set or considering a new orientation, then an adaptor is worthwhile to use. To come back to the reverse oriented graph, in this situation \code ListDigraph g; ReverseDigraph rg(g); ReverseDigraph rg(g); int result = algorithm(rg); \endcode After running the algorithm, the original graph \c g is untouched. This techniques gives rise to an elegant code, and based on stable During running the algorithm, the original digraph \c g is untouched. This techniques give rise to an elegant code, and based on stable graph adaptors, complex algorithms can be implemented easily. In flow, circulation and bipartite matching problems, the residual In flow, circulation and matching problems, the residual graph is of particular importance. Combining an adaptor implementing this, shortest path algorithms and minimum mean cycle algorithms, this with shortest path algorithms or minimum mean cycle algorithms, a range of weighted and cardinality optimization algorithms can be obtained. For other examples, the interested user is referred to the The behavior of graph adaptors can be very different. Some of them keep capabilities of the original graph while in other cases this would be meaningless. This means that the concepts that they are models of depend on the graph adaptor, and the wrapped graph(s). If an arc of \c rg is deleted, this is carried out by deleting the corresponding arc of \c g, thus the adaptor modifies the original graph. But for a residual graph, this operation has no sense. meaningless. This means that the concepts that they meet depend on the graph adaptor, and the wrapped graph. For example, if an arc of a reversed digraph is deleted, this is carried out by deleting the corresponding arc of the original digraph, thus the adaptor modifies the original digraph. However in case of a residual digraph, this operation has no sense. Let us stand one more example here to simplify your work. RevGraphAdaptor has constructor ReverseDigraph has constructor \code ReverseDigraph(Digraph& digraph); \endcode This means that in a situation, when a const ListDigraph& This means that in a situation, when a const %ListDigraph& reference to a graph is given, then it have to be instantiated with Digraph=const ListDigraph. Digraph=const %ListDigraph. \code int algorithm1(const ListDigraph& g) { RevGraphAdaptor rg(g); ReverseDigraph rg(g); return algorithm2(rg); }
Note: See TracChangeset for help on using the changeset viewer.