Discrete element simulations were used to study the segregation behaviour in a bed of bidisperse granules in a rotating drum. In the final state the large particles ended up in the upper part of the bed near the vertical walls. In order to arrive at this state, the system went through two cycles of structural changes, on top of which fast oscillations were observed between an axially segregated and a somewhat more mixed state. These oscillations were sustained by different angles of repose near the vertical walls and in the middle of the bed. Concomitantly with the structural changes, the system's energy dissipation went through two cycles after which it settled in the state requiring the least work of all traversed states, suggesting that the granular bed strives for minimal dissipation.