What is the algorithm used to reserve ticket in Indian Railways? What algorithm does the Indian Railways use to make sure that no two similar aged people of opposite gender are seated next to each other?