Next Article in Journal
An Approximation of the Prime Counting Function and a New Representation of the Riemann Zeta Function
Previous Article in Journal
Study on Ground Motion Amplification in Upper Arch Bridge Due to “W”-Type Deep Canyon Using Boundary-Integral and Peak Frequency Shift Methods
Previous Article in Special Issue
Rainbow Connection Numbers of WK-Recursive Networks and WK-Recursive Pyramids
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Sorting Permutations on an nBroom

by
Ranjith Rajesh
1,
Rajan Sundaravaradhan
2 and
Bhadrachalam Chitturi
3,*
1
Department of Mathematics, Amrita Vishwa Vidyapeetham, Amaravati 522503, Andhra Pradesh, India
2
Department of Mathematics, Amrita Vishwa Vidyapeetham, Amritapuri 690525, Kerala, India
3
Department of Computer Science, University of Texas at Dallas, Richardson, TX 75080, USA
*
Author to whom correspondence should be addressed.
Mathematics 2024, 12(17), 2620; https://doi.org/10.3390/math12172620 (registering DOI)
Submission received: 30 June 2024 / Revised: 21 August 2024 / Accepted: 22 August 2024 / Published: 24 August 2024
(This article belongs to the Special Issue Graph Theory: Advanced Algorithms and Applications)

Abstract

:
With applications in computer networks, robotics, genetics, data center network optimization, cryptocurrency exchange, transportation and logistics, cloud computing, and social network analysis, the problem of sorting permutations on transposition trees under various operations is highly relevant. The goal of the problem is to sort or rearrange the markers in a predetermined order by swapping them out at the vertices of a tree in the fewest possible swaps. Only certain classes of transposition trees, like path, star, and broom, have computationally efficient algorithms for sorting permutations. In this paper, we examine the so-called n b r o o m transposition trees. A single broom or simply a b r o o m is a spanning tree formed by joining the center of the star graph with one end of the path graph. A generalized version of a broom known as an n b r o o m is created by joining the ends of n brooms to one vertex, known as the n b r o o m center. By using the idea of clear path markers, we present a novel algorithm for sorting permutations on an n b r o o m for n > 2 that reduces to a novel 2 b r o o m algorithm and that further reduces to two instances of a 1 b r o o m algorithm. Our single-broom algorithm is similar to that of Kawahara et al.; however, our proof of optimality for the same is simpler.

1. Introduction

Consider a scenario in which we have an automated warehouse and use several robots to pick, sort, and move different items. Coordination and effective robot movement are critical components of multi-robot systems in small areas such as this one. We have to deal with this issue not only here but also in a number of other fields, including data center network optimization, genetics [1,2], computer interconnection networks [3,4,5,6], transportation, and logistics.
Token swapping, or sorting permutations, is a topic in combinatorics and graph theory. It involves a set of markers or tokens with a specified label placed on the vertices of a graph. The goal is to determine the bare minimum of swaps required to move the markers to a target vertex, where a generator set specifies the possible swaps. Token swapping or sorting permutations have significant applications in various fields, including the ones that we discussed above. The problems of effective robot movements in a confined space, optimizing the route of data in a data center network, genome rearrangement problems [1,2], autonomous vehicle coordination, etc., can be effectively solved by using the idea of token swapping.
In his 1973 book [7], Donald E. Knuth presented a number of basic data structures and algorithms for sorting and searching. It is among the most important studies in search and sorting algorithms and established the foundation for sorting permutation problems. In the 1980s, the hypercube architecture was formally introduced as a promising structure for parallel computer networks by C. Mead and L. Conway in their book [8]. An important factor in the growth of interconnection networks and parallel computing has been the hypercube architecture. Later in the late 1980s, Akers and Krishnamurthy [4] introduced a group-theoretic approach to modeling symmetric interconnection networks using automorphisms and Cayley graphs. An n-star network with a diameter of 3 ( n 1 ) 2 can hold n ! nodes, as demonstrated in this paper. Furthermore, as demonstrated in [4], Cayley networks exhibit features like a short diameter and vertex symmetry. These are studied in detail in [3,5,6,9,10]. The problem of sorting permutations on graphs was proved NP-complete and APX-hard in [11]. Further hardness results and two generalizations of sorting permutation problems, namely colored token swapping and subset token swapping, have been discussed in [12]. There are polynomial-time algorithms for paths, stars [4,13] and brooms [14,15,16,17].
In this paper, we examine the permutation sorting problem on an n b r o o m . A b r o o m , or a s i n g l e b r o o m , is a transposition tree that is created by connecting a path graph’s end vertex to the center of a star. A transposition tree that is created by connecting n b r o o m s to one vertex is known as an n b r o o m . For sorting permutations on paths, stars [4,13], and single brooms [14,15,16,17], there are a number of optimal algorithms that are known. We use the novel concept of clear path markers in this article to design an algorithm for sorting permutations on an n b r o o m for any n Z + . We will show that, when n = 1 , our algorithm for the single-broom is optimal. It is similar to that of Kawahara et al. [17], but our proof of optimality is much simpler. Additionally, we discuss a few of the properties of the algorithms designed in this article.

2. Preliminaries

Let A be a set of positive integers from 1 to n. A permutation on A is a bijection from A to itself. An identity permutation denoted by I is a permutation that leaves every element in set A unchanged. The set of all permutations under the operation of composition forms a group of order n ! called the symmetric group, denoted by S n . Let G be a non-trivial subset of S n , which either only contain transpositions or only contain three cycles. If we take an element α S n and an element g G , the composition of g with α gives another permutation β S n . Thus, g can be seen as an operator on S n and G as a set of operations. We call g a generator and G a generator set. Given two permutations α and β S n , we can find a sequence of generators g 1 , g 2 , g n such that it transforms α to β . The problem is to find the bare minimum of these generators needed to transform α to β and this number is called the distance of α from β and it is represented by d ( α , β ) . It is important to note that d ( α , β ) = d ( β , α ) when G is symmetric ( g G g 1 G ). Let g 1 , g 2 , g n be the shortest sequence of generators that transforms α to β and then using the same sequence of generators, we can transform β 1 α to I . Thus, the above mentioned problem is reduced to the problem of transforming the permutation into I and we call this sorting a permutation. Sorting permutations using various operations has been studied extensively for the last four decades. The operations studied include, but are not limited to, reversals, transpositions, block transpositions, suffix block transpositions, prefix reversals, and block interchange.
A transposition tree T is a spanning tree over n vertices v 1 , v 2 , v n , where the values 1 , 2 , n assigned to the vertices v 1 , v 2 , v n in T are called tokens or markers. A transposition tree is a rooted tree structure used to illustrate how a permutation of markers is sorted using transpositions, or swaps of adjacent elements. Each vertex in the transposition tree represents a permutation of markers, and each edge represents a transposition that changes one permutation into another. The transpositions in T are derived from the pairs of endpoints of each edge in T . For example, the edge ( v 1 , v 3 ) gives rise to the transposition ( 1 , 3 ) in T . The Cayley graph Γ ( S n , G ) of the symmetric group S n under a generator set G is defined as follows: each vertex in the Cayley graph corresponds to an element of S n and for each element σ S n and each generator g G , there is a directed edge from σ to σ g . Here, the transposition tree T is a generating set of the Cayley graph Γ ( S n , G ) . If G is symmetric, then the edge can be considered undirected. The number of edges in the shortest path between two vertices in Γ is the distance between corresponding permutations α and β S n . Here is an example of a Cayley graph on S 3 generated by the set G = { ( 12 ) ( 23 ) } .
                Mathematics 12 02620 i001
