Definitions Example for SbSigPR: π = (+3 − 1 + 4 − 2) ρ p (1) → ( − 3 − 1 + 4 − 2) ¯ π = (+3 − 1 + 4 − 2) ρ p (2) → (+1 + 3 + 4 − 2) ¯ ρ p (3) → ( − 4 + 1 − 3 − 2) ¯ ρ p (3) → ( − 4 − 3 − 1 − 2) ¯ ρ p (4) → (+2 + 3 − 1 + 4) ¯ ρ p (4) → (+2 + 1 + 3 + 4) ¯ ρ p (2) → ( − 3 − 2 − 1 + 4) ¯ ρ p (1) → ( − 2 + 1 + 3 + 4) ¯ ρ p (3) → (+1 + 2 + 3 + 4) ¯ ρ p (2) → ( − 1 + 2 + 3 + 4) ¯ ρ p (1) → (+1 + 2 + 3 + 4) ¯ Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 15 / 46
Definitions Example for SbSigPR: π = (+3 − 1 + 4 − 2) ρ p (1) → ( − 3 − 1 + 4 − 2) ¯ π = (+3 − 1 + 4 − 2) ρ p (2) → (+1 + 3 + 4 − 2) ¯ ρ p (3) → ( − 4 + 1 − 3 − 2) ¯ ρ p (3) → ( − 4 − 3 − 1 − 2) ¯ ρ p (4) → (+2 + 3 − 1 + 4) ¯ ρ p (4) → (+2 + 1 + 3 + 4) ¯ ρ p (2) → ( − 3 − 2 − 1 + 4) ¯ ρ p (1) → ( − 2 + 1 + 3 + 4) ¯ ρ p (3) → (+1 + 2 + 3 + 4) ¯ ρ p (2) → ( − 1 + 2 + 3 + 4) ¯ ρ p (1) → (+1 + 2 + 3 + 4) ¯ d ¯ ρ p ( π ) = 4 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 15 / 46
Definitions Breakpoint: occurs between two consecutive elements of π that should not be consecutive Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 16 / 46
Definitions Breakpoint: occurs between two consecutive elements of π that should not be consecutive Example: (+0 � − 3 − 2 � − 4 � − 5 � +1 � +6) Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 16 / 46
Definitions Breakpoint: occurs between two consecutive elements of π that should not be consecutive Example: (+0 � − 3 − 2 � − 4 � − 5 � +1 � +6) Strip: maximal subsequence of π without breakpoints Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 16 / 46
Introduction 1 Definitions 2 Algorithms 3 SbSigPRSigSR SbSigPRPT SbSigPRPTSigSRST Results 4 Conclusions 5 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 17 / 46
Problems Problem Best approximation factor Complexity 1.375 [6] NP-hard [7] SbR SbSigR - P [8] 1.375 [9] NP-hard [10] SbT ≈ 2.83 [11] ? SbRT 2 ∗ [12] SbSigRT ? 2 [13] NP-hard [14] SbPR 2 [15] ? SbSigPR SbPT 2 [3] ? 3 [4] ? SbPRPT Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 18 / 46
Introduction 1 Definitions 2 Algorithms 3 SbSigPRSigSR SbSigPRPT SbSigPRPTSigSRST Results 4 Conclusions 5 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 19 / 46
SbSigPRSigSR Tries to remove one breakpoint with one operation: π j = − π 1 +1 , 2 ≤ j ≤ n : ¯ ρ p ( j − 1) 1 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 20 / 46
SbSigPRSigSR Tries to remove one breakpoint with one operation: π j = − π 1 +1 , 2 ≤ j ≤ n : ¯ ρ p ( j − 1) 1 π i = − π n − 1 , 1 ≤ i ≤ n − 1 : ¯ ρ s ( i +1) 2 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 20 / 46
SbSigPRSigSR Tries to remove one breakpoint with one operation: π j = − π 1 +1 , 2 ≤ j ≤ n : ¯ ρ p ( j − 1) 1 π i = − π n − 1 , 1 ≤ i ≤ n − 1 : ¯ ρ s ( i +1) 2 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 20 / 46
SbSigPRSigSR Tries to remove one breakpoint with one operation: π j = − π 1 +1 , 2 ≤ j ≤ n : ¯ ρ p ( j − 1) 1 π i = − π n − 1 , 1 ≤ i ≤ n − 1 : ¯ ρ s ( i +1) 2 Tries to remove one breakpoint with two operations: π j = − π i − 1 , 1 ≤ i < j ≤ n : ¯ ρ p ( j ) · ¯ ρ p ( j − i ) 1 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 20 / 46
SbSigPRSigSR Tries to remove one breakpoint with one operation: π j = − π 1 +1 , 2 ≤ j ≤ n : ¯ ρ p ( j − 1) 1 π i = − π n − 1 , 1 ≤ i ≤ n − 1 : ¯ ρ s ( i +1) 2 Tries to remove one breakpoint with two operations: π j = − π i − 1 , 1 ≤ i < j ≤ n : ¯ ρ p ( j ) · ¯ ρ p ( j − i ) 1 π j = π i + 1 , 0 ≤ i +1 < j ≤ n : ¯ ρ p ( i ) · ¯ ρ p ( j − 1) 2 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 20 / 46
SbSigPRSigSR Tries to remove one breakpoint with one operation: π j = − π 1 +1 , 2 ≤ j ≤ n : ¯ ρ p ( j − 1) 1 π i = − π n − 1 , 1 ≤ i ≤ n − 1 : ¯ ρ s ( i +1) 2 Tries to remove one breakpoint with two operations: π j = − π i − 1 , 1 ≤ i < j ≤ n : ¯ ρ p ( j ) · ¯ ρ p ( j − i ) 1 π j = π i + 1 , 0 ≤ i +1 < j ≤ n : ¯ ρ p ( i ) · ¯ ρ p ( j − 1) 2 π i = − π j + 1 , 1 ≤ i < j ≤ n : 3 ρ s ( i ) · ¯ ¯ ρ s ( n + 1 − ( j − i )) Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 20 / 46
SbSigPRSigSR Otherwise, π is of the three forms: η n 1 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 21 / 46
SbSigPRSigSR Otherwise, π is of the three forms: η n 1 ◮ one signed prefix/suffix reversal sorts it Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 21 / 46
SbSigPRSigSR Otherwise, π is of the three forms: η n 1 ◮ one signed prefix/suffix reversal sorts it σ 1 = ( p b +1 . . . n p b − 1 +1 . . . p b . . . . . . 1 . . . p 1 ) 2 � �� � � �� � � �� � ℓ b +1 ℓ b ℓ 1 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 21 / 46
SbSigPRSigSR Otherwise, π is of the three forms: η n 1 ◮ one signed prefix/suffix reversal sorts it σ 1 = ( p b +1 . . . n p b − 1 +1 . . . p b . . . . . . 1 . . . p 1 ) 2 � �� � � �� � � �� � ℓ b +1 ℓ b ℓ 1 ◮ at most b + 2 reversals sort it Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 21 / 46
SbSigPRSigSR Otherwise, π is of the three forms: η n 1 ◮ one signed prefix/suffix reversal sorts it σ 1 = ( p b +1 . . . n p b − 1 +1 . . . p b . . . . . . 1 . . . p 1 ) 2 � �� � � �� � � �� � ℓ b +1 ℓ b ℓ 1 ◮ at most b + 2 reversals sort it σ 2 = ( − p 1 . . . − 1 − p 2 . . . − ( p 1 +1) . . . . . . 3 � �� � � �� � ℓ 1 ℓ 2 − n . . . − ( p b +1) ) � �� � ℓ b +1 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 21 / 46
SbSigPRSigSR Otherwise, π is of the three forms: η n 1 ◮ one signed prefix/suffix reversal sorts it σ 1 = ( p b +1 . . . n p b − 1 +1 . . . p b . . . . . . 1 . . . p 1 ) 2 � �� � � �� � � �� � ℓ b +1 ℓ b ℓ 1 ◮ at most b + 2 reversals sort it σ 2 = ( − p 1 . . . − 1 − p 2 . . . − ( p 1 +1) . . . . . . 3 � �� � � �� � ℓ 1 ℓ 2 − n . . . − ( p b +1) ) � �� � ℓ b +1 ◮ at most b + 2 reversals sort it Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 21 / 46
SbSigPRSigSR ρ s ( π ) ≤ 2 b ¯ ρ s ( π ) + 1 (1) d ¯ ρ p ¯ ρ p ¯ Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 22 / 46
SbSigPRSigSR ρ s ( π ) ≤ 2 b ¯ ρ s ( π ) + 1 (1) d ¯ ρ p ¯ ρ p ¯ ρ s ( π ) ≥ b ¯ ρ s ( π ) (2) d ¯ ρ p ¯ ρ p ¯ Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 22 / 46
SbSigPRSigSR ρ s ( π ) ≤ 2 b ¯ ρ s ( π ) + 1 (1) d ¯ ρ p ¯ ρ p ¯ ρ s ( π ) ≥ b ¯ ρ s ( π ) (2) d ¯ ρ p ¯ ρ p ¯ 2 b ( π ) + 1 1 lim = 2 + lim b ( π ) = 2 + ǫ (3) b ( π ) b ( π ) →∞ b ( π ) →∞ Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 22 / 46
Introduction 1 Definitions 2 Algorithms 3 SbSigPRSigSR SbSigPRPT SbSigPRPTSigSRST Results 4 Conclusions 5 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 23 / 46
SbSigPRPT If π 1 � = 1 , tries to remove two breakpoints with one operation: Since 1 π · τ p ( i, j ) = ( π i . . . π j − 1 π 1 . . . π i − 1 . . . π n ) , we must find π j − 1 = π 1 − 1 and π i − 1 = π j − 1 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 24 / 46
SbSigPRPT If π 1 � = 1 , tries to remove two breakpoints with one operation: Since 1 π · τ p ( i, j ) = ( π i . . . π j − 1 π 1 . . . π i − 1 . . . π n ) , we must find π j − 1 = π 1 − 1 and π i − 1 = π j − 1 ◮ To maintain our approximation, π i � = 1 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 24 / 46
SbSigPRPT If π 1 � = 1 , tries to remove one breakpoint with one operation by increasing the first strip: Let π = ( k +1 k +2 . . . k +( i − 1) π i . . . . . . ) 1 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 25 / 46
SbSigPRPT If π 1 � = 1 , tries to remove one breakpoint with one operation by increasing the first strip: Let π = ( k +1 k +2 . . . k +( i − 1) π i . . . . . . ) 1 If π j = k + i = π i − 1 + 1 exists, then τ p ( i, j ) 2 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 25 / 46
SbSigPRPT If π 1 � = 1 , tries to remove one breakpoint with one operation by increasing the first strip: Let π = ( k +1 k +2 . . . k +( i − 1) π i . . . . . . ) 1 If π j = k + i = π i − 1 + 1 exists, then τ p ( i, j ) 2 If π j − 1 = k = π 1 − 1 exists, then τ p ( i, j ) 3 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 25 / 46
SbSigPRPT If π 1 � = 1 , tries to remove one breakpoint with one operation by increasing the first strip: Let π = ( k +1 k +2 . . . k +( i − 1) π i . . . . . . ) 1 If π j = k + i = π i − 1 + 1 exists, then τ p ( i, j ) 2 If π j − 1 = k = π 1 − 1 exists, then τ p ( i, j ) 3 If π j +1 = − π 1 + 1 exists, then ¯ ρ p ( j ) , for 1 ≤ j ≤ n 4 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 25 / 46
SbSigPRPT If π 1 = 1 , send the first strip to the end of the permutation: It will be removed only when n is sent there 1 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 26 / 46
SbSigPRPT If π 1 = 1 , send the first strip to the end of the permutation: It will be removed only when n is sent there 1 Which guarantees that π 1 = 1 again at most one 2 more time Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 26 / 46
SbSigPRPT If π 1 = 1 , send the first strip to the end of the permutation: It will be removed only when n is sent there 1 Which guarantees that π 1 = 1 again at most one 2 more time Therefore, it will be possible to remove at least one 3 breakpoint until the end of the sorting Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 26 / 46
SbSigPRPT If π 1 = 1 , send the first strip to the end of the permutation: It will be removed only when n is sent there 1 Which guarantees that π 1 = 1 again at most one 2 more time Therefore, it will be possible to remove at least one 3 breakpoint until the end of the sorting ◮ using at most two extra operations that do not remove breakpoints Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 26 / 46
SbSigPRPT ρ p τ p ( π ) ≤ b ¯ ρ p ( π ) + 2 (4) d ¯ Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 27 / 46
SbSigPRPT ρ p τ p ( π ) ≤ b ¯ ρ p ( π ) + 2 (4) d ¯ ρ p ( π ) ρ p τ p ( π ) ≥ b ¯ d ¯ (5) 2 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 27 / 46
SbSigPRPT ρ p τ p ( π ) ≤ b ¯ ρ p ( π ) + 2 (4) d ¯ ρ p ( π ) ρ p τ p ( π ) ≥ b ¯ d ¯ (5) 2 b ( π ) + 2 4 lim = 2 + lim b ( π ) = 2 + ǫ (6) b ( π ) b ( π ) →∞ b ( π ) →∞ 2 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 27 / 46
Introduction 1 Definitions 2 Algorithms 3 SbSigPRSigSR SbSigPRPT SbSigPRPTSigSRST Results 4 Conclusions 5 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 28 / 46
SbSigPRPTSigSRST Tries to remove two breakpoints with one operation: if π j − 1 = π 1 − 1 and π i − 1 = π j − 1 exists, 1 2 ≤ i < j ≤ n , then τ p ( i, j ) Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 29 / 46
SbSigPRPTSigSRST Tries to remove two breakpoints with one operation: if π j − 1 = π 1 − 1 and π i − 1 = π j − 1 exists, 1 2 ≤ i < j ≤ n , then τ p ( i, j ) if π i = π n + 1 and π j = π i − 1 + 1 exists, 2 2 ≤ i < j ≤ n , then τ s ( i, j ) Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 29 / 46
SbSigPRPTSigSRST Tries to remove two breakpoints with one operation: if π j − 1 = π 1 − 1 and π i − 1 = π j − 1 exists, 1 2 ≤ i < j ≤ n , then τ p ( i, j ) if π i = π n + 1 and π j = π i − 1 + 1 exists, 2 2 ≤ i < j ≤ n , then τ s ( i, j ) neither π i − 1 = n and π i = 1 nor π j − 1 = − 1 and 3 π j = − n can happen Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 29 / 46
SbSigPRPTSigSRST Tries to remove one breakpoint with one operation: let π = ( k + 1 k + 2 . . . k + ( i − 1) π i . . . . . . ) , to 1 increase the first strip with a prefix transposition: Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 30 / 46
SbSigPRPTSigSRST Tries to remove one breakpoint with one operation: let π = ( k + 1 k + 2 . . . k + ( i − 1) π i . . . . . . ) , to 1 increase the first strip with a prefix transposition: if π j = k + i = π i − 1 + 1 , j ≤ n , exists, then τ p ( i, j ) 1 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 30 / 46
SbSigPRPTSigSRST Tries to remove one breakpoint with one operation: let π = ( k + 1 k + 2 . . . k + ( i − 1) π i . . . . . . ) , to 1 increase the first strip with a prefix transposition: if π j = k + i = π i − 1 + 1 , j ≤ n , exists, then τ p ( i, j ) 1 if π j − 1 = k = π 1 − 1 exists, then τ p ( i, j ) 2 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 30 / 46
SbSigPRPTSigSRST Tries to remove one breakpoint with one operation: let π = ( k + 1 k + 2 . . . k + ( i − 1) π i . . . . . . ) , to 1 increase the first strip with a prefix transposition: if π j = k + i = π i − 1 + 1 , j ≤ n , exists, then τ p ( i, j ) 1 if π j − 1 = k = π 1 − 1 exists, then τ p ( i, j ) 2 let π = ( . . . . . . π j − 1 k + 1 k + 2 . . . k + x ) , to 2 increase the last strip with a suffix transposition: Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 30 / 46
SbSigPRPTSigSRST Tries to remove one breakpoint with one operation: let π = ( k + 1 k + 2 . . . k + ( i − 1) π i . . . . . . ) , to 1 increase the first strip with a prefix transposition: if π j = k + i = π i − 1 + 1 , j ≤ n , exists, then τ p ( i, j ) 1 if π j − 1 = k = π 1 − 1 exists, then τ p ( i, j ) 2 let π = ( . . . . . . π j − 1 k + 1 k + 2 . . . k + x ) , to 2 increase the last strip with a suffix transposition: if π i − 1 = π j − 1 = k , i ≥ 2 , exists, then τ s ( i, j ) 1 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 30 / 46
SbSigPRPTSigSRST Tries to remove one breakpoint with one operation: let π = ( k + 1 k + 2 . . . k + ( i − 1) π i . . . . . . ) , to 1 increase the first strip with a prefix transposition: if π j = k + i = π i − 1 + 1 , j ≤ n , exists, then τ p ( i, j ) 1 if π j − 1 = k = π 1 − 1 exists, then τ p ( i, j ) 2 let π = ( . . . . . . π j − 1 k + 1 k + 2 . . . k + x ) , to 2 increase the last strip with a suffix transposition: if π i − 1 = π j − 1 = k , i ≥ 2 , exists, then τ s ( i, j ) 1 if π i = π n + 1 = k + x + 1 exists, then τ s ( i, j ) 2 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 30 / 46
SbSigPRPTSigSRST Tries to remove one breakpoint with one operation: let π = ( k + 1 k + 2 . . . k + ( i − 1) π i . . . . . . ) , to 1 increase the first strip with a prefix transposition: if π j = k + i = π i − 1 + 1 , j ≤ n , exists, then τ p ( i, j ) 1 if π j − 1 = k = π 1 − 1 exists, then τ p ( i, j ) 2 let π = ( . . . . . . π j − 1 k + 1 k + 2 . . . k + x ) , to 2 increase the last strip with a suffix transposition: if π i − 1 = π j − 1 = k , i ≥ 2 , exists, then τ s ( i, j ) 1 if π i = π n + 1 = k + x + 1 exists, then τ s ( i, j ) 2 again, we cannot separate n and 1 or − 1 and − n 3 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 30 / 46
SbSigPRPTSigSRST Tries to remove one breakpoint with one operation: let π = ( k + 1 k + 2 . . . k + ( i − 1) π i . . . . . . ) , to 1 increase the first strip with a prefix transposition: if π j = k + i = π i − 1 + 1 , j ≤ n , exists, then τ p ( i, j ) 1 if π j − 1 = k = π 1 − 1 exists, then τ p ( i, j ) 2 let π = ( . . . . . . π j − 1 k + 1 k + 2 . . . k + x ) , to 2 increase the last strip with a suffix transposition: if π i − 1 = π j − 1 = k , i ≥ 2 , exists, then τ s ( i, j ) 1 if π i = π n + 1 = k + x + 1 exists, then τ s ( i, j ) 2 again, we cannot separate n and 1 or − 1 and − n 3 if π j +1 = − π 1 + 1 , 1 ≤ j ≤ n − 1 , exists, then ¯ ρ p ( j ) 4 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 30 / 46
SbSigPRPTSigSRST Tries to remove one breakpoint with one operation: let π = ( k + 1 k + 2 . . . k + ( i − 1) π i . . . . . . ) , to 1 increase the first strip with a prefix transposition: if π j = k + i = π i − 1 + 1 , j ≤ n , exists, then τ p ( i, j ) 1 if π j − 1 = k = π 1 − 1 exists, then τ p ( i, j ) 2 let π = ( . . . . . . π j − 1 k + 1 k + 2 . . . k + x ) , to 2 increase the last strip with a suffix transposition: if π i − 1 = π j − 1 = k , i ≥ 2 , exists, then τ s ( i, j ) 1 if π i = π n + 1 = k + x + 1 exists, then τ s ( i, j ) 2 again, we cannot separate n and 1 or − 1 and − n 3 if π j +1 = − π 1 + 1 , 1 ≤ j ≤ n − 1 , exists, then ¯ ρ p ( j ) 4 if π i − 1 = − π n − 1 , 2 ≤ i ≤ n , exists, then ¯ ρ s ( i ) 5 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 30 / 46
SbSigPRPTSigSRST Otherwise, π is of one of the five forms: η n (one reversal sorts it) 1 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 31 / 46
SbSigPRPTSigSRST Otherwise, π is of one of the five forms: η n (one reversal sorts it) 1 (1 2 . . . k . . . − ( k + 1) . . . − ( i − 1) . . . 2 i i + 1 . . . n ) Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 31 / 46
SbSigPRPTSigSRST Otherwise, π is of one of the five forms: η n (one reversal sorts it) 1 (1 2 . . . k . . . − ( k + 1) . . . − ( i − 1) . . . 2 i i + 1 . . . n ) ( − n − ( n − 1) . . . − i . . . ( i − 1) . . . ( k + 1) . . . 3 − k − ( k − 1) . . . − 1) Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 31 / 46
SbSigPRPTSigSRST Otherwise, π is of one of the five forms: η n (one reversal sorts it) 1 (1 2 . . . k . . . − ( k + 1) . . . − ( i − 1) . . . 2 i i + 1 . . . n ) ( − n − ( n − 1) . . . − i . . . ( i − 1) . . . ( k + 1) . . . 3 − k − ( k − 1) . . . − 1) ( k + 1 k + 2 . . . n 1 2 . . . k ) 4 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 31 / 46
SbSigPRPTSigSRST Otherwise, π is of one of the five forms: η n (one reversal sorts it) 1 (1 2 . . . k . . . − ( k + 1) . . . − ( i − 1) . . . 2 i i + 1 . . . n ) ( − n − ( n − 1) . . . − i . . . ( i − 1) . . . ( k + 1) . . . 3 − k − ( k − 1) . . . − 1) ( k + 1 k + 2 . . . n 1 2 . . . k ) 4 ( − k − ( k − 1) . . . − 1 − n − ( n − 1) . . . − ( k +1)) 5 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 31 / 46
SbSigPRPTSigSRST Otherwise, π is of one of the five forms: η n (one reversal sorts it) 1 (1 2 . . . k . . . − ( k + 1) . . . − ( i − 1) . . . 2 i i + 1 . . . n ) ( − n − ( n − 1) . . . − i . . . ( i − 1) . . . ( k + 1) . . . 3 − k − ( k − 1) . . . − 1) ( k + 1 k + 2 . . . n 1 2 . . . k ) 4 ( − k − ( k − 1) . . . − 1 − n − ( n − 1) . . . − ( k +1)) 5 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 31 / 46
SbSigPRPTSigSRST Otherwise, π is of one of the five forms: η n (one reversal sorts it) 1 (1 2 . . . k . . . − ( k + 1) . . . − ( i − 1) . . . 2 i i + 1 . . . n ) ( − n − ( n − 1) . . . − i . . . ( i − 1) . . . ( k + 1) . . . 3 − k − ( k − 1) . . . − 1) ( k + 1 k + 2 . . . n 1 2 . . . k ) 4 ( − k − ( k − 1) . . . − 1 − n − ( n − 1) . . . − ( k +1)) 5 For the last four types, we must apply a prefix transposition to concatenate the first strip with the last one Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 31 / 46
SbSigPRPTSigSRST ρ s τ s ( π ) ≤ b ¯ ρ s ( π ) + 2 (7) d ¯ ρ p τ p ¯ ρ p ¯ Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 32 / 46
SbSigPRPTSigSRST ρ s τ s ( π ) ≤ b ¯ ρ s ( π ) + 2 (7) d ¯ ρ p τ p ¯ ρ p ¯ ρ s ( π ) ρ s τ s ( π ) ≥ b ¯ ρ p ¯ d ¯ (8) ρ p τ p ¯ 2 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 32 / 46
SbSigPRPTSigSRST ρ s τ s ( π ) ≤ b ¯ ρ s ( π ) + 2 (7) d ¯ ρ p τ p ¯ ρ p ¯ ρ s ( π ) ρ s τ s ( π ) ≥ b ¯ ρ p ¯ d ¯ (8) ρ p τ p ¯ 2 b ( π ) + 2 4 lim = 2 + lim b ( π ) = 2 + ǫ (9) b ( π ) b ( π ) →∞ b ( π ) →∞ 2 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 32 / 46
Introduction 1 Definitions 2 Algorithms 3 SbSigPRSigSR SbSigPRPT SbSigPRPTSigSRST Results 4 Conclusions 5 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 33 / 46
Results All algorithms are O ( n 2 ) Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 34 / 46
Results All algorithms are O ( n 2 ) They ran under a set of arbitrary permutations: 10000 of each size n , with n varying between 10 and 1000 in intervals of 5 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 34 / 46
Results All algorithms are O ( n 2 ) They ran under a set of arbitrary permutations: 10000 of each size n , with n varying between 10 and 1000 in intervals of 5 Approximation factors of the graph are an average between the 10000 of each size n Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 34 / 46
Results All algorithms are O ( n 2 ) They ran under a set of arbitrary permutations: 10000 of each size n , with n varying between 10 and 1000 in intervals of 5 Approximation factors of the graph are an average between the 10000 of each size n Each approximation factor was calculated using the theoretical lower bound Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 34 / 46
Results 2 1.9 1.8 average approximation factor 1.7 2-SPR 2-SPRSSR 2-SPRPT 2-SPRPTSSRST 1.6 1.5 1.4 1.3 0 100 200 300 400 500 600 700 800 900 1000 permutation size Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 35 / 46
Results Since all algorithms are asymptotic, it is expected to have approximation factors above 2: SbSigPRSigSR : only when n = 10 , for one permutation Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 36 / 46
Results Since all algorithms are asymptotic, it is expected to have approximation factors above 2: SbSigPRSigSR : only when n = 10 , for one permutation SbSigPRPT : only when n ≤ 100 , for 0.41% of the permutations (72.13% when n ≤ 20 ) Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 36 / 46
Results Since all algorithms are asymptotic, it is expected to have approximation factors above 2: SbSigPRSigSR : only when n = 10 , for one permutation SbSigPRPT : only when n ≤ 100 , for 0.41% of the permutations (72.13% when n ≤ 20 ) SbSigPRPTSigSRST : only when n ≤ 105 , for 0.44% of the permutations (76.62% when n ≤ 20 ) Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 36 / 46
Introduction 1 Definitions 2 Algorithms 3 SbSigPRSigSR SbSigPRPT SbSigPRPTSigSRST Results 4 Conclusions 5 Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 37 / 46
Conclusions We presented the first results for three sorting problems involving signed prefix and suffix operations: SbSigPRSigSR , SbSigPRPT and SbSigPRPTSigSRST Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 38 / 46
Recommend
More recommend