20 Apr
2018
20 Apr
'18
2:45 p.m.
= Henry Baker <hbaker1@pipeline.com> Yes, we could (in theory) simulate every possible permutation,
I think you misread me a little. To clarify: I didn't say "simulate every possible permutation", which would be N! cases, but only "simulate sorting every *rotation*" of the target output permutation, which would only be N cases. Then, when you've pre-determined "offline" which case would be cheapest, you go back and apply the manipulations done in that simulation to the actual train "online". Total cost = N * cost-of-offline-simulated-sort + 1 * cost-of-online-real-sort