Solution of the Train Platforming Problem