[Olsr-dev] Improving SPF with binary heaps
Fri Jul 10 07:18:10 CEST 2015
olsrd is considered (by me and Ferry) end-of-live... we don't want
patches for the core code anymore, because they can introduce all
kinds of subtle bugs which sometimes take years to get out again.
If you want to use your idea, I would suggest looking at the olsrd2
code, which also use at the moment an AVL tree for the priority
queue... the problem is less severe there (because the metric has a
much higher range, which makes collisions less likely, but the olsrd2
code has not that many years of optimizations behind it.
On Thu, Jul 9, 2015 at 9:32 PM, Diogo Gonçalves
> Hi all,
> I've studied performance of olsrd's SPF under different priority queues.
> We find it quite surprising that in olsrd Dijkstra is based on AVL instead
> of binary heaps. Different from binary heaps, AVL is not originally
> as a priority queue. To achieve O(log n) performance, AVL requires nodes
> unique key values, which is not reasonable for a priority queues since
> nodes can have the same priority. In fact, in the olsrd's SPF, nodes with
> priority are put into a list. Then decrase-key procedure can be O(n) in some
> and Dijkstra becomes O(n*n) instead of O(n*logn). Binary heap is the most
> priority queue for Dijkstra, achieving O(n*logn) regardless nodes have the
> same priority.
> I put in my github an initial version of binary heaps (BH) for olsrd .
> With traces from a 200-node mesh , Dijkstra-BH behaved very similar to
> However, from 800 nodes, Dijkstra-BH drammatically outperformed
> Comments, improvements and bugfixes are welcome,
> thanks in advance.
>  https://github.com/diogomg/olsrd
> Olsr-dev mailing list
More information about the Olsr-dev