Minimal path decomposition of complete bipartite graphs

This paper deals with the subject of minimal path decomposition of complete bipartite graphs. A path decomposition of a graph is a decomposition of it into simple paths such that every edge appears in exactly one path. If the number of paths is the minimum possible, the path decomposition is called minimal. Algorithms that derive such decompositions are presented, along with their proof of correctness, for the three out of the four possible cases of a complete bipartite graph.


Introduction
A path decomposition of a graph is a decomposition of it into paths such that every edge appears in exactly one path. If the number of paths is the minimum possible, the path decomposition is called minimal.
A complete bipartite graph is a graph with its nodes partitioned in two sets, such that no edge that connects nodes of the same set exists in the graph, and all edges that connect nodes of the two sets exist in the graph.
In this paper, the subject of minimal path decomposition of complete bipartite graphs is investigated. The complete bipartite graphs are split into four cases that cover every possible instance of them. Algorithms that provide the actual paths of a B Costas K. Constantinou constantinou.k.costas@ucy.ac.cy Georgios Ellinas gellinas@ucy.ac.cy minimal path decomposition are presented for the three out of the four possible cases. A proof of correctness is also given for the presented algorithms.
To the best of our knowledge, no algorithms can be found in the literature that provide minimal path decomposition of complete bipartite graphs. Relevant work can be found in Alspach (2008), Bryant (2010) where the cases of complete graphs of even, odd order respectively are investigated. The subject of decomposing a graph into paths of certain length is investigated in Parker (1998), Truszczyski (1985), Zhai and Lu (2006). Work that is concentrated on the theoretical analysis of the subject of path decomposition can be found, among others, in Haggkvist and Johansson (2004), Thomassen (2008a), Thomassen (2008b), Heinrich (1992), Dean and Kouider (2000), Tarsi (1983), Lovasz (1968), Fan (2005), Pyber (1996), Harding and McGuinness (2014), Donald (1980). The remaining of the paper consists of the following sections: The necessary notation and definitions are given in Sect. 2, and the general framework that is applied for the derivation of the proposed algorithms is presented in Sect. 3. The proposed algorithms are presented in Sect. 4. The conclusions and ongoing research are given in Sect. 5.

Preliminaries
The graphs considered in the current paper are undirected, connected, without multiple edges between the same pair of nodes and without self-loops (i.e., without edges that connect a node to itself). The notation G = (V, E) stands for a graph with the aforementioned characteristics, consisting of n = |V | nodes and m = |E| edges. The notation x ↔ y represents the (undirected) edge that connects nodes x and y. The nodes are labeled with the numbers 1 to n. The difference between the labels of two nodes x and y is defined as |x − y|. Two edges x ↔ y, x ↔ y are identical if x = x and y = y , or if x = y and y = x . For this case, obviously, |x − y| = |x − y |.
By the notation simple path we mean a path where each node appears at most once. The Path Decomposition (PD) of a graph consists of a set of simple paths (PD-paths) that are edge-disjoint and every graph edge appears in exactly one of them. If the number of these paths is the minimum possible, the decomposition is called Minimal PD (MPD), and the corresponding paths are called MPD-paths.
For the derivation of the MPD-paths, a Path Matrix (PM) is created. The elements of this matrix are the graph nodes. Therefore, the notions element and node are used interchangeably throughout the paper. The position (or place) of the element found in the ith row and jth column of the PM is denoted by . If the two ending nodes of the path found in the ith row are the first and last element of this row, then we say that this path consists of the complete row i. For complete bipartite graphs, set V is split in two sets V 1 , V 2 such that V 1 ∪V 2 = V , V 1 ∩V 2 = ∅, |V 1 | = n 1 , |V 2 | = n 2 , (therefore n 1 +n 2 = n). Without loss of generality, throughout the paper it is assumed that n 2 ≤ n 1 . Set E consists of all edges x ↔ y such that x ∈ V 1 and y ∈ V 2 . Nodes of set V 1 are labeled with the numbers from 1 to n 1 , and nodes of set V 2 with the numbers from n 1 + 1 to n. The complete bipartite graph, using the aforementioned notation, is denoted by K n 1 ,n 2 . It can be easily verified that every possible instance of a complete bipartite graph belongs in one of the four cases presented in Table 1.

General framework
The proposed algorithms that are presented in Sect. 4 are derived using the general framework presented here. The derived paths must have the following properties in order to constitute an MPD: Necessity of property A is obvious, since the solution must consist of simple paths. Property B states that no edge is used more than once. Property C (under the validity of property B) states that the solution includes all the edges. If properties A-C are valid, then the solution constitutes a PD. For MPD, property D must be valid as well.

