I'm trying to generate an application that solves the bipartite assignment problem via the auction algorithm with the boost graph library. I found it possible to characterize vertices and edges with multiple properties using the boundle properties. But since the auction algorithm envolve two types of entities, persons and items, I was wondering if there was the possibility of generating more than one characterization of vertices in order to suppor this distinction.
Thanks for the help.
CodePudding user response:
This question is overly broad, but let me try to provide some helpful pointers.
But since the auction algorithm [i]nvolve two types of entities, persons and items, I was wondering if there was the possibility of generating more than one characterization of vertices in order to suppor[t] this distinction.
It think "But" can be dropped.
Answering the question, it seems obvious that you can include a type discriminator, like:
struct VertexProperties {
int multiple;
std::string characterizing, properties;
// for auction algorithm:
bool isPersonEntity;
// or e.g.
enum {Person, Item} entityType;
};
Here's several answers that show such classifications in action using BGL:
- using a manual type discriminator like just mentioned: Boost graph Library using Bundled properties
- using variant
- Graph with two types of nodes
- showing how to use filtered_graph to "view" only part of the vertices at a time: boost::adjancency_list with polymorphic vertices and edges
- parsing Cars/Planes from XML Storing a nested XML structure in form of BGL graph using BOOST library
- using shared pointers (allowing polymorphic property types) Using boost graph library with a custom class for vertices
- alternatives using dynamic property maps How to use boost::graph dijkstra's algorithm if vertex properties are pointers?