Cost optimal allocation of rail passenger lines