Steps of the general framework
(i) Create the PM. (ii) Locate the part of the PM that must be manipulated, and derive the corresponding PD.
(iii) Verify that properties A-C are valid for the derived PD.
(iv) If property D is not valid for the derived PD, modify the paths of the latter in order to derive an MPD, while preserving the validity of properties A-C.
The steps of the general framework are detailed and easily understood in the following section, where the proposed algorithms are presented. 4 Proposed algorithms 4.1 Complete bipartite graphs K n 1 ,n 2 with even n 1 , even n 2 and n 1 = n 2 Consider the case of the complete bipartite graph K n 1 ,n 2 where n 1 and n 2 are even, and n 1 = n 2 = n 2 (i.e., K n 1 ,n 2 = K n 2 , n 2 ). Obviously, for this case, n ≥ 4. The graph consists of n 1 · n 2 = n 2 4 edges. The application of the general framework is as follows.
Step GM-I The PM is created using the proposed Algorithm 1. Algorithm 1 creates a PM consisting of n 2 rows and n columns (shown in Table 2).
Algorithm 1 K n 1 ,n 2 with even n 1 , even n 2 and n 1 = n 2 1. Create row 1 of the PM: (a) Place nodes 1, . . . , n 2 in odd cells, sequentially, in increasing order (b) Place nodes ( n 2 + 1), . . . , n in even cells, sequentially, in decreasing order 2. Create rows 2 to n 2 of the PM. Create each row from the previous one, by adding one to the label of each node. For each cell of the row under creation: (a) If it belongs to an odd column and the resulting label is greater than n 2 , subtract n 2 from the label (b) If it belongs to an even column and the resulting label is greater than n, subtract n 2 from the label

Derivation of cell content from cell coordinates
Note that the odd (even) cells of row 1 (steps 1a and 1b of Algorithm 1) are the ones described by Since the labels for each upcoming row are increased by one compared to the previous row, and number n 2 is subtracted if the resulting label is, for odd k, larger than n 2 , and for even k, larger than n, the general equations for row i, 1 ≤ i ≤ n 2 are as follows: -For odd k, -For even k,  . . .
Step GM-II The following part of the PM is selected for the derivation of the PD-paths: 1. Each of the paths i, 1 ≤ i ≤ n 4 , consists of the complete row i. 2. Each of the paths i, n 4 + 1 ≤ i ≤ n 2 , consists of a single edge, that is, the edge Step GM-III Here, it is verified that properties A-C are valid for the derived PDpaths.

Proposition 1 Property A is valid.
Proof If this property is valid for the whole PM, it is valid for the derived PD-paths. To prove that it is valid for the whole PM, it is sufficient to show that each row does not have the same node more than once. This is proven using mathematical induction: 1. Prove that it is true for the first row: This is trivial, as it is an immediate result of the way the first row was created. 2. Assume that it is true for the ith row. 3. Prove that it is true for the (i + 1)th row: Let v 1 , v 2 represent two nodes on the ith row (v 1 = v 2 ) and v 1 , v 2 represent the corresponding nodes on the (i + 1)th row (i.e., the ones that belong to the same columns as v 1 , v 2 ). The following cases can occur: v 1 belongs to an odd column and v 2 to an even column: 1 ≤ v 1 ≤ n 2 and n 2 + 1 ≤ v 2 ≤ n ⇒ v 1 = v 2 -v 1 belongs to an even column and v 2 to an odd column: , v 2 belong to odd (or even) columns. Then, both v 1 , v 2 belong to odd (or even) columns and The following cases are possible: and If Eqs. 5 and 7 (or 6 and 8) are valid, If Eqs. 5 and 8 are valid, If Eqs. 6 and 7 are valid, To prove that property B is valid, Proposition 2 is used.
Proposition 2 All the nodes of a column (of the whole PM) are unique.
Proof Consider that for an odd (or even) column the nodes from 1 to n 2 (or from n 2 + 1 to n) are arranged circularly, in increasing order according to their labels, and node 1 (or n 2 + 1) is found after node n 2 (or n). Then, the creation of a column can be seen as the selection of n 2 sequential nodes found on the aforementioned circle. Regardless the first node of a column, since the number of elements in the column is equal to the number of elements in the circle, all the selected nodes are unique. Therefore, all the nodes of a column are unique.