Token swapping on trees is another name for the problem of sorting permutations using transposition trees. The goal of the problem is to sort or rearrange the tokens or markers in a predetermined order by swapping them out at the vertices of a tree in the fewest possible swaps. The aim is to sort the markers in a tree with n vertices so that, with the least number of swaps possible, each marker reaches its proper position, called the home of the marker. Only token swaps between adjacent vertices—that is, vertices connected directly by an edge—are possible. In recent years, many people have extensively studied token swapping, its variations, and its hardness [11,14,17,18,19].
One kind of graph studied extensively is the path graph. A graph that has a sequence of vertices joined to one another by edges is called a path graph, or simply a path. To be more exact, a path of length n is a sequence of n vertices v 1 , v 2 , v n and n 1 edges such that every vertex v i , for i = 1 , 2 , n 1 , is connected to v i + 1 . It is shown in [20] that the number of inversions in the given permutations is the minimum number of swaps required to sort permutations on a path graph. An inversion for a given permutation σ is a pair ( σ i , σ j ) , such that σ i < σ j and i < j , where σ i is the element in the i-th position of the permutation σ . Ref. [7] contains a number of algorithms and methods for doing this. The star graph is another transposition tree that has been extensively researched in the past. A star graph or star is a tree that consists of n + 1 vertices v 1 , v 2 , v n + 1 and n edges ( v i , v n + 1 ) for i = 1 , 2 , n . The vertex v n + 1 is called the center of the star and v i for i = 1 , 2 , n are called the star leaf vertices. The markers whose homes are in star leaf vertices are called the star leaf markers. There are numerous efficient algorithms available for sorting permutations on a star, and the following is one of them:
Represent the permutation as a collection of cycles. Each cycle represents a sequence of vertices that can be sorted by a series of swaps involving the center of the star. Find out how many disjoint cycles there are in the permutation now. This can be done by following the permutation from each vertex until a cycle is completed. If d is the total number of un-homed star leaf markers and c is the number of cycles of length 2 consisting of un-homed star leaf markers, then the minimum number of swaps needed to sort this is d + c [4].

3. Sorting Permutations with a Broom

In this section, we present a novel approach based on the marker at the center of the b r o o m for efficiently sorting permutations on a b r o o m , and we demonstrate the algorithm’s optimality.
A b r o o m , denoted by B , is a spanning tree formed by joining the center of the star graph with one end of the path graph. To be more precise, let S be a star with vertex set v 1 , v 2 , v k + 1 and let P be a path graph with vertex set v k + 2 , v k + 3 , v n . The broom B is obtained by joining the center v k + 1 of the star S with the vertex v k + 2 of P . The collection of vertices v i for i = 1 , 2 , k are called the star leaf vertices and the marker whose home is one of these vertices is called the star leaf marker. The vertices v i for i = k + 1 , k + 2 , n are called the path vertices and the markers whose home is in these vertices are called the path markers. A path from v i to v j is a sequence of edges ( v i , v i + 1 ) , ( v i + 1 , v i + 2 ) , ( v j 1 , v j ) . Such a path can be represented simply as ( v i , v i + 1 , v j ) . The length of a path is the number of edges in that path. A path is said to be the shortest path from a vertex v i to v j if its length is less than or equal to the length of any other path from v i to v j . The distance from v i to v j , denoted by d ( v i , v j ) , is the length of the shortest path from v i to v j . Let i be a marker on v i and let H i be the home of i. The distance from v i to H i , denoted by d H ( i ) , is then the distance of i to its home. i.e., d H ( i ) = d ( v i , H i ) . Let i and j be two markers on an b r o o m and let i and j be in the vertices v i and v j , respectively. Let H i be the home of the marker i. Then, j is said to be in the path of i if the shortest path from v i to H i contains the vertex v j .
It is important to note that the center of the star S is also a path vertex. We will draw brooms with their edges oriented to the right, like in the Figure 1 below, and orient them from lower index vertices to higher index vertices to make them easier to identify.
The problem here is as follows. A broom B with an initial assignment of markers 1 , 2 , n is given. The goal is to find the minimum swap sequence so that at the end of the swap sequence, all the markers i should be in the vertex v i for i = 1 , 2 , n . A number of efficient algorithms already exists for sorting permutations on a b r o o m .
In 1999, Teresa P. Vaughan proposed the first algorithm for sorting permutations on a broom [16]. Her algorithm is based on the concept of the “star chain” of a marker. For a marker t m + 1 , the star chain consists of a sequence of markers t 1 , t 2 , t m + 1 , where each t i + 1 is located in the home of t i . All markers in the chain are star markers except t 1 . The core idea is that when a path token is part of the star, the leftmost token on the path smaller than the largest path marker on the star is brought to the vertex where t 1 is, and then the markers on the star chain are homed sequentially. Vaughan provided a lengthy and difficult proof in the same paper, demonstrating that any optimal algorithm for sorting a broom can be modified to mimic her algorithm exactly.
In 2017, Kawahara introduced an alternative algorithm for sorting permutations on a broom [17]. This approach is based on homing the largest token first when the center of the star is not occupied by a star leaf marker. If the center is occupied by a star leaf marker, the algorithm homes that star leaf marker first. In 2022, Biniaz proposed another algorithm focusing on the maximum un-homed path marker P m a x and a centered star chain [14]. The strategy here is to solve the chain when P m a x is in a star leaf and part of a centered star chain, bringing it to the center and then homing.
The most recent addition to this body of work is the algorithm proposed by Indulekha and Chitturi in 2022 [15]. Their method is based on the position of un-homed star leaf markers. If a star leaf marker exists on the path, their algorithm homes the closest star leaf marker on the path to its home first.
Compared to the previously mentioned algorithms, our proposal for sorting permutations on a broom is much simpler. It can be easily shown that our algorithm is an equivalent version of Kawahara’s algorithm, but with a much simpler proof of optimality. Additionally, while current algorithms for the b r o o m are difficult to generalize for n 2 , our algorithm is built in a way that allows us to apply it to design a general algorithm for n b r o o m s . In the following sections, we will present a generalized algorithm for n b r o o m by generalizing the algorithm presented here.

