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

2015-03-25 Thread bearophile via Digitalmars-d-learn
Nordlöw: Ahh, a Binary Heap perfectly matches my needs. https://en.wikipedia.org/wiki/Binary_heap http://dlang.org/phobos/std_container_binaryheap.html But isn't topNCopy using a heap? Bye, bearophile

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

2015-03-25 Thread Nordlöw
On Wednesday, 25 March 2015 at 17:49:49 UTC, Tobias Pankrath wrote: What's wrong with binary heaps? Ahh, a Binary Heap perfectly matches my needs. https://en.wikipedia.org/wiki/Binary_heap http://dlang.org/phobos/std_container_binaryheap.html Thx

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

2015-03-25 Thread Tobias Pankrath via Digitalmars-d-learn
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 wou

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

2015-03-25 Thread via Digitalmars-d-learn
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 who

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

2015-03-25 Thread via Digitalmars-d-learn
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 Could you please elaborate a bit how you mean this should be used. Notice that the number o

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

2015-03-25 Thread bearophile via Digitalmars-d-learn
Nordlöw: I have graph traversal algorithm that needs to keep track of the N "best" node visit. std.algorithm.topNCopy? Bye, bearophile