1.1 --- a/lemon/bpugraph_adaptor.h Mon May 15 09:46:33 2006 +0000
1.2 +++ b/lemon/bpugraph_adaptor.h Mon May 15 09:49:51 2006 +0000
1.3 @@ -409,8 +409,35 @@
1.4 /// \brief Bipartite graph adaptor which swaps the two nodeset.
1.5 ///
1.6 /// Bipartite graph adaptor which swaps the two nodeset. The adaptor's
1.7 - /// a-nodeset will be the original graph's b-nodeset and the adaptor's
1.8 - /// b-nodeset will be the original graph's a-nodeset.
1.9 + /// anode-set will be the original graph's bnode-set and the adaptor's
1.10 + /// bnode-set will be the original graph's anode-set.
1.11 + ///
1.12 + /// As example look at an algorithm what can be sped up with the
1.13 + /// swap bipartite undirected graph adaptor. If we want to find the
1.14 + /// maximum matching in the bipartite graph then it will be not changed
1.15 + /// if we swap the two nodesets. But the algorithm use the two nodeset
1.16 + /// different way. If we swap the nodesets it provides different
1.17 + /// running time. We run a test on random bipartite graphs with
1.18 + /// different rate of the anode-set size and bnode-set size.
1.19 + /// We always made graphs with 10000 nodes and 20000 edges and we
1.20 + /// computed the maximum cardinality matching with the Hopcroft-Karp
1.21 + /// algorithm.
1.22 + ///
1.23 + /// The next diagram shows the running time of the tests. If the anode-set
1.24 + /// is smaller than the bnode-set the running time is better than with
1.25 + /// the swapped graph. Other conclusion is that the running time
1.26 + /// is greater when the two nodesets size are nearly equal.
1.27 + ///
1.28 + /// \image html swap_test.png
1.29 + /// \image latex swap_test.eps "Swapping nodesets" width=\textwidth
1.30 + ///
1.31 + /// The next part shows how can we swap the two nodeset:
1.32 + ///
1.33 + ///\code
1.34 + /// typedef SwapBpUGraphAdaptor<BpUGraph> SBpUGraph;
1.35 + /// SBpUGraph sbpugraph(bpugraph);
1.36 + /// MaxBipartiteMatching<SBpUGraph> sbpumatch(sbpugraph);
1.37 + ///\endcode
1.38 template <typename _BpUGraph>
1.39 class SwapBpUGraphAdaptor
1.40 : public BpUGraphAdaptorExtender<SwapBpUGraphAdaptorBase<_BpUGraph> > {
1.41 @@ -425,6 +452,9 @@
1.42
1.43 public:
1.44
1.45 + /// \brief Construct a swapped graph.
1.46 + ///
1.47 + /// Construct a swapped graph.
1.48 explicit SwapBpUGraphAdaptor(Graph& _graph) { setGraph(_graph); }
1.49
1.50 };