adaptors.dox
changeset 57 18404ec968ca
parent 45 725c60c7492d
equal deleted inserted replaced
5:89feb488a761 6:41551f662701
    23 In typical algorithms and applications related to graphs and networks,
    23 In typical algorithms and applications related to graphs and networks,
    24 we usually encounter situations in which a specific alteration of a graph
    24 we usually encounter situations in which a specific alteration of a graph
    25 has to be considered.
    25 has to be considered.
    26 If some nodes or arcs have to be hidden (maybe temporarily) or the reverse
    26 If some nodes or arcs have to be hidden (maybe temporarily) or the reverse
    27 oriented graph has to be used, then this is the case.
    27 oriented graph has to be used, then this is the case.
    28 However, actually modifing physical storage of the graph or
    28 However, actually modifying physical storage of the graph or
    29 making a copy of the graph structure along with the required maps
    29 making a copy of the graph structure along with the required maps
    30 could be rather expensive (in time or in memory usage) compared to the
    30 could be rather expensive (in time or in memory usage) compared to the
    31 operations that should be performed on the altered graph.
    31 operations that should be performed on the altered graph.
    32 In such cases, the LEMON \e graph \e adaptor \e classes could be used.
    32 In such cases, the LEMON \e graph \e adaptor \e classes could be used.
    33 
    33 
    59 
    59 
    60 This technique yields convenient tools that help writing compact and elegant
    60 This technique yields convenient tools that help writing compact and elegant
    61 code, and makes it possible to easily implement complex algorithms based on
    61 code, and makes it possible to easily implement complex algorithms based on
    62 well tested standard components.
    62 well tested standard components.
    63 
    63 
    64 For solving the problem introduced above, we could use the follwing code.
    64 For solving the problem introduced above, we could use the following code.
    65 
    65 
    66 \code
    66 \code
    67   ListDigraph g;
    67   ListDigraph g;
    68   ReverseDigraph<ListDigraph> rg(g);
    68   ReverseDigraph<ListDigraph> rg(g);
    69   int result = algorithm(rg);
    69   int result = algorithm(rg);