3.1. Algorithm A *

The following is our algorithm for sorting permutations on a single broom B .
  • While there is a path token that is not home:
    (a)
    Let P m a x be the largest path token that is not home.
    (b)
    If P m a x is on a star leaf and there is a star leaf marker S on the center of the broom, home S.
    (c)
    Home P m a x .
  • Solve the star.
An illustration of Algorithm A * is given below Figure 2:
In step 2 of our algorithm, we have to solve the star. An efficient way for sorting permutations on a star is given in [4] and we can use it to perform step 2. We begin our analysis by noting the following properties of our algorithm:
Theorem 1.
In Algorithm A * , every un-homed star leaf marker s can be homed efficiently in exactly d = d H ( i ) swaps. i.e., s is present in exactly d swaps in A * .
Proof. 
We will examine various scenarios based on where the star leaf markers are located in order to demonstrate this.
Case 1: Suppose that the star leaf marker s is in the center of the broom. Since there is only one edge (a star edge) on the shortest path from the center to the home vertex, the distance of s from its home is 1. We will directly home s by swapping with the marker in s’s home, in accordance with the algorithm. It is easy to observe that after it is homed, it will not be included in any swap sequence. Thus, in this instance, the property is true.
Case 2: Assume that s is located at one of the vertices of the star leaf. There is nothing to prove in this case if it is already in its home. Assume that it is in a vertex H t which is the home of another star leaf marker t. Because the shortest path from H t to s’s home contains exactly two star edges—one from H t to the center and the other from the center to s’s home—take note that the distance of s to its home is two in this instance. Here, one of the following two can happen:
  • Assume that the marker t is homed prior to s. In this case, s will go to the center during the homing t process. Examine the markers’ arrangement on the broom immediately following t. s should be in the center in this case. We will now home s by swapping it with the marker on its home in accordance with the algorithm. Thus, in order to home the marker s, a total of two swaps were made in A * .
  • Assume that before s, the marker t is not homed. Then, t should be in the home of s. Both of these markers will not be moved in the first step of our algorithm in this case. Only when solving the final star will s be moved. In this case, s and t should be a part of a chain in a star. The algorithm from [4] will be used to solve star in step 2. It is simple to observe that 2 is the number of swaps taken to home s.
Case 3: Suppose that s is in one of the non-center path vertices. s will not be included in the swap sequence to home any star leaf markers if any of them have already been homed before s. Due to the fact that the algorithm will only swap the markers between the center and star leaf vertex when the marker is in the center of the broom, the following swaps with s will occur in accordance with our algorithm: when the P m a x is being homed, s will be a part of it. It will move to the right and become homed when it reaches the center. It is evident that s is moving right (closer to its home) in each of these swaps. Consequently, in this case as well, s will be homed without any bad swaps. □
Theorem 2.
When two path markers are swapped in A * , the larger marker always moves to the right.
Proof. 
This is very easy to see. There is only one instance in A * where swapping two path markers will occur, and that is during homing P m a x . That is to say, if two path markers are swapped, the largest path marker in the current configuration will be included and it will be moving toward its home (to the right). □

3.2. Correctness of A*

In this section, we prove that the Algorithm A * given in the last section computes the optimal swap sequence to sort permutations on a b r o o m . To prove our result, we will use the idea of a “P-optimal algorithm”. A P-optimal algorithm is an optimal algorithm with the additional property that the number of swaps on path edges is minimal. Also, we will use the following results from the articles [4,14] to prove the optimality of our algorithm.
Lemma 1.
The optimum number of swaps to sort an initial placement of markers on a star is d + l , where d is the number of un-homed markers and l is the number of cycles in the permutation that have a length at least 2 and do not involve the center vertex [4].
Lemma 2.
An optimal swap sequence does not contain two swaps that swap the same two markers [14].
Lemma 3.
A P-optimal swap sequence σ has the following properties:
1.
No swap of two star markers occurs on a path edge.
2.
For every swap on a path edge that involves a path marker, the larger of the two markers moves to the right.
3.
No marker crosses the first path edge from left to right and later from right to left.
4.
The path markers that cross the first path edge from left to right do so in order [14].
Now let us prove that A * is an optimal algorithm to sort markers in a broom.
Theorem 3.
Algorithm A * computes the optimal algorithm for sorting permutations on a broom. That is, a sorting sequence with the least number of swaps.
Proof. 
We will demonstrate the optimality of our algorithm by induction on the number of tokens on the path, starting with the base case where the broom is just a star. For the general induction step, it is sufficient to demonstrate that the swaps carried out in the algorithm’s first phase when P m a x = n are part of an optimal swap sequence. We will prove this by considering the following cases, based on the initial position of P m a x :
  • Case 1: P m a x is on a non-center path vertex.
  • Case 2: P m a x is in the center of the broom.
  • Case 3: P m a x is on a star leaf vertex.
If P m a x starts at the broom’s center or on a path vertex, the swap sequence to get P m a x home is the same as the Biniaz algorithm [14]. Here, we will examine the scenario where P m a x is on the star leaf and demonstrate that it is part of an optimal algorithm.
Let P m a x be on a vertex of a star leaf. Let σ be a P-optimal algorithm that additionally has the property of homing all star leaf markers with the fewest number of swaps. Let σ m be the first swap on σ that moves P m a x to the center. We will demonstrate that the exact same result as our algorithm can be achieved by modifying σ . To illustrate this, let σ represent the series of path edge swaps performed prior to moving P m a x to the center. We can infer that P m a x is the first path marker to cross the first path edge based on Lemma 3, property 4. Consequently, before moving P m a x to the center, σ has no interaction with swaps on star edges, and we can carry out these swaps after bringing P m a x to the center. Thus, it suffices to demonstrate that σ can be adjusted to perform precisely the same function as A * in star edges, up to the point at which P m a x is located in the broom’s center. Thus, we have to show two things:
  • If there is a star leaf marker in the center, then that marker will be homed first in σ .
  • If there is a path marker in the center, then we will home P m a x first in σ .
