Boost logo

Boost Users :

Subject: [Boost-users] [Graph] source vertex colour at start of BFS or DFS
From: Jeremy Murphy (jeremy.william.murphy_at_[hidden])
Date: 2015-01-24 05:11:52


Hi,

I'm wondering, why do the BFS and DFS algorithms not inspect the colour of
the source vertices given to them? If a source vertex is already black,
shouldn't the search effectively be a no-op? Currently the source vertex is
'discovered' and coloured grey regardless of its previous colour.

I know it might seem weird to pass a black vertex as the source, but I
guess I see it as similar to passing an empty range to an algorithm: it's
valid but nothing happens.

Thanks, cheers.

Jeremy



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net