Proposition 3 Property B is valid.
Proof First it is proven that property B is valid for the paths i, 1 ≤ i ≤ n 4 , i.e., for the upper half of the derived PM.
Consider that we have the edges e = a ↔ b, e = a ↔ b . The possible cases of them can be found in Table 3, as derived by Eqs. 1-4. These edges will have either a = a or a = a. If a = a, obviously e = e. If a = a, according to Propositions 1 and 2, nodes a, a belong to different rows and columns, i.e., i = i and k = k for the contents of Table 3.
In Table 3: -1 ≤ k, k ≤ n − 1, since columns k + 1, k + 1 can take values up to n, according to the way the PM is created. -For cases with |a − b| = 3n 2 − k, since |a − b| ≤ n − 1, For equality of the two edges e, e , apart from a = a, |a − b| must be equal to |a − b |. Consequently, the cases where |a − b| = n − k and |a − b | = n − k , or |a − b| = 3n 2 − k and |a − b | = 3n 2 − k are omitted, since for them |a − b| = |a − b |, due to the fact that k = k . The rest of the cases are investigated as follows: To prove that b = b , we assume that b = b and from it we derive a non-valid result: The last result is not valid: Therefore, b = b and, consequently, e = e . -Case 1a-2c To prove that b = b , we assume that b = b and from it we derive a non-valid result: ⇒ n = 4(i − i) As previously, the last result is not valid. Therefore, b = b and, consequently, e = e . -Case 1a-2f (13) To prove that b = b , we assume that b = b and from it we derive a non-valid result: As previously, the last result is not valid. Therefore, b = b and, consequently, e = e . -Case 1a-2g (14) To prove that b = b , we assume that b = b and from it we derive a non-valid result: As previously, the last result is not valid. Therefore, b = b and, consequently, e = e .
For brevity, the investigation of the rest of the cases is omitted; it can be easily verified that, using the aforementioned framework, Proposition 3 is valid for them as well.
Subsequently, Proposition 3 has been proven for the PD-paths found in the upper half of the PM, i.e., for 1 ≤ i ≤ n 4 and 1 ≤ k ≤ n (result 3a). For the PD-paths found in the lower half (each one consisting of a single edge), i.e., for n 4 + 1 ≤ i ≤ n 2 and k = n 2 : k is even, therefore either Eqs. 3 or 4 is valid. The one that is valid is Eq. 4 since, k + 1 is odd, therefore either Eqs. 1 or 2 is valid. The one that is valid is equation 2 since, Therefore, the single edges e = |a − b| that constitute the paths i, n 4 + 1 ≤ i ≤ n 2 are as follows: Consequently, |a − b| = n 2 . According to Table 3, the edges e = a ↔ b = [i][k ] ↔ [i][k + 1] to be checked whether they are equal to a ↔ b can have: This is not possible, since for e = e, a must be equal to a, and, according to Proposition 2, for k = k, a = a.
The aforementioned analysis has proven that the edges e = |a − b| that constitute the paths i, n 4 + 1 ≤ i ≤ n 2 , do not exist anywhere else in the PM (result 3b). Results 3a, b constitute the proof of Proposition 3

Proposition 4 Property C is valid.
Proof According to Step GM-II 1. Each of the paths i, 1 ≤ i ≤ n 4 , consists of n − 1 edges. 2. Each of the paths i, n 4 + 1 ≤ i ≤ n 2 , consists of one edge. Therefore, the PD consists of n 4 · (n − 1) + n 4 · 1 = n 2 4 = m edges.
Since the number of the derived PD-paths is larger than the minimum possible, we modify the PD as follows, in order to derive an MPD from it.

Derivation of MPD from the derived PD
-Path 1 of the MPD is equal to path 1 of the PD.
-Paths of the MPD from 2 to n 4 are derived from the corresponding paths of the PD, neglecting the last edge of each one of them.
-Path ( n 4 + 1) of the MPD consists of the edges of the single-edge paths n 4 + 1 to n 2 of the PD, and of the edges that were removed from the paths 2 to n 4 of the PD. Node in jth position of this path (1 ≤ j ≤ n 2 ) is found in: for even j. In other words, the edges that were removed from paths 2 to n 4 of the PD, are used to connect the edges of the single-edge paths n 4 + 1 to n 2 of the PD (in increasing order according to the row they belong), so as to construct a single path (i.e., path ( n 4 + 1) of MPD) from them. More precisely, paths i and i + 1 of the PD ( n 4 + 1 ≤ i ≤ n 2 − 1), consist of the following edges, according to Eqs. 2 and 4: , 2 ≤ i ≤ n 4 (which has been removed from path i of the PD) can be used to connect the aforementioned edges (i = i − n 4 + 1): Under this transformation, it is obvious that properties A-C are still valid. Property D is also valid, since the number of MPD-paths is equal to n 4 + 1, i.e., the minimum possible according to Eq. 17.
The following part presents an example of the proposed procedure. The PM as derived by Algorithm 1 is presented, as well as the derived 8 The PM as derived by Algorithm 1 is given in Tables 4 and 5 gives the derived MPDpaths. K 8,8 consists of 64 edges, and this is exactly the number of edges found in Table  5. According to equation 17, the minimum number of decomposition paths is 5, equal to the number of MPD-paths found in Table 5.

