<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://oldwiki.funkfeuer.at/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
		<id>https://oldwiki.funkfeuer.at/index.php?action=history&amp;feed=atom&amp;title=SPF_refactoring</id>
		<title>SPF refactoring - Versionsgeschichte</title>
		<link rel="self" type="application/atom+xml" href="https://oldwiki.funkfeuer.at/index.php?action=history&amp;feed=atom&amp;title=SPF_refactoring"/>
		<link rel="alternate" type="text/html" href="https://oldwiki.funkfeuer.at/index.php?title=SPF_refactoring&amp;action=history"/>
		<updated>2026-04-04T14:08:34Z</updated>
		<subtitle>Versionsgeschichte dieser Seite in FunkFeuer Wiki</subtitle>
		<generator>MediaWiki 1.22.5</generator>

	<entry>
		<id>https://oldwiki.funkfeuer.at/index.php?title=SPF_refactoring&amp;diff=8098&amp;oldid=prev</id>
		<title>Hannes: initial cut for SPF refactoring</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.funkfeuer.at/index.php?title=SPF_refactoring&amp;diff=8098&amp;oldid=prev"/>
				<updated>2007-11-24T12:58:13Z</updated>
		
		<summary type="html">&lt;p&gt;initial cut for SPF refactoring&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= SPF implementation =&lt;br /&gt;
When executing the [http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm SPF calculation]&lt;br /&gt;
upon every iteration the least cost path needs to be extracted and put on the result list.&lt;br /&gt;
For that purpose olsrd-current does keep a linear list which has O(N) [http://en.wikipedia.org/wiki/Asymptotic_complexity asymptotic_complexity] to traverse.&lt;br /&gt;
Every node needs to be visited, which&lt;br /&gt;
has again O(N) [http://en.wikipedia.org/wiki/Asymptotic_complexity asymptotic_complexity]. This results in a total behavior of O(N^2) which can eat a lot&lt;br /&gt;
of CPU where N is large (for example when there are hundreds of olsrd nodes in a network).&lt;br /&gt;
&lt;br /&gt;
= speed by efficient sorting =&lt;br /&gt;
modern SPF implementations use data structures which are efficient at sorting the preliminary path costs like&lt;br /&gt;
[http://en.wikipedia.org/wiki/Min_heap min_heaps] or [http://en.wikipedia.org/wiki/AVL_tree AVL_trees]. Since olsrd already&lt;br /&gt;
had a nice and efficient AVL tree implementation, the two SPF related data structures (the candidate and path tree) are implemented using&lt;br /&gt;
AVL trees with the path etx metric as the key. Determining the minimal path cost in an AVL tree comes at a cost of O(log(N)) which results&lt;br /&gt;
in a total [http://en.wikipedia.org/wiki/Asymptotic_complexity asymptotic_complexity] of O(N * log(N)), which scales much nicer now in large networks.&lt;br /&gt;
&lt;br /&gt;
= Results =&lt;br /&gt;
In the [http://www.funkfeuer.at funkfeuer.at] network topology of 190 nodes the raw SPF execution was reduced by 45%. Note that the raw SPF execution represents only about 20% of the CPU cost in a running olsrd. At funkfeuer.at we have observed an overall decrease in the CPU load of about 12% on the embedded routers.&lt;/div&gt;</summary>
		<author><name>Hannes</name></author>	</entry>

	</feed>