The theoretically optimal way to board passengers onto a plane has been studied by Jason Steffen in his paper Optimal boarding method for airline passengers. The following YouTube video explains the algorithm and also, briefly touches on why it’s not actually implemented. The math is super elegant, the problem is practical, and gives a bit of an economic design insight (that you don’t always get the theoretical perfect design)

Reference: Steffen’s papers:

Experimental test of airplane boarding methods

Jason H. Steffen, Jon Hotchkiss | Journal of Air Transport Management, 2012. https://doi.org/10.1016/j.jairtraman.2011.10.003

Optimal boarding method for airline passengers

Jason H. Steffen | ArXiv https://doi.org/10.48550/arXiv.0802.0733