Abstract-An increasing number of wearable and mobile devices are capable of automatically sensing and recording rich information about the surrounding environment. To make use of such data, it is desirable for each data point to be matched with its corresponding spatial location. We focus on using the trajectory from a device's odometry sensors that reveal changes in motion over time. Our goal is to recover the route traversed, which we will define as a sequence of revisitable positions. Dead reckoning, which computes the device's route from its odometry trajectory, is known to suffer from significant drift over time. We aim to overcome drift errors by reshaping the odometry trajectory to fit the constraints of a given topological map and sensor noise model. Prior works use iterative search algorithms that are susceptible to local maximas [15], which means that they can be misled when faced with ambiguous decisions. In contrast, our algorithm is able to find the set of all routes within the given constraints. This also reveals if there are multiple routes that are similarly likely. We can then rank them and select the optimal route that is most likely to be the actual route. We also show that the algorithm can be extended to recover routes even in the presence of topological map errors. We evaluate our algorithm by recovering all routes traversed by a wheeled robot covering over 9 kilometers from its odometry sensor data.