The correct construction should be "riding to walking," which maintains proper parallelism in the comparison. The structure of the sentence requires two infinitive forms to compare the activities of riding and walking. "To walk" should be parallel with "to riding," hence the correct option is "riding to walking."