Comment by miningape
Not sure what the technical terms are but there's 2 phases -
1. Placing the queens, this is a pretty basic DFS over all possible queen positions. You can visualise it by going across the board row by row and placing the queen in a random available column, then moving to the next row and placing a queen in a random available column. So for an 8x8 board with 8 queens, the 1st row has 8 possible columns, the second row has 5 possible columns, the third has 4, and so on until all the queens have been placed or there are no available cells to place the next queen on.
2. Generating the colours - This is a bit more complicated but it is essentially a flood fill with each queen as a source block. I keep an adjacency list for each colour containing the uncoloured cells it borders. At each iteration I pick a random queen/colour and a random cell from the adjacency list, then fill that cell and update the adjacency list (and remove the cell from other adjacency lists).
I'm planning on updating my colour generation algorithm to support 2 things: 1. Generating boards with unique solutions only (not sure how I'll do this without finding all the solutions). And 2. including known shapes in the generation process so there is a random chance colours takes on specific shapes (e.g. +) and the other colours will generate around them.