w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
3 classes (0, 1, 4) on Boost graph cut

In your example:

     make_iterator_property_map(&capacity[0], get(boost::edge_index,
get(boost::edge_index, graph)),
get(boost::edge_index, graph)), //CHANGED
     make_iterator_property_map(&groups[0], get(boost::vertex_index,
     get(boost::vertex_index, graph),

They call the following constructor from here:

boykov_kolmogorov_max_flow(Graph& g,
                       CapacityEdgeMap cap,
                       ResidualCapacityEdgeMap res_cap,
                       ReverseEdgeMap rev,
                       ColorMap color,
                       IndexMap idx,
graph_traits<Graph>::vertex_descriptor src,
graph_traits<Graph>::vertex_descriptor sink)

Which means, that what you think are classes are indeed the colors. According to the documentation,

If the color of a vertex after running the algorithm is black the vertex belongs to the source tree else it belongs to the sink-tree (used for minimum cuts).

Now if you look here at the default color map, the colors are an enum going from 0 to 4, where 4 is black.

With all of this, you can conclude that 4 is indeed the source, but everything else (including the 1's) belong to the sink!

The different color probably depends on the implementation itself, but I don't think you can make any assumptions about the 1's without knowing what the implementation is...

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.