Recently I am trying to develop a C++ program dealing with large scale DAGs (about 6,000,000 nodes and 50,000,000 edges), and I find a very serious problem here.
In the program, the node and edges are frequently added and deleted, so the key point is to avoid memory fragmentation, in other word, all the nodes and edges must be allocated from a chunk-based fix length allocator, so the deleted entries can be managed and re-used without any fragmentation.
Here is the question, where can I find high efficient C++ libraries providing basic manipulation of binary trees and graphs, at the same time allow the user to customize the allocation of objects. In other word, the lib works in a in-place pattern.
I have already tried STL, but the STL allocator seems not useful at all since it must provide allocation of different types. For instance, you can not pass an allocator designed for a specific type, since the allocator would be 'rebind' anyway.
The lib I want is in this form:
template <typename _Key, typename _T, typename _AllocForT, typename _AllocForOthers >
struct map;
and for example:
typedef map<int, mytype, alloc_type, default_alloc> map_type;
and the alloc_type is something like FixedLengthAllo cator<typename map_type::_Node Type>, so the allocation and deletion of the underlying binary tree node type can be managed specifically.
I do not want to implement everything myself, so please help me if you got any information. my email is <email address removed as per Posting Guidelines>
In the program, the node and edges are frequently added and deleted, so the key point is to avoid memory fragmentation, in other word, all the nodes and edges must be allocated from a chunk-based fix length allocator, so the deleted entries can be managed and re-used without any fragmentation.
Here is the question, where can I find high efficient C++ libraries providing basic manipulation of binary trees and graphs, at the same time allow the user to customize the allocation of objects. In other word, the lib works in a in-place pattern.
I have already tried STL, but the STL allocator seems not useful at all since it must provide allocation of different types. For instance, you can not pass an allocator designed for a specific type, since the allocator would be 'rebind' anyway.
The lib I want is in this form:
template <typename _Key, typename _T, typename _AllocForT, typename _AllocForOthers >
struct map;
and for example:
typedef map<int, mytype, alloc_type, default_alloc> map_type;
and the alloc_type is something like FixedLengthAllo cator<typename map_type::_Node Type>, so the allocation and deletion of the underlying binary tree node type can be managed specifically.
I do not want to implement everything myself, so please help me if you got any information. my email is <email address removed as per Posting Guidelines>
Comment