We will show this using two cases based on the marker in the center of the broom.
Case 3.1: Suppose that the marker on the center vertex of the broom is a star leaf marker S 1 . In this case, there are two possible swaps we can perform before bringing P m a x to the center:
  • homing the markers in the center until there is a path marker in center.
  • swapping the star leaf marker S 1 in the center with a path marker that is not in the home of S 1 .
Assume that P m a x is currently at H i . For i = 1 , 2 , m 1 , assume that a star leaf vertex S i + 1 is residing in the home of S i , and a path marker P is residing in the home of S m . Let us assume that we are first homing S 1 , S 2 , S m in that order, and then we are moving P m a x to the center. This means that we are homing the markers on the center vertex to their home until a path marker is here. Given that S 1 is in the center, S 2 will move to the center and it will only take one swap to get S 1 back home. Now, S 2 can be homed in a single swap, bringing S 3 to the center. The process will go on until we get to S m , at which point the path marker P will reach the center. It will require m swaps in total to accomplish this (one swap for homing each marker from the center to its home). Next, swap P m a x for P to move it to the center. Once P m a x is in the center from Case 2, we know that we will home P m a x first and let T be the configuration just after homing P m a x .
Let us now consider the case where we are first bringing P m a x to the center. In this case, S 1 will go to H i . As previously mentioned, we have to home P m a x first once it is in the center. In this current configuration, the relative position of markers is the same as that of T, i.e., all markers in star leaves in T are still in T, and all markers on path vertices are in path vertices in the same exact position. The locations of the markers in the star leaves are the only distinction between the two arrangements. From this point on, homing the markers S 1 , S 2 , S m will require at least m + 1 steps because the star leaf markers form a single chain with m un-homed markers by Lemma 1. Furthermore, since the locations of any additional star leaf markers are the same in T and here, the same number of swaps are required to home these markers in each scenario. Notably, the total number of swaps needed in the latter case is either greater or equal to the number needed in the former, depending on the marker P and the one in the middle of the broom in the current configuration. In other words, the number of star leaf marker swaps will increase if we move P m a x to the center before homing the star leaf marker there. This is in contradiction with the idea that σ is a P-optimal algorithm that homes all star leaf markers with the fewest number of swaps.
Let us now examine the second possible scenario, which involves swapping the star leaf marker S 1 in the center with a path marker that is not located in S 1 ’s home. Let T 1 be the new configuration and H j be the current position of S 1 . Note that in T 1 , all the markers S 1 , S 2 , S m are in the star leaves and none of them are in their homes. Moreover, the position of other star leaf markers (if any) in T 1 is the same as that of T. As a result, in configuration T 1 , at least one more swap will be needed to bring the star leaf markers home than in T 2 , which is a contradiction to the fact that σ is a P-optimal algorithm that homes all star leaf markers with the fewest number of swaps.
Case 3.2: Let us assume that there is a path marker P at the center of the broom. Before moving P m a x to the center in this instance, there are two possible moves that we could make:
  • Swapping P with an un-homed star leaf marker, which is currently in a star leaf.
  • Swapping P with a path marker currently residing in a star leaf.
We will examine each of these scenarios independently and demonstrate that executing these swaps prior to P m a x will refute the notion that σ represents a P-optimal algorithm.
Case 3.2.1: Let S 1 be an un-homed star leaf marker that is in the star leaf vertex H k . Let us say that first we are going to swap P for S 1 . After that, S 1 will move to the center and P must move to H k . Let T represent the current configuration. Given that the star leaf marker S 1 is located in the center in T , Case 3.1 requires us to home S 1 at this instance. Until a path marker is in the center, keep doing this with the marker in the center. This will result in homing a chain of star leaf markers S 1 , S 2 , S m . It is possible that P or another path marker P will be the path marker that moves at the end of the swap sequence mentioned above. Assume that after completing the aforementioned swap sequence, P is the marker in the center. Now home, P m a x . If the marker on the center vertex is a star leaf marker S , then home the marker and repeat the process until there is a path marker in the center. Let T 1 be the configuration at this point. Now consider the case where we are homing P m a x first. As before, if the marker on the first path vertex is a star leaf marker S, then it must be in the center, following homing P m a x . We must then home this marker by Case 3.1, and we should keep doing this until there is a path marker in the center. It should be noted that the star leaf markers S 1 , S 2 , S m will remain in place after this swap. Now we must home the markers S 1 , S 2 , S m in that order. The following are the reasons why we are able to do this at this time. The home of S 1 , S 2 , S m is occupied by S 2 , S 3 , S m , S 1 , respectively. As we are only swapping between the center of the broom and the star leaf vertices where S i ’s are currently located in order to home these markers, homing these markers will not affect the position of other markers, and this sequence of swaps is independent of other swaps at this point. Let the configuration after this be T 2 . It is easy to see that T 1 = T 2 and the number of swaps to obtain these configurations from the initial one is also the same. Assume for the moment that at the conclusion of the swap sequence to the homes S 1 , S 2 , S m , a path marker P P is moving to the center. At this instance, if we are bringing P m a x to the center and homing it, then P will move to the star leaf marker H i . Home it if there is a star-leaf marker S in the center, continue doing this until a path marker appears in the center. Let the current configuration be T 1 . Assume for the moment that we are homing P m a x after first bringing it to the center by swapping it with P. Once more, home the star leaf marker in the center S if it exists, and continue the process until a path marker appears in the center. It should be noted that S 1 , S 2 , S m will become homed if the star leaf marker is in the center’s home immediately following homing P m a x is H k . We must home these markers separately if not. The reasons we talked about in the previous case make this possible in this particular situation. Assume that T 2 is the current configuration. It is clear that every marker in T 1 and T 2 , with the exception of P and P , is exactly in the same location. Furthermore, the total number of swaps needed to obtain T 1 is one more than to obtain T 2 and the number of swaps involving star leaf markers is the same to obtain both configurations from the initial one. Depending on the relative positions of P and P , we will consider different possibilities and prove that in each case, the number of swaps required to home the markers in the latter case is less than or equal to the number of swaps needed in the former case. Since, in all cases, the positions of P and P are in stars in both configurations, the number of swaps required to home the markers depends on the relative positions of P and P at the time of homing the biggest one out of these two markers.
In the first case, assume that when the larger marker is becoming homed, the smallest of these markers is on the right side of the larger marker. Then, in the second case, the smallest marker must be on the left side of the larger marker at the same stage. Then, in the first case, we have to swap those two markers, since the smallest marker is in the path of the larger marker to its home. Then, the swap sequence in the first case will not be optimal because, by Lemma 2, an optimal swap sequence does not contain two swaps that swap the same token. Now, suppose that the larger of the markers is on the right side of smaller marker in the first case. Then, in Case 2, the smaller marker should be on the right side of the larger marker. Therefore, in this situation, we need one extra swap to home the markers in the second case compared to the first one. But, since the number of swaps up to the point of obtaining configuration T 2 is one less than that of obtaining configuration T 1 , at the end, the number of swaps in both swap sequences will be the same. Now, if both P and P are on the star leaf when we are homing the biggest of these markers, then the total number of swaps from the current configuration will be the same since both markers are not in the path of the other marker to its home. So, in total, the number of swaps in the second case is less than that in the first case. The aforementioned discussions show that when there is a path marker in the center vertex and if we swap the path marker with an un-homed star leaf marker, which is currently in a star leaf vertex, one of the following will happen:
  • This swapping sequence will not be part of the optimal swap sequence
  • The number of swaps is the same as that in the case where we are homing P m a x first.