Complete Bipartite
Graphs K n 1 ,n 2 with Even n 1 and 1 ≤ n 2 ≤ n 1 − 1 Consider the case of the complete bipartite graph K n 1 ,n 2 where n 1 is even and 1 ≤ n 2 ≤ n 1 − 1 (with n 2 either odd or even). Therefore, n = n 1 + n 2 ≥ 3. The graph consists of n 1 · n 2 edges. The application of the general framework is as follows: Step GM-I: The PM is created using Algorithm 2. It consists of n 1 2 rows and 2n 2 +1 columns.  Algorithm 2 K n 1 ,n 2 with Even n 1 and 1 ≤ n 2 ≤ n 1 − 1 1. Create row 1 of the PM: (a) Place nodes 1, . . . , (n 2 + 1) in odd cells, sequentially, in increasing order (b) Place nodes (n 1 + 1), . . . , n in even cells, sequentially, in increasing order 2. Create rows 2 to n 1 2 of the PM. For each cell of the row under creation: (a) If it belongs to an odd column, add 2 to the label of the node found in the same column in the previous row; If the resulting label is greater than n 1 , subtract n 1 from it. Place the result in this cell (b) If it belongs to an even column, place the label of the node found in the same column in the previous row

Derivation of cell content from cell coordinates
-For even k, Step GM-II The complete PM is selected for the derivation of the PD. Therefore, the derived PD consists of n 1 2 paths, and path i (1 ≤ i ≤ n 1 2 ) consists of the complete row i.
Step GM-III Here, it is verified that properties A-C are valid for the derived PD.

Proposition 5 Property A is valid.
Proof It is sufficient to show that each row does not have the same node more than once. This is proven using mathematical induction: 1. Prove that it is true for the first row: This is trivial, as it is an immediate result of the way the first row was created. 2. Assume that it is true for the ith row. 3. Prove that it is true for the (i + 1)th row: Let v 1 , v 2 represent two nodes on the ith row (v 1 = v 2 ) and v 1 , v 2 represent the corresponding nodes on the (i + 1)th row (i.e., the ones that belong to the same columns as v 1 , v 2 ). The following cases are possible.
v 1 , v 2 belong to odd columns. The following cases are possible: Proposition 6 Properties B and C are valid.
Proof To prove that properties B and C are valid, it is sufficient to prove that for each node x, (n 1 + 1) ≤ x ≤ n (which, according to Algorithm 2, can be found in even columns) each of the edges x ↔ y, 1 ≤ y ≤ n 1 exists exactly once in the derived PD.
In other words, to prove that for arbitrary even column k, every node z 1 such that z 1 is odd and 1 ≤ z 1 ≤ n 1 − 1, can be found in column k − 1 exactly once, and every node z 2 such that z 2 is even and 2 ≤ z 2 ≤ n 1 , can be found in column k + 1 exactly once (or vice versa). Consider even column k, with odd k 2 . Then the node found in row i and column k − 1 is k 2 + 2i − 2 or k 2 + 2i − 2 − n 1 , according to Eqs. 23 and 24. Since n 1 2 rows exist, this means that every node z 1 such that z 1 is odd and 1 ≤ z 1 ≤ n 1 − 1, can be found in column k − 1 exactly once. The node found in row i and column k + 1 is k 2 + 1 + 2i − 2 or k 2 + 1 + 2i − 2 − n 1 . This means that every node z 2 such that z 2 is even and 2 ≤ z 2 ≤ n 1 , can be found in column k + 1 exactly once. For even k 2 , the opposite analysis holds Step GM-IV Up to this point, the derived solution constitutes a PD. To verify that this is also an MPD, Proposition 7 is proven.

Proposition 7 Property D is valid.
Proof Each path can consist of at most 2n 2 edges. Therefore, the minimum number of paths is n 1 n 2 2n 2 = n 1 2 (26) Since the derived PD consists of exactly n 1 2 paths, property D is valid, i.e., the derived PD is also an MPD.
Note that for n 2 = n 1 (i.e., for the case investigated in Sect. 4.1), Algorithm 2 cannot be applied, since in cell [1][2n 2 + 1] node n 2 + 1 = n 1 + 1 > n 1 → 1 will be placed, i.e., the first path will not be simple since this node will also be placed in cell [1][1]. The same holds for the rest of the rows.
The following part presents illustrative examples.