The N-Queens comparison only hit me after I'd already gone down a wrong path.
Model the problem as a constraint satisfaction problem and reduce it to bipartite matching or exact cover. Explain how to construct a graph where rows and columns are nodes, and each house imposes constraints on adjacent cells, then find a matching that satisfies all constraints.
Pro tip: Clarify the adjacency definition (4-directional vs 8-directional) and whether flowers can be placed on houses; these details drastically change the solution and show attention to problem specification.
Ask about adjacency (4 or 8 directions), whether flowers can be placed on houses, and if multiple valid solutions are acceptable. Confirm the grid size and input format.
Represent each row and column as nodes in a bipartite graph. For each house, identify the empty cells adjacent to it and create edges representing potential flower placements that satisfy the house's requirement.
Show that the problem is equivalent to finding a matching in a bipartite graph where left nodes are rows and right nodes are columns, with edges for valid flower placements. Alternatively, formulate as an exact cover problem and use Algorithm X.
Propose an algorithm such as Hopcroft-Karp for bipartite matching or backtracking with pruning. Discuss time and space complexity, noting that the problem is NP-hard in general but may be tractable for small N or special cases.
Consider cases with no solution, houses on edges, or multiple houses sharing adjacent cells. Describe how to verify a solution and return it, or indicate impossibility.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.