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 6253051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:55:08+00:00 2026-05-24T13:55:08+00:00

Here is design of my graph data structure which i’ve developed from scratch. Now

  • 0

Here is design of my graph data structure which i’ve developed from scratch. Now to implement BFS i am thinking to use some part of STL to levitate more burden.
Here is

I am using algorithm from Cormen’s book .For some portion of algorithms like
color[u] , distance[u] etc , i am thinking to use map. but i am unable to decided whether
i should use map like >> std::map<node<T>*, Node_struct_data_like_color_etc> or
std::map<data_type_which_node_contains, Node_struct_data_like_color_etc>

Also, Above map will have to fit with other part of algo like
for(all_adjacent_vertex_v_of_u) etc

I am sorry that my question might would look vague but couldn’t explain more better than this.

  • 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-05-24T13:55:11+00:00Added an answer on May 24, 2026 at 1:55 pm

    Once i was trying to do something similar. The mistake i did was i didn’t define the
    function object to sort the elements of the map when i stored the pointer to the node as index type. So you should consider this when you design your BFS when keeping the color/other properties as value_type in the map with node pointers as the index type.

    so the map that you are planning to implement should look something like this

    std::map<Node_t*,NodeProperty_t*,SortNode>
    
    struct SortNode{
    operator()(Node_t*,Node_t*){
    //...
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need help to design the best data structure for a GRAPH. The following
I was going to ask a question here about whether or not my design
Here is my code, which takes two version identifiers in the form 1, 5,
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's a problem I ran into recently. I have attributes strings of the form
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
Here is a simplification of my database: Table: Property Fields: ID, Address Table: Quote
Here's a coding problem for those that like this kind of thing. Let's see
Here is the scenario: I'm writing an app that will watch for any changes

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.