A Cooperative Game-Theoretic Approach to the Social Ridesharing Problem