# A Trajectory Optimisation-Based Incremental Learning Strategy for Learning from Demonstration
## 5 Discussion  
### Time Complexity Analysis  
Time complexity can be used to measure the complexity of an algorithm and serves as a reference when computational resources are limited or real-time performance is required. Compared to trajectory segmentation based on neural networks, the discrete curvature-based method offers a faster computation speed because it does not require the collection of large amounts of data for training. At the same time, the Gaussian distribution, as the most widespread form of data distribution in nature, is used in the roadmap construction process in PRM. The fundamental algorithms involved in this paper are DMP, PRM, and BLS. Gaussian mixture model (GMM), TP-GMM, and RRT have similar functionalities. Analysis of trajectory segmentation algorithms using a CNN as an example [29]. The \(o(\cdot)\) is used to denote the time complexity function. According to the studies on time complexity by [PERSON] et al. [37], [PERSON] et al. [38], and [PERSON] et al. [39], the time complexity of the aforementioned algorithms is qualitatively expressed in Table 3.  
The sorting in Table 3 is based on the time complexity of the algorithms from high to low, with a detailed analysis as follows: the convolution operations and the large  
Figure 19: G-PRM and Bi-DMP results for battery cell removal. (**a**) Generated trajectories via former Bi-DMP. (**b**) The new target point of \(\mathit{Tragen}\) for battery cell removal. (**c**) Generated trajectories via new Bi-DMP.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Algorithms** & **Time Complexity** & **Notes** \\ \hline CNN-based & \(o(\text{N}\text{-}\text{D}\cdot\text{F}^{2}\text{-}\text{-}\text{C}\text{-} \text{L})\) & N: the number of samples, D: the dimension of \\ TP-GMM & \(o(\text{N}\text{-}\text{K}\text{-}\text{D}\cdot\text{I})\) & input data (feature number), F: the size of \\ GMM & \(o(\text{N}\text{-}\text{K}\text{-}\text{D}\cdot\text{I})\) & convolution kernel, C: the number of \\ BLS & \(o(\text{N}\text{-}\text{D}\cdot\text{E})\) & convolution kernels, L: the number of layers, I: \\ DMP & \(o(\text{N}\text{-}\text{D})\) & the number of iterations of \\ RRT & \(o(\text{k}\text{-}\text{log}(\text{k}))\) & expectation–maximisation (EM) algorithm, K: \\  & & the number of Gaussian clusters, k: the number \\ PRM & \(o(\text{n}\text{-}\text{log}(\text{n}))\) & of sampling knots, n: the number of sampling \\  & & points, E: the number of BLS nodes \\ \hline \hline \end{tabular}
\end{table}
Table 3: Time complexity analysis for different algorithms.  
Figure 20: Battery cell removal implementation.  
number of parameters make the time complexity of the CNN the highest, especially in large-scale datasets and deep learning structures. Table 3 lists the time complexity of only a one-layer CNN. In actual computations, the time complexity of all CNN layers in the network must be summed. The time complexity of GMM is influenced by the number of Gaussian clusters [1], the total number and dimensionality of the samples, and the number of iterations of the EM algorithm. When TP is added, the data dimensionality D will increase, making the complexity of TP-GMM slightly higher than that of GMM with the same parameters. The time complexity of the BLS mainly depends on the number of samples, the data dimensionality, and the number of nodes in the BLS. Although the computation of the BLS relies on large-scale matrix operations, its time complexity is lower than that of a CNN. The time complexity of DMP is mainly determined by the number of samples and data dimensionality. The time complexities of PRM and RRT are related to the number of sampling points/knots. Their time complexities are similar, while PRM has an advantage in trajectory generation due to the construction of the roadmap.