Post Reply 
Programming puzzles: processing lists!
08-15-2017, 09:36 PM
Post: #184
RE: Programming puzzles: processing lists!
(08-15-2017 09:03 PM)pier4r Wrote:  yeah but while generating a valid match day from another is relatively easy (swap two teams) the point is: was that match day already generated?

But the point to consider is that a single step through the sequence isn't the same thing as simply swapping the position of two list elements. A single lexicographic step will almost certainly involve an entire sequence of operations/comparisons/swaps to move from one valid position to the next one.

One nice thing about doing it this way is that you don't have to consider whether that grouping has come up before -- if the sequence truly has a lexicographic representation (and you can create the algorithm to step through it Smile), then you simply step through each member in order.

As I mentioned before, the trick is in creating a working algorithm that takes you from one valid sequence point to the next. Having 3 (hopefully) good sequences to use as a reference (4/6/8 teams) should provide some clues as to what that "stepping" algorithm needs to do. I believe the chances are good that this problem has a valid stepping algorithm, so the fun of this puzzle (from my perspective) will be to see if I can deduce a working algorithm to facilitate it.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Programming puzzles: processing lists! - DavidM - 08-15-2017 09:36 PM

User(s) browsing this thread: 1 Guest(s)