on sorting of signed permutations by prefix and suffix
play

On Sorting of Signed Permutations by Prefix and Suffix Reversals - PowerPoint PPT Presentation

On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions AlCoB2014, Tarragona, Spain Carla Negri Lintzmayer Zanoni Dias University of Campinas (UNICAMP) Institute of Computing Campinas, S ao Paulo, Brazil


  1. 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

  2. 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

  3. 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

  4. 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

  5. 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

  6. 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

  7. 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

  8. 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

  9. 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

  10. 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

  11. 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

  12. 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

  13. 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

  14. 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

  15. 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

  16. 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

  17. 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

  18. 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

  19. 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

  20. 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

  21. 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

  22. 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

  23. 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

  24. 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

  25. 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

  26. 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

  27. 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

  28. 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

  29. 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

  30. 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

  31. 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

  32. 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

  33. 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

  34. 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

  35. 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

  36. 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

  37. 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

  38. 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

  39. 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

  40. 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

  41. 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

  42. 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

  43. 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

  44. 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

  45. 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

  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

  47. 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

  48. 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

  49. 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

  50. 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

  51. 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

  52. 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

  53. 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

  54. 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

  55. 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

  56. 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

  57. 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

  58. 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

  59. 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

  60. 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

  61. 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

  62. Results All algorithms are O ( n 2 ) Carla, Zanoni (UNICAMP) On Sorting of Signed Permutations by Prefix and Suffix Reversals and Transpositions 34 / 46

  63. 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

  64. 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

  65. 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

  66. 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

  67. 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

  68. 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

  69. 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

  70. 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

  71. 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

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend