In your example:
boykov_kolmogorov_max_flow(graph, make_iterator_property_map(&capacity[0], get(boost::edge_index, graph)), make_iterator_property_map(&residual_capacity[0], get(boost::edge_index, graph)), make_iterator_property_map(&reverse_edges[0], get(boost::edge_index, graph)), //CHANGED make_iterator_property_map(&groups[0], get(boost::vertex_index, graph)), get(boost::vertex_index, graph), s, t );
They call the following constructor from here :
boykov_kolmogorov_max_flow(Graph& g, CapacityEdgeMap cap, ResidualCapacityEdgeMap res_cap, ReverseEdgeMap rev, ColorMap color, IndexMap idx, typename graph_traits<Graph>::vertex_descriptor src, typename graph_traits<Graph>::vertex_descriptor sink)
This means that what you consider classes are really colors. According to the documentation ,
If the color of the vertex after the algorithm is run is black, the vertex belongs to the source tree, otherwise it belongs to the sink tree (used for minimal cuts).
Now, if you look at the default color map here , the colors are an enumeration going from 0 to 4, where 4 is black.
With all this, you can conclude that 4 is indeed the source, but everything else (including 1's) belongs to the sink!
The different color probably depends on the implementation itself, but I don’t think you can make any assumptions about it without knowing what the implementation is ...