Specifying starting vertex in depth_first_search

I'm trying to use depth_first_search() and I want to specify the start node. However, I can't seem to specify the color map correctly. I'm encountering the same problem as described in one of the archive posts at ( http://groups.google.ca/group/boost-list/browse_thread/thread/679106e227e0eb... ). Any small examples available? Regards, ~ Hiren

on Thu Jul 17 2008, "Hiren Patel" <hirenvt-AT-gmail.com> wrote:
I'm trying to use depth_first_search() and I want to specify the start node.
try depth_first_visit -- Dave Abrahams BoostPro Computing http://www.boostpro.com

I have also tried depth_first_visit. However, I still have to specify the color map which I was not successful in getting to work. David Abrahams wrote:
on Thu Jul 17 2008, "Hiren Patel" <hirenvt-AT-gmail.com> wrote:
I'm trying to use depth_first_search() and I want to specify the start node.
try depth_first_visit

On Thu, Jul 17, 2008 at 10:38 PM, Hiren <hirenvt@gmail.com> wrote:
I have also tried depth_first_visit. However, I still have to specify the color map which I was not successful in getting to work.
David Abrahams wrote:
on Thu Jul 17 2008, "Hiren Patel" <hirenvt-AT-gmail.com> wrote:
I'm trying to use depth_first_search() and I want to specify the start node.
try depth_first_visit
Hi Hiren, This isn't a bug. The code from the post you linked to calls depth_first_search like "depth_first_search(g, visitor(vis), &color[0], root ); ", which mixes the BGL named parameter syntax (visitor(vis)) with positional parameters (&color[0], root). You have to use one or the other - either specify all of your parameters using named parameters or use all positional parameters. If you change the OP's code so that it calls "depth_first_search(g, vis, &color[0], root)" instead, it will compile fine. You didn't give much detail, but I assume you're doing something similar? Regards, Aaron

Hi Aaron, That was exactly what I had wrong. Thank you so much. ~ Hiren On Fri, Jul 18, 2008 at 5:24 AM, Aaron Windsor <aaron.windsor@gmail.com> wrote:
On Thu, Jul 17, 2008 at 10:38 PM, Hiren <hirenvt@gmail.com> wrote:
I have also tried depth_first_visit. However, I still have to specify the color map which I was not successful in getting to work.
David Abrahams wrote:
on Thu Jul 17 2008, "Hiren Patel" <hirenvt-AT-gmail.com> wrote:
I'm trying to use depth_first_search() and I want to specify the start node.
try depth_first_visit
Hi Hiren,
This isn't a bug. The code from the post you linked to calls depth_first_search like "depth_first_search(g, visitor(vis), &color[0], root ); ", which mixes the BGL named parameter syntax (visitor(vis)) with positional parameters (&color[0], root). You have to use one or the other - either specify all of your parameters using named parameters or use all positional parameters. If you change the OP's code so that it calls "depth_first_search(g, vis, &color[0], root)" instead, it will compile fine.
You didn't give much detail, but I assume you're doing something similar?
Regards, Aaron _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (4)
-
Aaron Windsor
-
David Abrahams
-
Hiren
-
Hiren Patel