@almarklein -- this change makes things faster in all cases? Or only when a small fraction of the costs array is traversed to find the optimal solution? It might be faster to pre-allocate the entire heap in cases where every single cost (or a large majority of them) needs to be calculated, but I imagine starting with a small heap makes most sense when only a small number of costs must be calculated. Though maybe this is wrong and because of cache size issues, etc., it's always better to just grow the heap on demand rather than start out with a large one?

Anyway, probably worth testing on large and small problems, and maybe on a few different machines, to see if this needs to be an advanced-user parameter, or we can just use some sort of heuristic. Since we're talking 30% gain/loss in speed, this seems important...