Case 3.2.2: Suppose that we are swapping the path marker in the center with a path marker that is at one of the star leaf markers first. Let P be the path marker at center and let P be the path marker in star leaf. After the swap, P moves to the center and P moves to the star leaf. Now, bring P m a x to the center and home it. Let the current configuration be T * . Now, consider the case where we are bringing P m a x to the center first and then homing it. Let the configuration just after that be T * * . In both configurations, the position of all markers except P and P is the same. Furthermore, it is important to note that the number of swaps performed to obtain T * is exactly one more than to obtain T * * . Now, this is the same situation that we are obtaining in the second part of Case 3.2.1., except for the fact that no star leaf markers are moved. Just like in Case 3.2.1, the total number of swaps depends on the relative position of P and P . Using the exact same arguments that we put forward there, we can show that in all possible cases, the number of swaps when we are homing P m a x first is less than or equal to the number of swaps in the case where we are swapping P with a star leaf marker.
The aforementioned arguments show that whenever there is a path marker on the center of the broom, any P-optimal algorithm σ with the additional property that it home all the star leaf markers in least number of steps can be modified to perform same as our Algorithm A * . □

4. Sorting Permutations with a 2 Broom

We will present a new algorithm in this section for sorting permutations on a 2 b r o o m . A 2 b r o o m denoted by B ( 2 ) is a transposition tree obtained by joining the edges of 2 b r o o m s. Specifically, we consider two stars, S L and S R , with vertices v 1 , v 2 , v i and v j + 1 , v j + 2 , v n , respectively, and a path graph, P , with vertices v i + 1 , v i + 2 , v j . Following that, a double broom with n vertices, v 1 , v 2 , v n , was created by connecting v i and v j + 1 , the centers of S L and S R , with the two ends of the path graph, v i + 1 and v j . We will draw a 2 b r o o m with its edges oriented to the right, like in the Figure 3 below, and orient them from lower index vertices to higher index vertices to make them easier to identify.
In contrast to sorting permutations on a b r o o m , finding an algorithm for sorting permutations with a 2 b r o o m is a challenging task. There are many features of a 2 b r o o m we need to take into account, such as the two stars at each end, so simply generalizing the algorithm for a b r o o m will not result in an optimal algorithm for 2 b r o o m s. We suggest an algorithm based on the following notion: from S L and S R , we should extract the star leaf markers whose residences are in the opposite stars. Furthermore, we should ensure that, at the time of homing the star leaf marker, the path vertices whose homes are far from the stars are on the path vertices. We need to take a lot of factors into account in order to accomplish this. We are suggesting the following algorithm to sort permutations on a 2 b r o o m .

Algorithm A * *

  • Determine if the 2-broom is a union of two independent single brooms. If true, divide them and solve each broom using Algorithm A*.
  • If a star leaf marker from the same star is present in the center of S L or S R , home it.
  • (a)
    If there are star leaf markers s r ’s from S R in the center of S L and in the star leaves of S L , suppose a sequence of markers s r 1 , s r 2 , , s r n , t exists in consecutive vertices, from left to right, starting from the center of S L such that s r 1 , s r 2 , , s r n are star leaf markers of S R and t is another marker, then
    • If t is not in the center of S R , swap s r n , , s r 2 , s r 1 with the marker on the right in that order.
    • If t is in the center of S R , do the following:
      • If t is a star leaf marker from S L , then, swap s r n , , s r 2 , s r 1 with the marker on the right in that order.
      • Else, if there are any star leaf markers s l 1 , s l 2 , , s l n from S L in the star leaves of S R at this point.
        If the home of s l 1 , s l 2 , , s l k from S L is occupied by the star leaf markers s r 1 , s r 2 , , s r k , respectively, then if in the home of s r 1 , s r 2 , , s r k , there is a star leaf marker from S L , bring s l i to the center such that the home of s r i is occupied by a star leaf marker from S L . Otherwise, if there is a path marker in the home of s r 1 , s r 2 , , s r k , then move the smallest path marker out of these to the center. Else, move any one of the markers from s l 1 , s l 2 , , s l n to the center. Then, swap s r n , , s r 2 , s r 1 with the marker on the right in that order.
        Else, swap t with that star leaf marker whose home contains the largest marker out of all the markers in the home of the star leaf markers of S L in the star leaf of S R . Then, swap s r n , , s r 2 , s r 1 with the marker on the right in that order.
      • Else, if there is a path vertex smaller than t in the star leaves of S R , swap t with the smallest of them first and then swap s r n , , s r 2 , s r 1 with the marker on the right in that order.
      • Else, swap s r n , , s r 2 , s r 1 with the marker on the right in that order.
    (b)
    If the center of S L is occupied by a path marker P:
    • If there are star leaf markers s r 1 , s r 2 , s r n from S R in the star leaves of S L :
      If the home of s r 1 , s r 2 , , s r k from S R is occupied by the star leaf markers s l 1 , s l 2 , , s l k , respectively, then if in the home of s l 1 , s l 2 , , s l k , there is a star leaf marker from S R , bring s r i to the center such that the home of s l i is occupied by a star leaf marker from S R . Otherwise, if there is a path marker in the home of s l 1 , s l 2 , , s l k , then move the smallest path marker out of these to the center. Else, move any one of the markers from s r 1 , s r 2 , , s r n to the center.
    • If there are path markers larger than P:
      Move the largest of them to the center by swapping with P.
    (c)
    Repeat Steps 1–3 until there are no more possible moves.
  • (a)
    If there is a star leaf marker s l from S L in the center of S R and there is a star leaf marker from S L in the star leaves of S R , let us say there is a set of markers s l 1 , s l 2 , , s l n , t that are lined up from right to left, starting in the middle of S R . These markers are star leaf markers of S L , and t is another marker. We need to swap s r n , , s r 2 , s r 1 with the marker on the right, going in that order.
    (b)
    If the center of S R is occupied by a path marker P:
    • If there exists a star leaf marker s l from S L in the star leaves of S R :
      Move the star leaf marker s l , whose home contains the largest marker out of all the markers in the home of star leaf markers of S L in the star leaf of S R , from S L to the center of S R by swapping it with P.
    • If there are path markers larger than P:
      Move the largest of them to the center by swapping with P.
    (c)
    Repeat Steps 1, 2, and 4 until there are no more possible moves.
  • (a)
    If there are any star leaf markers of S L in the path vertices, home the one closest to its home, and then repeat steps 1–4.
    (b)
    Else, if there are any star leaf markers of S R in the path vertices, home the one closest to its home, and then repeat steps 1–4.
    (c)
    Else, solve S L , S R , and the path independently.
