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

  • SEARCH
  • Home
  • 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 6537373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:36:31+00:00 2026-05-25T10:36:31+00:00

When implementing a graph search algorithm, I needed a priority queue which allowed for

  • 0

When implementing a graph search algorithm, I needed a priority queue which allowed for priority changes. Until now, I’ve been using the (detail namespaced, so undocumented) boost d_ary_heap_indirect, but was just told it is undefined to have priorities increase (which I see now is also mentioned in the concept documentation).

So, I need to find a structure which allows both increase and decrease. I’ve already tried simply using a vector and push_heap/pop_heap/make_heap, but updates are too slow. What are the alternatives? I see boost has two classes in the pending (again, undocumented) directories, mutable_queue and relaxed_heap, but I can only find mention of them on five year old maillist threads. What are the differences between them, and do they allow both increases and decreases? Are there any implementations which are not pending acceptance?

  • 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-25T10:36:32+00:00Added an answer on May 25, 2026 at 10:36 am

    The Boost.MultiIndex library features container that have operations to update the state of the object and will accordingly update the indexes.

    In your case, the modify member function seems to fit. From the documentation:

    struct change_name
    {
      change_name(const std::string& new_name):new_name(new_name){}
    
      void operator()(employee& e)
      {
        e.name=new_name;
      }
    
    private:
      std::string new_name;
    };
    
    typedef employee_set::index<name>::type employee_set_by_name;
    employee_set_by_name& name_index = es.get<name>();
    
    employee_set_by_name::iterator it = name_index.find("Anna Jones");
    name_index.modify(it,change_name("Anna Smith"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After implementing most of the common and needed functions for my Graph implementation, I
I'm implementing a Graph which holds Book objects as its nodes. The nodes are
Short story, I'm implementing a graph and now I'm working on the Kruskal, I
My partner and I are planning on implementing a new graph drawing layout algorithm
When implementing a needle search of a haystack in an object-oriented way, you essentially
I just read about the breadth-first search algorithm in the Introduction to Algorithms book
I'm busy implementing a Graph ADT in C++. I have templates for the Edges
I'm implementing a graph (as in Vertices, Edges, not cartesian). I'm modelling the graph
I'm implementing a few graph algorithms at the moment and am wanting a container
I am implementing some spectral graph algorithms for a project. A large part of

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.