Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8683905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:09:47+00:00 2026-06-12T22:09:47+00:00

I would like to create a search tree of a graph using dfs algorithm.

  • 0

I would like to create a search tree of a graph using dfs algorithm. I get compilation errors over and over my code is like that (the compilation error is so long that I do not paste it):

typedef adjacency_list <vecS, vecS, undirectedS> Graph;   
typedef graph_traits <Graph>::edge_descriptor Edge;
typedef graph_traits <Graph>::vertex_descriptor Vertex;

typedef pair<int, int> E;
vector<E> edges;

Graph g(edges.begin(), edges.end(), n);

vector<Vertex> p(n);
Vertex s = vertex(0,g);

breadth_first_search(g, s, visitor(record_predecessors(&p[0], on_tree_edge())));

Part of error:

instantiated from here
/usr/include/boost/graph/breadth_first_search.hpp:39:7: error: ‘struct boost::predecessor_recorder<long unsigned int*, boost::on_tree_edge>’ has no member named ‘initialize_vertex’
/usr/include/boost/graph/breadth_first_search.hpp:40:7: error: ‘struct boost::predecessor_recorder<long unsigned int*, boost::on_tree_edge>’ has no member named ‘discover_vertex’
/usr/include/boost/graph/breadth_first_search.hpp:41:7: error: ‘struct boost::predecessor_recorder<long unsigned int*, boost::on_tree_edge>’ has no member named ‘examine_vertex’
/usr/include/boost/graph/breadth_first_search.hpp:42:7: error: ‘struct boost::predecessor_recorder<long unsigned int*, boost::on_tree_edge>’ has no member named ‘examine_edge’
/usr/include/boost/graph/breadth_first_search.hpp:43:7: error: ‘struct boost::predecessor_recorder<long unsigned int*, boost::on_tree_edge>’ has no member named ‘tree_edge’
/usr/include/boost/graph/breadth_first_search.hpp:44:7: error: ‘struct boost::predecessor_recorder<long unsigned int*, boost::on_tree_edge>’ has no member named ‘non_tree_edge’
/usr/include/boost/graph/breadth_first_search.hpp:45:7: error: ‘struct boost::predecessor_recorder<long unsigned int*, boost::on_tree_edge>’ has no member named ‘gray_target’
/usr/include/boost/graph/breadth_first_search.hpp:46:7: error: ‘struct boost::predecessor_recorder<long unsigned int*, boost::on_tree_edge>’ has no member named ‘black_target’
/usr/include/boost/graph/breadth_first_search.hpp:47:7: error: ‘struct boost::predecessor_recorder<long unsigned int*, boost::on_tree_edge>’ has no member named ‘finish_vertex’
make: *** [file] Error 1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:09:48+00:00Added an answer on June 12, 2026 at 10:09 pm

    breadth_first_search expects a BFSVisitor. record_predecessors returns an EventVisitor. You need to use make_bfs_visitor in order to make it work.

    breadth_first_search(g, s, visitor(make_bfs_visitor(record_predecessors(&p[0], on_tree_edge()))));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a search bar on the page that looks similar
I would like to create a search box component, similar to the one that
I would like to create a custom search in an iPhone using a UIWebView.
I am using ColdFusion 8 to create a search form and would like the
I would like to create this shape using just css. I am pretty sure
I would like to create a c++ type that mimic the build-in type exactly.
I would like to create a class that runs something (a runnable) at regular
I would like to create a predicate to search for a specific letter at
I would like to create a link where the href performs a GET from
I’m working on some script and I would like to create search. My project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.