Hi François,
On 3/6/07, François Duranleau
Hi!
It seems there is an inconsistency (to me) between color tagging of vertices in edmund_karp_max_flow and kolmogorov_max_flow algorithms.
In the documentation of kolmogorov_max_flow, it says:
"If the color of a vertex after running the algorithm is white the vertex belongs to the source tree else it belongs to the sink-tree (used for minimum cuts)."
In short, vertices linked to the source are white.
Yes, that's right. However, for
edmund_karp_max_flow, it says:
"At the end of the algorithm, the white vertices define the minimum cut set."
Thus in this case, it's the vertices connected to the sink that are white.
Why? Maybe the docs are not really accurate here. But I think this could
also mean, that this are the vertices connected to the source.
Why the difference in color tagging between the two algorithms?
For the reasons above, I think there are no differences.
Below is a short example which uses kolmogorov_mf and edmunds_karp_mf. It
can be run with the *.dat files from $(BOOST_ROOT)/libs/graph/examples like
this: edmunds_karp_maxflow < max_flow.dat
Cheers,
Stephan
#include <iostream>
#include <string>
#include ::type>::value_type tColorValue;
typedef boost::color_traits<tColorValue> tColorTraits;
for (tie(u_iter, u_end) = vertices(g); u_iter != u_end; ++u_iter)
if(col[*u_iter] == tColorTraits::white())
std::cout << "White:" << *u_iter < graph_traits < Graph >::vertex_iterator u_iter, u_end;
typedef boost::color_traitsboost::default_color_type tColorTraits;
for (tie(u_iter, u_end) = vertices(g); u_iter != u_end; ++u_iter)
if(col[*u_iter] == tColorTraits::white())
std::cout << "White:" << *u_iter <