<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Top-nodes_algorithm</id>
	<title>Top-nodes algorithm - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Top-nodes_algorithm"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Top-nodes_algorithm&amp;action=history"/>
	<updated>2026-05-04T17:10:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=Top-nodes_algorithm&amp;diff=6205775&amp;oldid=prev</id>
		<title>imported&gt;Bruce1ee: fixed lint errors – obsolete HTML tags</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Top-nodes_algorithm&amp;diff=6205775&amp;oldid=prev"/>
		<updated>2022-10-05T13:34:00Z</updated>

		<summary type="html">&lt;p&gt;fixed &lt;a href=&quot;/wiki143/index.php?title=Special:LintErrors&quot; title=&quot;Special:LintErrors&quot;&gt;lint errors&lt;/a&gt; – obsolete HTML tags&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The &amp;#039;&amp;#039;&amp;#039;top-nodes algorithm&amp;#039;&amp;#039;&amp;#039; is an [[algorithm]] for managing a resource reservation calendar. The algorithm has been first published in 2003,&amp;lt;ref&amp;gt;[https://archive.today/20120215024923/http://www.wikipatents.com/apps/20040204978.html Related US patent] (the algorithm is in the public domain since 2008)&amp;lt;/ref&amp;gt; and has been improved in 2009.&amp;lt;ref&amp;gt;[https://www.researchgate.net/publication/311582722_Method_of_Managing_Resources_in_a_Telecommunication_Network_or_a_Computing_System Improved top-nodes algorithm]&amp;lt;/ref&amp;gt; It is used when a resource is shared among many users (for example [[Bandwidth (signal processing)|bandwidth]] in a [[telecommunication]] link, or [[disk capacity]] in a large [[data center]]).&lt;br /&gt;
&lt;br /&gt;
The algorithm allows users to:&lt;br /&gt;
* check if an amount of [[resource]] is available during a specific period of time,&lt;br /&gt;
* reserve an amount of resource for a specific period of time,&lt;br /&gt;
* delete a previous reservation,&lt;br /&gt;
* move the calendar forward (the calendar covers a defined duration, and it must be moved forward as time goes by).&lt;br /&gt;
&lt;br /&gt;
==Principle==&lt;br /&gt;
The calendar is stored as a [[binary tree]] where leaves represent elementary time periods. Other nodes represent the period of time covered by all their descendants.&lt;br /&gt;
[[File:AlgoRayroleArbre.svg|center|Example of a seven-hour calendar (with elementary periods of one hour)]]&lt;br /&gt;
{{center|&amp;#039;&amp;#039;Example of a seven-hour calendar (with elementary periods of one hour)&amp;#039;&amp;#039;}}&lt;br /&gt;
&lt;br /&gt;
The period of time covered by a reservation is represented by a set of &amp;quot;top-nodes&amp;quot;. This set is the minimal set of nodes that exactly cover the reservation period of time.&lt;br /&gt;
&lt;br /&gt;
A node of the [[binary tree]] is a &amp;quot;top-node&amp;quot; for a given reservation if&lt;br /&gt;
* all its descendants are inside the reservation period of time, and&lt;br /&gt;
* it is the root node, or at least one descendant of the parent node is outside of the reservation period of time.&lt;br /&gt;
[[File:AlgoRayroleResa.svg|center|Top-nodes for a reservation from 1:00 to 5:59]]&lt;br /&gt;
{{center|&amp;#039;&amp;#039;Top-nodes for a reservation from 1:00 to 5:59&amp;#039;&amp;#039;}}&lt;br /&gt;
&lt;br /&gt;
The following value is stored in each node:&lt;br /&gt;
 q(node) = max(q(left child), q(right child))&lt;br /&gt;
           + total amount of reserved resource for all reservations having this node as a &amp;quot;top-node&amp;quot;&lt;br /&gt;
(for [[code optimization]], the two parts of this sum are usually stored separately.)&lt;br /&gt;
&lt;br /&gt;
==Performance==&lt;br /&gt;
The advantage of this algorithm is that the time to register a new resource reservation depends only on the calendar size (it does not depend on the total number of reservations).&lt;br /&gt;
&lt;br /&gt;
Let {{var|n}} be the number of elementary periods in the calendar.&lt;br /&gt;
&lt;br /&gt;
The maximal number of &amp;quot;top-nodes&amp;quot; for a given reservation is 2.log n.&lt;br /&gt;
* to check if an amount of resource is available during a specific period of time : &amp;#039;&amp;#039;O&amp;#039;&amp;#039;(log &amp;#039;&amp;#039;n&amp;#039;&amp;#039;)&lt;br /&gt;
* to reserve an amount of resource for a specific period of time : &amp;#039;&amp;#039;O&amp;#039;&amp;#039;(log &amp;#039;&amp;#039;n&amp;#039;&amp;#039;)&lt;br /&gt;
* to delete a previous reservation : &amp;#039;&amp;#039;O&amp;#039;&amp;#039;(log &amp;#039;&amp;#039;n&amp;#039;&amp;#039;)&lt;br /&gt;
* to move the calendar forward : &amp;#039;&amp;#039;O&amp;#039;&amp;#039;(log &amp;#039;&amp;#039;n&amp;#039;&amp;#039; + M.log n)&lt;br /&gt;
where {{var|M}} is the number of reservations that are active during the added calendar periods.&lt;br /&gt;
&lt;br /&gt;
({{var|M}} = 0 if reservations are not allowed after the end of the calendar.)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* {{in lang|fr}} [http://www.developpez.net/forums/showthread.php?p=3078887 C source code]&lt;br /&gt;
&lt;br /&gt;
[[Category:Scheduling algorithms]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Bruce1ee</name></author>
	</entry>
</feed>