The culture of sharing instead of ownership is sharply increasing in individuals behaviors. Particularly in transportation, concepts of sharing a ride in either carpooling or ridesharing have been recently adopted. An efficient optimization approach to match passengers in real-time is the core of any ridesharing system. In this paper, we model ridesharing as an online matching problem on general graphs such that passengers do not drive private cars and use shared taxis. We propose an optimization algorithm to solve it. The outlined algorithm calculates the optimal waiting time when a passenger arrives. This leads to a matching with minimal overall overheads while maximizing the number of partnerships. To evaluate the behavior of our algorithm, we used NYC taxi real-life data set. Results represent a substantial reduction in overall overheads.
The increasing ubiquity of mobile handheld devices paved the way for the dynamic ridesharing which could save travel cost and reduce the environmental pollution. The ridematching problem with time windows in dynamic ridesharing considers matching drivers and riders with similar routes (with drivers detour flexibility) and time schedules on short notice. This problem is hard to solve. In this work, we model the ridematching problem with time windows in dynamic ridesharing as an optimization problem and propose a genetic algorithm to solve it. We consider minimizing the total travel distance and time of the drivers (vehicles) and the total travel time of the riders and maximizing the number of the matches. In addition, we provide datasets for the ridematching problem, derived from a real world travel survey for northeastern Illinois, to test the proposed algorithm. Experimentation results indicate that the idea of dynamic ridesharing is feasible and the proposed algorithm is able to solve the ridematching problem with time windows in reasonable time.