The events in this episode take place before 6 April 1874 (from the resignation letter read by President Grant at the end).
The plot of an ambitious army general seeking to make a name for himself in the Indian Wars, in order to run for President, seems to be modeled after George Armstrong Custer.