It can be observed that the roles of S L and S R in Algorithm A * * can be exchanged. There are two primary factors that can give rise to issues when sorting permutations using a 2 b r o o m . Firstly, the order in which the path markers exit the star is crucial; altering this order could lead to an increased number of swaps. The second is the swapping involving the path markers on the path. It is evident from the way our algorithm is built that none of the star leaf markers are moving away from their home at any point; that is, there has not been any bad star leaf marker swapping. However, because homing the star leaf markers involves moving the path markers across the path, the order in which we do this is crucial. Thus, altering the order of homing star leaf markers may also lead to an increased overall number of swaps. These two crucial factors are the main focus of our algorithm. Our algorithm is essentially doing the following. One by one, we will move the biggest path markers from S L and all of the star leaf markers of S R to the path until it reaches the vertex right before the center of S R . Once it reaches that point, we will try to do the same with S R . The smallest path markers from S R and all star leaf markers from S L will be moved to the path. We prefer to use these markers for swapping first because, in that scenario, every marker will move closer to its home and there will not be any bad swapping. We will repeat this until there are no more valid moves. All of our star leaf markers will be in their respective stars or on path vertices right now. If there is any star leaf marker in the path, we will home them one by one in the increasing order of distance to their home. Then, using the previously established algorithms, we will solve the stars and path as needed.

5. Sorting Permutations with a n Broom for n 3

In this section, we will design an optimal algorithm for sorting permutations on an n b r o o m for n 3 . A transposition tree formed by connecting the end vertices of n distinct brooms is known as an n b r o o m , represented by B ( n ) . To be precise, let B 1 , B 2 , B n be n distinct brooms with vertex sets { v 1 1 , v 2 1 , , v k 1 1 } , { v 1 2 , v 2 2 , , v k 2 2 } ,⋯, { v 1 n , v 2 n , , v k n n } , respectively. Subsequently, an n b r o o m is formed by connecting the vertices v k 1 1 , v k 2 2 , , v k n n to a common vertex v c , which is referred to as the n b r o o m center. Finding an algorithm for sorting permutations on an n b r o o m for n 3 is a difficult task, just like in the case of a 2 b r o o m . Here, in addition to the issues we faced with the 2 b r o o m , there will not be any “linear structure”, which will increase the difficulty of creating an algorithm for an n b r o o m for n 3 . Here, we will present a brand-new idea known as “clear path markers”, and we will use it to build our algorithm.
Consider an n b r o o m , B ( n ) . Suppose α is a marker, and its home vertex is H α . Then, d c ( α ) indicates the distance from H α to the n b r o o m center, v c . Within a certain marker configuration, let E i represent all the un-homed markers in broom B i in B ( n ) , whose home vertices are the farthest from the center v c . Those points on E = E i are called “end markers”, and their home vertices are called “end vertices”. A “clear path marker” is a marker C p in E that will not move any other markers in E away from its home when it is swapped with markers along its path to home in the current orientation. The clear path marker C p m a x , which contains the maximum number of end markers in its path, is called the maximum clear path marker.

5.1. Algorithm A n *

  • Determine if the n b r o o m contains a b r o o m that contains all of its markers in itself. If true, remove the broom from B ( n ) and solve the b r o o m using A *
  • If a star leaf marker from the same star is present in the center of any of the star in B ( n ) , then home it.
  • If there are star leaf markers from other stars in the center and the star leaves of a star S , suppose that a sequence of markers s 1 , s 2 , , s k , t exists in consecutive vertices, starting from the center of S , in the direction of v c , such that s 1 , s 2 , , s k are star leaf markers from other stars and t is some other marker. If t is not in v c , swap s k , , s 2 , s 1 with the marker next to it in the direction of v c , in the given order.
  • If there exists a path marker p in the center of S , then
    (a)
    If there is a collection of star leaf markers from other stars in the star leaves of S
    • If there exists a single star leaf marker from a star other than S , move it to the center of S .
    • Else, group the markers based on where their homes are and take a group. Out of all the markers in that group, find the markers whose home contains the markers that are farthest away from center and move one of them to the center.
    (b)
    Else, if there exist path markers p i s such that d c ( p i ) > d c ( p ) , then move one of the p i s with maximum value for d c ( p i ) to the center.
    Repeat this process until there are no valid moves.
  • Perform steps 3 and 4 for all the stars in B ( n ) .
  • Determine the clear path markers.
    (a)
    If there is a unique maximum clear path marker, home it.
    (b)
    Else, if there exists a chain of maximum clear path markers c p 1 , c p 2 , c p n such that the path of c p i to its home contains c p i + 1 for i = 1 , 2 , n 1 and the path of c p n to its home contains c p 1 , then home c p 1 , c p 2 , c p n in that order.
    (c)
    Else, if there are 2 maximum clear path markers, c p 1 and c p 2 such that c p 2 is in the path of c P 1 but c p 1 is not in the path of c p 2 , then home c p 1 .
    (d)
    Item any one of the maximum clear path markers.
    Repeat steps 1, 2, and 5 until there are no valid moves.
