Sunday Times Teaser 3142 – Mrs Hyde’s Garden Design Tips
by Colin Vout
Published Sunday December 11 2022 (link)
I’m planting four differently-coloured plots in a line. Mrs Hyde’s design principles classify eight colours into five categories. Adjacent plots mustn’t have the same category, or even certain pairs of categories.
“Every scheme you’ve suggested has at least one adjacent pair of categories that breaks my rules”, said Mrs Hyde. “White, Green, Yellow, White has Honest and Social adjacent; Blue, Orange, Pink, Violet has Ardent and Social adjacent; Green, Violet, Blue, Orange has Ardent and Honest adjacent; Violet, White, Orange, Red has Droll and Honest adjacent; and White, Violet, Green, Blue has Jolly and Social adjacent. However, if you change one colour in one of your suggestions then it will work.”
What are the four colours in order in the changed suggestion that would be allowable?
Following Jim Randell’s faster approach on his S2T2 site here and using his Python wrapper for MiniZinc:
Based on Brian’s solution but using a recursive function to assign categories to colours.
It may be faster.