Content deleted Content added
m remove unnec whitespace |
Remove out of place unused ref that had been copied to the wrong place |
||
(36 intermediate revisions by 31 users not shown) | |||
Line 1:
{{short description|Algorithm for selecting the best sources for time estimation}}
The '''intersection algorithm''' is an agreement algorithm used to select sources for estimating accurate time from a number of [[noise|noisy]] time sources. It forms part of the modern [[Network Time Protocol]]. It is a modified form of [[Marzullo's algorithm]].<ref name=":0">{{cite journal |url= http://tools.ietf.org/html/rfc1305#ref-DEC89 |title=RFC 1305 - Network Time Protocol (Version 3) Specification, Implementation and Analysis |website=tools.ietf.org |year=2013 |doi=10.17487/RFC1305 |quote=Digital Time Service Functional Specification Version T.1.0.5. Digital Equipment Corporation, 1989. |accessdate=October 6, 2013|last1=Mills |first1=D. |doi-access=free }}</ref><ref>Digital Time Service Functional Specification Version T.1.0.5. Digital
Equipment Corporation, 1989.</ref>
While Marzullo's Algorithm will return the smallest interval consistant with the largest number of sources, the returned interval does not necessarily include the center point (calculatd offset) of all the sources in the intersection. The Intersection Algorithm returns an interval that includes that returned by Marzullo's algorithm but may be larger since it will include the center points. This larger interval allows using additional statistical data to select a point within the interval, reducing the [[jitter]] in repeated execution.▼
▲While Marzullo's
==Method==
Given ''M'' intervals
The intersection algorithm begins by creating a table of tuples <offset,type>. For each interval there are three entries, the lower endpoint, the midpoint and the upper endpoint, labelled with types -1, 0 1 respectively. Thus interval c +/- r results in entries <c-r,-1> <c,0> <c+r,+1>. These are then sorted by offset.▼
Variables: This algorithm uses ''f'' as number of false tickers, ''endcount'' and ''midcount' are integers. ''Lower'' and ''upper'' are values of offsets.▼
0) [initialize best f] Start with ''f''=0, assuming all input intervals are valid. Each time no interval is found f will be incremented until either an interval is found or ''f''>=''m''/2.▼
1) [initialize] ''endcount''=0 ''midcount''=0▼
▲The intersection algorithm begins by creating a table of tuples <offset, type>.
2) [find lower endpoint] Start at begining of the list (lowest offset) consider each tuple in order. ''endpoint''=''endpoint''-''type''. If ''endcount''>=''m''-''f'' then ''lower''=''offset'' and goto step 3 because the (possible) lower endpoint has been found. If the ''type''=0 then ''midcount''=''midcount''+1. Repeat with next tuple. If reach end of list then goto step 6.▼
▲Variables: This algorithm uses ''f'' as number of false tickers, ''endcount'' and ''midcount'' are integers. ''Lower'' and ''upper'' are values of offsets.
3) [tentative lower endpoint found, initialize to find upper endpoint] set ''endcount''=0. ▼
<ol start="0">
4) [determine number of midpoints] Start from end of list and work towards lower offsets. ''endcount''=''endcount''+''type''. If ''endcount''>=''m''-''f'' then ''upper''=''offset'', goto step 5. If ''type''=0 then ''midcount''=''midcount''+1. Repeat for next tuple. If reach end of list then goto step 6.▼
▲
▲
▲
▲
</ol>
==References ==
▲5) if ''lower''<=''upper'' and ''midcount''<=''f'' then return interval [''lowerendpoint'',''upperendpoint''] as resulting confidence interval.
{{reflist}}
[[Category:Agreement algorithms]]
▲6) [increment number of falsetickers] ''f''=''f''+1. If ''f''>=''m''/2 then terminate and return FAILED, otherwise goto step 1.
|