Keep Track of the Best N Nodes in a Graph Traversal Algorithm

Tobias Pankrath via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Mar 25 10:49:47 PDT 2015


On Wednesday, 25 March 2015 at 14:40:28 UTC, Per Nordlöw wrote:
> On Wednesday, 25 March 2015 at 13:55:29 UTC, bearophile wrote:
>> Nordlöw:
>>
>>> I have graph traversal algorithm that needs to keep track of 
>>> the N "best" node visit.
>>
>> std.algorithm.topNCopy?
>>
>> Bye,
>> bearophile
>
> Notice that, ideally, I would like my list of top-nodes to have 
> a fixed size during the whole algorithm (99.9 % of time) as 
> soon it has reached the length of N.

What's wrong with binary heaps?


More information about the Digitalmars-d-learn mailing list