Data collection with mobile agent (MA) can balance the energy consumption of nodes in partitioned wireless sensor networks. However, the existing data collection algorithms for partitioned WSNs do not formalize the problem systematically. These algorithms are not efficient and difficult to meet the timeliness requirement. In order to solve the above shortcomings, we first formalize the Data Collection Problem (DCP). Then, it is transformed into a Generalized Traveling Salesman Problem (GTSP), and we propose a GTSP-Based data collection Algorithm (GBA) to calculate the rendezvous points (RPs) and the moving path of MA. GBA selects RPs by solving the GTSP problem. Furthermore, based on GBA, we take advantage of constructing convex hull to plan a more efficient moving path for MA. In addition, in order to reduce the energy burden on the RPs, we design an Improved Shortest Path tree (ISP tree) to aggregate data from nodes to RPs in partitioned WSNs. Finally, extensive simulations demonstrate the effectiveness and advantages of our algorithm in terms of the length of MA’s moving path and the amount of data collection per unit time.