( a ) )
For an arbitrary comparator network N (which is a composition of comparators) and a monotonic mapping f we have therefore
N( f(a) ) = f( N(a) )
www.iti.fh-flensburg.de( a ) )
Da ein Vergleichernetz eine Hintereinanderausführung von Vergleichern ist, gilt somit für ein beliebiges Vergleichernetz N und jede monotone Abbildung f:
N( f(a) ) = f( N(a) )
www.iti.fh-flensburg.deLet n, n even.
The comparator network Bn is defined as follows:
Bn = [0 : n/2] [1 : n/2+1]…[n/2-1 : n-1] (see example of Figure 2)
www.iti.fh-flensburg.deSei n, n gerade.
Das Vergleichernetz Bn ist wie folgt definiert:
Bn = [0 : n/2] [1 : n/2+1]…[n/2-1 : n-1].
www.iti.fh-flensburg.deLet a = a0, … an-1 be a bitonic 0-1-sequence, where n, n even.
Application of comparator network Bn to a yields
Bn(a) = b0,… bn/2-1 c0,… cn/2-1
www.iti.fh-flensburg.deSei n, n gerade und a = a0, … an-1 eine bitonische 0-1-Folge.
Die Anwendung des Vergleichernetzes Bn auf a ergibt dann
Bn(a) = b0,… bn/2-1 c0,… cn/2-1,
www.iti.fh-flensburg.de).
The number of comparator stages T(n) of the entire sorting network is given by:
T(n) = log(n) + T(n/2)
www.iti.fh-flensburg.deDas Vergleicher netz BitonicMerge ( n ) besteht aus log ( n ) Vergleicher stufen ( so etwa die 3 = log ( 8 ) Vergleicher stufen in Bild 7 ).
Die Anzahl der Vergleicherstufen T(n) des gesamten Sortiernetzes BitonicSort(n) ergibt sich also wie folgt:
T(n) = log(n) + T(n/2) sowie
www.iti.fh-flensburg.deSorting network see definition
The network odd-even transposition sort for n input data consists of n comparator stages. In each stage, either all inputs at odd index positions or all inputs at even index positions are compared with their neighbours. Odd and even stages alternate (Figure 1).
The number of comparators is n·(n-1)/2.
www.iti.fh-flensburg.deAddison-Wesley ( 1973 )
Das Sortiernetz Odd-even Transposition Sort [Knu 73] für n Eingabedaten besteht aus n Vergleicherstufen, in denen jeweils abwechselnd alle Eingabedaten mit ungeradem Index mit ihren darüber liegenden Nachbarn verglichen werden und dann alle Eingabedaten mit geradem Index (Bild 1).
Die Anzahl der Vergleicher beträgt n·(n-1)/2 und entspricht damit genau derjenigen von Bubblesort, die Anzahl der Vergleicherstufen ist jedoch nur etwa halb so groß.
www.iti.fh-flensburg.deProof :
For a single comparator [i:j] the following holds (see definition of comparator):
[i:j]( f(a) )i = [i:j]( f(a0),… f(an-1) )i = min( f(ai), f(aj) )
www.iti.fh-flensburg.deBeweis :
Zunächst gilt für einen einzelnen Vergleicher [i:j] :
[i:j]( f(a) )i = [i:j]( f(a0),… f(an-1) )i = min( f(ai), f(aj) )
www.iti.fh-flensburg.dei.e. f ( b ) = f ( N ( a ) ) is unsorted.
This means that N(f(a)) is unsorted or, in other words, that the 0-1-sequence f(a) is not sorted by the comparator network N.
We have shown that, if there is an arbitrary sequence a that is not sorted by N, then there is a 0-1-sequence f(a) that is not sorted by N.
www.iti.fh-flensburg.ded.h. f ( b ) = f ( N ( a ) ) ist unsortiert.
Damit ist aber auch N(f(a)) unsortiert, und dies bedeutet, dass auch die 0-1-Folge f(a) durch das Vergleichernetz N nicht sortiert wird.
Wir haben damit gezeigt, dass wenn es eine Folge a gibt, die von N nicht sortiert wird, es auch eine 0-1-Folge f(a) gibt, die von N nicht sortiert wird.
www.iti.fh-flensburg.deN ( f ( a ) ) = f ( N ( a ) )
In other words: a monotonic mapping f can be applied to the input sequence of comparator network N or to the output sequence, the result is the same.
www.iti.fh-flensburg.deN ( f ( a ) ) = f ( N ( a ) )
d.h. es ist dasselbe, ob die monotone Abbildung f vor Eingabe von a in das Vergleichernetz N angewandt wird oder hinterher.
www.iti.fh-flensburg.deA comparator [ i : j ] sorts the ith and the jth element of a data sequence into nondecreasing order.
Formally, a comparator is a mapping applied to the data sequence:
arrow
www.iti.fh-flensburg.deFormal ist ein solcher Vergleicher eine Abbildung, die auf die Datenfolge a An angewandt wird :
Definition: Ein Vergleicher ist eine Abbildung
Pfeil
www.iti.fh-flensburg.deDesejar acrescentar uma palavra, uma frase ou uma tradução?
Envie-nos uma nova entrada.