One of the interesting properties that we can observe here for A n * is as follows:
Theorem 4.
In Algorithm A n * , every un-homed star leaf marker s can be homed efficiently in exactly d = d H ( s ) swaps, i.e., s is present in exactly d swaps in A n * .
Proof. 
Case 1: Let s be a star leaf marker from a broom B i and let d be the distance of s to its home. To show that s can be homed in exactly d swaps, all you have to do is show that s is moving closer to its home in every swap that involves it. We will consider different possibilities based on the position of s and prove our result is true in all cases.
Suppose that s is in the center of the star S i , in the broom B i . As per step 2 of A n * , we will home s directly by swapping it with the marker in its home and it was not involved in any other swaps before that. It is also important to note that s will not be swapped once it becomes homed.
Case 2: Suppose that s is in a path vertex of B i , then s can possibly be a part swap in the following scenarios.
  • Suppose s is in a path vertex p i and suppose that there exists a sequence of star leaf markers s 1 , s 2 , s k from other brooms in the adjacent vertices of s. It will then be swapped with all of these markers according to step 3 of A n * . Keep in mind that these markers s 1 , s 2 , , s k are moving closer to the center of the n b r o o m . This means that s is swapped closer to the star S i , which means it is moving closer to its home. At the end of this swap sequence, s will reach the center of the star and will become homed, as we discussed in Case 1.
  • Imagine that it is not part of that swap sequence. Then, it will remain in the path until one of the following happens:
    (a)
    s becomes a maximum clear path marker.
    (b)
    A marker s residing in B i , which is farther away from the center of the n b r o o m than s, becomes a maximum clear path marker before s.
    In the first scenario, our result is obvious, since it will become homed directly at the moment, as per step 6 of A n * . For that, it will take the shortest path from its position to its home and it will swap with the markers along that path until it gets home. In the second scenario, when the marker s becomes homed, it will be swapped with s. It is very easy to note that s is moving closer to its home since s is moving closer to the center of the n b r o o m at that instance. The above-mentioned swaps can happen until the s becomes a maximum clear path marker. Once it becomes a maximum clear path marker, as we mentioned in the first scenario, it will become homed directly, and during that, it will always move closer to its home.
    Case 3: If s is in the center of the n b r o o m , it will not be moved from there when we are executing steps 1 to 4. Now, if there exists a maximum clear path marker residing in B i whose home is in some other broom, then s will be part of the swap sequence to home s according to step 5. Here, s will get moved to the broom B i , closer to its home. It is important to note that s will not be part of the swap sequence to home s if it is a maximum clear path marker residing in some other brooms, because of the following reasons. If such a maximum clear path marker s exists, then its home should be in the same broom. Otherwise, the path of this marker to its home will pass through the center of the n b r o o m , where s is, and as part of homing s , the marker s will get moved away from its home, a contradiction to our assumption that s is a clear path marker. Therefore, if such a marker exists, its home should be in the same broom. In that case, the path of s to its home will not contain the center vertex and, as a consequence, the marker s will not become swapped when we are homing s . The second possibility is when s is not part of any swap sequence until it becomes a maximum clear path marker. In this case, as we discussed earlier, it is easy to see that s will not be moved away from its home in any of the swaps it is part of.
    Case 4: Suppose s is residing in the path vertex of some other brooms. All the possible cases that we discussed in Case 3 are possible here, and we can show that s is not moving away from its home in any of these cases using similar arguments that we put forward in Case 3. A different possible scenario that can happen here is the following. Suppose that s is part of a sequence of star leaf markers in the path of the respective broom, as in step 3 of A n * . In this case, as per algorithm A n * , s will move closer to the center of the n b r o o m , i.e., closer to its home. Now, suppose that s is in the star leaf of some other broom. Then, by step 4 of algorithm A n * , the following will happen: s will move to the center of the star by swapping the path marker in the center.If there is no other star leaf marker in the star leaves there, then s will stay there until it becomes a maximum clear path marker or until a star leaf marker from that star is homed. In the first scenario, the argument is the same as before. In the second one, s will first move to the path of the broom. Then, we can use the arguments given in the beginning of this case. If there is a star leaf marker from some other star in that star leaf, the same thing will happen: s will become moved to the first path vertex of that broom. Then, we can use the earlier arguments.

5.2. An Illustration of the Algorithm A n * for Sorting 3 B r o o m

Figure 4 shows an illustration of Algorithm A n * for a 3 b r o o m . Here we are considering a 3 b r o o m with 16 vertices. In each step we are homing the markers based on algorithm A n * .

6. Conclusions

The problem of sorting permutations on different transposition trees has various applications in computer networks, genetics, robotics, etc. In this article, we designed an optimal algorithm for sorting permutations on a b r o o m , 2 b r o o m , and n b r o o m for n 3 . We showed that our algorithm is optimal to sort permutations on a broom by showing that any P-optimal algorithm that also has the property of homing all the star leaf markers with the fewest number of swaps can be changed to perform the same swap sequence as our algorithm. Also, to design an algorithm for an n b r o o m , we introduced a new step using clear path markers. The correctness of algorithms A * * and A n * is yet to be proven. Furthermore, a polynomial-time algorithm for sorting permutations on other tree structures can also be explored using similar ideas.

Author Contributions

