We proposed a new framework to measure the similarity of topological structure between complex trajectories. There are three steps in the framework. A complex trajectory is first represented by a graph structure which consists of nodes and edges. Secondly, we developed a Comprehensive Structure Matching (CSM) algorithm to identify all common structures between the complex trajectories of interest. Thirdly, we used the Jaccard similarity coefficient to evaluate the similarity between two complex trajectories. We used synthetic graph data to evaluate the CSM method and examine its performance by comparing against that of the VF2 and the exact graph edit distance (EGED) algorithms. Results show that the CSM algorithm outperforms the EGED in terms of the computation efficiency. The CSM is more comprehensive than the VF2 algorithm as it further considers the partial isomorphism. We used the CSM algorithm to examine the 1993 to 2012 complex trajectories of anticyclonic eddies in the South China Sea (SCS). The CSM successfully found the complex trajectories that are similar to a thoroughly-studied ACE3 trajectory in the SCS. From the similar trajectories, we identified a dominant migrating path of the ocean eddies in the northern SCS. The CSM also successfully identified some new complex trajectories that propagated across the 18°N parallel in the SCS, which were not reported before. It also further identified multiple common structure models of the complex trajectories. These findings help us better understand the behaviors and the evolution of the mesoscale eddies in the SCS.