Graphical time warping (GTW) is a framework for jointly aligning multiple pairs of time series or sequences. GTW considers both the alignment accuracy of each sequence pair and the similarity among pairs. On contrary, alignment with dynamic time warping (DTW) considers the pairs independently and minimizes only the distance between the two sequences in a given pair. Therefore, GTW generalizes DTW and could achieve a better alignment performance when similarity among pairs is expected. One application of GTW is signal propagation analysis in time-lapse bio-imaging data, where the propagation patterns in adjacent pixels are generally similar. Other applications include signature identification, binocular stereo depth calculation, and liquid chromatography–mass spectrometry (LC-MS) profile alignment in proteomics data analysis. Indeed, as long as the data are structured with inter-dependent time series/sequences, they can be analyzed with GTW. GTW is able to model constraints or similarities between warping paths by transforming the DTW-equivalent shortest path problem to the maximum flow problem in the dual graph, which can be solved by most max-flow algorithms. However, when the data is large, these algorithms become time-consuming and the memory usage is high. An efficient algorithm, Bidirectional pushing with Linear Component Operations (BILCO), was developed to solve the GTW problem. It could achieve an average 10-fold improvement in both computational and memory usage compared with the state of art generic maximum flow algorithms in GTW applications.
Joint alignment and GTW formulation
Joint alignment Assume there are N pairs of time series {(xn,yn)|n=1,2,...,N}, and each pair xn,yn has a corresponding warping path Pn. Some pairs of warping paths are known to be similar, and the set of all such pairs is denoted as (m,n). For example, if (m,n) is in this set, warping paths Pm and Pn are similar. To optimize both the similarity between the aligned time series and the warping paths distances, the joint alignment problem is formulated as a minimization problem: min{Pn|n=1,2,...,N}(∑n=1Ncost(Pn)+κ∑(m,n)∈Neibdist(Pm,Pn)) Here cost(Pn) denotes the distance between xn and yn after alignment with warping function Pn, dist(Pm,Pn) is the distance between warping paths Pm and Pn defined by the area of the region bounded by Pm and Pn, and κ is a hyperparameter balancing the time series alignment cost term and warping function distance term. Notice that the similarity strength can be application-specific or user-designed. For different related warping paths pair (m,n), we can set different parameters κ(m,n). For simplicity, here we use the unified hyperparameter κ. The above minimization problem is intuitively formulated. However, it is not clear how to efficiently solve it in its original form, and a naïve enumeration of the warping paths leads to an NP-hard problem.
GTW formulation
This minimization problem can be reformulated into a minimum cut problem on a special graph termed GTW graph, where the minimum cut and the warping paths are equivalent. The formulation could be described as:
For the nth time-series pair, construct its DTW graph. Then convert this DTW graph to its dual graph, termed as GTW subgraph Gn. Set the capacities of reverse edges to be infinite. For each pair of similar warping paths Pm and Pn, linking the nodes of the same position in Gm and Gn by bidirected edges with capacity κ/2. Such edges are termed as cross edges. The constructed GTW graph, as shown in the figure, consists of N GTW subgraphs and cross edges. Using maximum flow algorithms to obtain the minimum cut of the constructed graph. The minimum cut within each GTW subgraph corresponds to one warping path.
Explanation of the equivalence Each GTW subgraph Gn is the dual graph of the DTW graph representing the alignment of a single time-series pair. As a result, the cut within a GTW subgraph is dual to a warping path in DTW graph, and the profile alignment cost term can be represented by the cut cost within subgraphs. The infinite capacities of reverse edges are used to guarantee the monotonicity and continuity of warping paths. Cross edges constrain the similarity of warping paths and contribute to the distance term in the objective function. Notice that in a minimum cut problem, the nodes would eventually be assigned to the source side or the sink side, and the final cut is defined by the edges between two sides. Each pair of mismatched nodes in Gm and Gn contribute to the distance between Pm and Pn and would result in an extra κ/2 cost. Thus, the distance term could be represented by the cut cost in cross edges. Therefore, the cut cost in the GTW graph corresponds to the cost terms in the objective function. Recalling the fact that the cut within each subgraph corresponds to the warping path of one time-series pair, the minimum cut of GTW graph corresponds to the optimal solution of warping paths in the joint alignment.
Extension
Neighbor-wise Compound-specific Graphical Time Warping (ncGTW) In multiple sequence alignment, the purpose is to align all sequences to a common reference. However, this common reference is usually unknown. In addition, there is also structural information among the sequences. Though GTW cannot be directly applied in these applications, a two-stage framework called ncGTW was built upon GTW to solve this problem. In the first stage, the prior structural knowledge among the sequences is utilized to obtain the warping functions. In the second stage, these warping functions help to jointly align all sequences to a virtual reference, which does not need to be explicitly specified. ncGTW was applied to LC-MS profile alignment problems in proteomics data and performed better than existing approaches.
Efficient algorithm
Bidirectional pushing with Linear Component Operations (BILCO) Solving the minimum cut problem on GTW graph through traditional maximum flow algorithms would take a long running time and large memory usage due to the large graph size, which limits the usage of GTW. BILCO algorithm utilizes two important properties of the joint alignment problem and achieves an average 10-fold improvement in both running time and memory usage. The two properties are:
… excerpt ends here. Continue reading the full article.