Conceptualization, R.R., R.S. and B.C.; writing—original draft, R.R.; writing—review and editing, R.R., R.S. and B.C. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Walter, M.E.M.; Curado, L.R.A.; Oliveira, A.G. Working on the problem of sorting by transpositions on genome rearrangements. In Combinatorial Pattern Matching: 14th Annual Symposium, CPM 2003 Morelia, Michoacán, Mexico, 25–27 June 2003; Proceedings 14; Springer: Berlin/Heidelberg, Germany, 2003; pp. 372–383. [Google Scholar]
  2. Christie, D.A. Genome Rearrangement Problems; University of Glasgow (United Kingdom): Glasgow, UK, 1998. [Google Scholar]
  3. Heydemann, M.-C. Cayley graphs and interconnection networks. In Graph Symmetry; Springer: Dordrecht, The Netherlands, 1997; pp. 167–224. [Google Scholar]
  4. Akers, S.B.; Krishnamurthy, B. A group-theoretic model for symmetric interconnection networks. IEEE Trans. Comput. 1989, 38, 555–566. [Google Scholar] [CrossRef]
  5. Lakshmivarahan, S.; Jwo, J.-S.; Dhall, S.K. Symmetry in interconnection networks based on Cayley graphs of permutation groups: A survey. Parallel Comput. 1993, 19, 361–407. [Google Scholar] [CrossRef]
  6. Xu, J. Topological Structure and Analysis of Interconnection Networks; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2013; Volume 7. [Google Scholar]
  7. Knuth, D.E. The Art of Computer Programming: Sorting and Searching, 2nd ed.; Pearson Education: London, UK, 1997; pp. 426–458. [Google Scholar]
  8. Mead, C.; Conway, S. Introduction to VLSI Systems; Addison-Wesley: Reading, MA, USA, 1980. [Google Scholar]
  9. Wang, M.; Guo, Y.; Wang, S. The 1-good-neighbour diagnosability of Cayley graphs generated by transposition trees under the PMC model and MM* model. Int. J. Comput. Math. 2017, 94, 620–631. [Google Scholar] [CrossRef]
  10. Wang, M.; Lin, Y.; Wang, S. The 2-good-neighbor diagnosability of Cayley graphs generated by transposition trees under the PMC model and MM* model. Theor. Comput. Sci. 2016, 628, 92–100. [Google Scholar] [CrossRef]
  11. Miltzow, T.; Narins, L.; Okamoto, Y.; Rote, G.; Thomas, A.; Uno, T. Approximation and hardness of token swapping. In Proceedings of the 24th Annual European Symposium on Algorithms (ESA 2016), Aarhus, Denmark, 22–24 August 2016; Volume 57. [Google Scholar]
  12. Bonnet, É.; Miltzow, T.; Rzazewski, P. Complexity of Token Swapping and Its Variants. Algorithmica 2017, 80, 2656–2682. [Google Scholar] [CrossRef]
  13. Portier, F.J.; Vaughan, T.P. Whitney Numbers of the Second Kind for the Star Poset. Eur. J. Comb. 1990, 11, 277–288. [Google Scholar] [CrossRef]
  14. Jain, B.A.; Lubiw, K.; Masárová, A.; Miltzow, Z.; Mondal, T.; Naredl, D.; Murty, A.; Josef, T.; Alexi, T. Token Swapping on Trees. arXiv 2019, arXiv:1903.06981. [Google Scholar]
  15. Sadanandan, I.T.; Chitturi, B. Optimal algorithms for sort- ing permutations with brooms. Algorithms 2022, 15, 220. [Google Scholar] [CrossRef]
  16. Vaughan, T.P. Factoring a permutation on a broom. J. Comb. Math. Comb. Comput. 1999, 30, 129–148. [Google Scholar]
  17. Kawahara, J.; Saitoh, T.; Yoshinaka, R. The Time Complexity of the Token Swapping Problem and Its Parallel Variants. Walcom Algorithms Comput. 2017, 10167, 448–459. [Google Scholar]
  18. Malavika, J.; Scaria, S.; Indulekha, T.S. On Token Swapping in Labeled Tree. In Proceedings of the 2021 Third International Conference on Inventive Research in Computing Applications (ICIRCA), Coimbatore, India, 2–4 September 2021; pp. 940–945. [Google Scholar]
  19. Yamanaka, K.; Demaine, E.D.; Ito, T.; Kawahara, J.; Kiyomi, M.; Okamoto, Y.; Saitoh, T.; Suzuki, A.; Uchizawa, K.; Uno, T. Swapping labeled tokens on graphs. Theor. Comput. Sci. 2015, 586, 81–94. [Google Scholar] [CrossRef]
  20. Cayley, A. LXXVII. Note on the theory of permutations. Lond. Edinb. Dublin Philos. Mag. J. Sci. 1849, 34, 527–529. [Google Scholar] [CrossRef]
Figure 1. A broom with star leaf vertices v 1 , v 2 , and v 3 , center v 4 and path vertices v 5 , v 6 , and v 7 . All markers except 7 are un-homed.
Figure 1. A broom with star leaf vertices v 1 , v 2 , and v 3 , center v 4 and path vertices v 5 , v 6 , and v 7 . All markers except 7 are un-homed.
Mathematics 12 02620 g001
Figure 2. Illustration of A * . (a) Homing P m a x = 6 , swaps = 3. (b) Homing the star leaf marker 2 followed by 3, swaps = 2. (c) Homing P m a x = 5 followed by 1, swaps = 2, (d) sorted broom. Total number of swaps = 7.
Figure 2. Illustration of A * . (a) Homing P m a x = 6 , swaps = 3. (b) Homing the star leaf marker 2 followed by 3, swaps = 2. (c) Homing P m a x = 5 followed by 1, swaps = 2, (d) sorted broom. Total number of swaps = 7.
Mathematics 12 02620 g002
Figure 3. A 2 b r o o m with left star leaf vertices v 1 , v 2 , and v 3 , path vertices v 4 , v 5 , v 6 , v 7 , and v 8 and right star leaf vertices v 9 , v 10 , and , v 11 . All markers except 11 are un-homed.
Figure 3. A 2 b r o o m with left star leaf vertices v 1 , v 2 , and v 3 , path vertices v 4 , v 5 , v 6 , v 7 , and v 8 and right star leaf vertices v 9 , v 10 , and , v 11 . All markers except 11 are un-homed.
Mathematics 12 02620 g003
Figure 4. Illustration of A n * . (a) Solving the independent b r o o m (star) formed by { v 1 , v 2 , v 3 , v 4 } , swaps = 3. (b) Homing the star leaf marker 10 and moving the markers 14 and 16 to the path, swaps = 3. (c) Homing the maximum clear path marker 5 followed by 11, swaps = 5. (d) Homing the maximum clear path marker 8, swaps = 5. (e) Homing the maximum clear path marker 6 followed by 14 and 16, swaps = 6. (f) Sorted 3 b r o o m .
Figure 4. Illustration of A n * . (a) Solving the independent b r o o m (star) formed by { v 1 , v 2 , v 3 , v 4 } , swaps = 3. (b) Homing the star leaf marker 10 and moving the markers 14 and 16 to the path, swaps = 3. (c) Homing the maximum clear path marker 5 followed by 11, swaps = 5. (d) Homing the maximum clear path marker 8, swaps = 5. (e) Homing the maximum clear path marker 6 followed by 14 and 16, swaps = 6. (f) Sorted 3 b r o o m .
Mathematics 12 02620 g004
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Rajesh, R.; Sundaravaradhan, R.; Chitturi, B. Sorting Permutations on an nBroom. Mathematics 2024, 12, 2620. https://doi.org/10.3390/math12172620

AMA Style

Rajesh R, Sundaravaradhan R, Chitturi B. Sorting Permutations on an nBroom. Mathematics. 2024; 12(17):2620. https://doi.org/10.3390/math12172620

Chicago/Turabian Style

Rajesh, Ranjith, Rajan Sundaravaradhan, and Bhadrachalam Chitturi. 2024. "Sorting Permutations on an nBroom" Mathematics 12, no. 17: 2620. https://doi.org/10.3390/math12172620

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop