How to Solve House and Neighbour Logic Puzzles
This article was written with AI and may contain mistakes. Found one? Tell us.
To solve a house-and-neighbour puzzle, draw the row of houses as a strip of boxes, write in every clue that fixes a position, and then treat each left, right or next-to clue as a small tile that can only slide into a few places. When a tile has two possible places, test each one against the other clues, and the place that causes a clash is crossed out.
This guide covers the strip, the six kinds of clue, a step-by-step method, a full worked puzzle, a practice puzzle with its answer and the grid mathematics hiding under this whole group of puzzles.
What is a house-and-neighbour puzzle?
It is a deduction puzzle set along a street. A short row of houses stands side by side, numbered from left to right. Each house has exactly one colour, one owner role, such as painter or gardener, and one item, such as a lamp or a clock. No colour, role or item is used twice.
The clues describe the row. Some say where one thing is. Others say that two things share a house, or that one house stands directly left of another, or next to it. Your job is to rebuild the whole row so that every clue is true.
What sets these puzzles apart is position. In a plain matching puzzle the people could stand in any order. Here, order matters, because a clue like next to only makes sense in a line.
How do you set out the street?
Draw one box for each house in a row, left to right, and number them. Under each box leave three short lines, one for colour, one for role and one for item. That strip is your whole working space.
Beside it, keep a small list of loose pairs: facts that link two things without fixing their house yet. If the clock is in the blue house, write clock and blue together as one tile. You will drop that tile into the strip later, once you know where blue goes.
This way of working is different from a large tick-and-cross table. You are not marking every pairing. You are moving a few tiles along a short street until only one layout fits.
Which kinds of clue appear, and what does each one tell you?
Almost every clue in these puzzles belongs to one of six kinds. Learn to sort them before you start, because each kind is used in its own way.
| Clue kind | Example wording | How to use it |
|---|---|---|
| Fixed place | The green house is at the right end | Write it straight into the strip |
| Same house | The carpenter keeps the vase | Make a two-part tile and keep it together |
| Directly left or right | The red house is directly left of the yellow house | A two-box tile; list every place it can sit |
| Next to | The tailor lives next to the carpenter | Like the last kind, but either way round |
| Somewhere left or right | The purple house is somewhere right of the grey house | Rules out an end; check order at the finish |
| Negative | The globe is not at either end | One small cross in the strip |
Fixed places come first because they cost nothing. Same-house tiles come next, because they shrink the number of loose things you need to track. The neighbour clues are where the real work happens.
What is the step-by-step method?
- Draw the strip. One box per house, with three blank lines under each.
- Place the fixed clues. Anything that names a house or an end goes in at once.
- Build the tiles. Join every same-house pair into one tile.
- List where each neighbour tile can sit. A directly-left pair in a short row only has a few starting boxes. Write them all down.
- Look for a box that is already taken. If a tile needs a box that holds something else, that place is gone.
- Split into cases when two places remain. Try the first place, follow it as far as it goes, and see whether it breaks a clue. If it does, the other place is the answer.
- Fill the last gaps. When three of four colours are placed, the fourth goes in the only empty box.
- Read every clue against the finished row. This catches a tile placed one box off.
Step six is the heart of the method. A case split is not a wild guess. You are testing a short list of places, and each test either ends in a clash or survives every clue.
How does the method solve a full puzzle?
Here is an original puzzle with four houses. The colours are red, blue, green and yellow. The owner roles are painter, gardener, tailor and carpenter. The items are a lamp, a clock, a pencil and a vase.
- The green house is at the right end.
- The painter lives in the second house.
- The red house is directly left of the yellow house.
- The clock is in the blue house.
- The tailor lives next to the carpenter.
- The pencil is in the green house.
- The carpenter keeps the vase.
Which house has which colour, role and item? Try it before reading on. A computer check of every possible row confirms that these seven clues leave exactly one answer, and that removing any single clue lets more than one answer through.
Step one: fixed places. Clue one puts green in house four. Clue two puts the painter in house two. Clue six joins the pencil to green, so house four holds the pencil.
Step two: tiles. Clue four gives a blue and clock tile. Clue seven gives a carpenter and vase tile.
Step three: where can the carpenter go? The carpenter has the vase, so the carpenter cannot be in house four, which already has the pencil. The carpenter is not in house two either, because the painter lives there. That leaves house one or house three.
Step four: a case split. Suppose the carpenter is in house one. Clue five puts the tailor next door, and the only neighbour of house one is house two. But house two belongs to the painter, so this case breaks. The carpenter therefore lives in house three, with the vase.
Step five: the tailor and the gardener. The tailor must be next to house three, so in house two or house four. House two is the painter's, so the tailor lives in house four. The gardener is the only role left, and house one is the only empty box, so the gardener lives in house one.
Step six: the colours. Green is in house four, so the red and yellow tile from clue three sits in houses one and two or in houses two and three. Blue takes whichever box is left, house three or house one. Blue holds the clock, but house three already holds the vase. So blue is house one, red is house two and yellow is house three.
Step seven: the last item. The lamp is the only item left, and house two is the only house without one.
| House | Colour | Role | Item |
|---|---|---|---|
| One | Blue | Gardener | Clock |
| Two | Red | Painter | Lamp |
| Three | Yellow | Carpenter | Vase |
| Four | Green | Tailor | Pencil |
Check every clue. Green is at the right end. The painter is in house two. Red stands directly left of yellow. The clock is in the blue house. The tailor and the carpenter are neighbours. The pencil is in the green house. The carpenter has the vase. All seven clues hold.
How many rows does a small street allow before any clue?
A row of four houses can show its four colours in twenty-four different orders. The roles and the items each have twenty-four orders too, so before any clue is read there are more than thirteen thousand possible streets. Seven short clues cut that down to one.
The same multiplication works for any short street of your own: count the orders for one category, then multiply that count by itself once for each extra category. Here is that arithmetic for three, four and five houses.
| Street size | Orders for one category | Possible streets with three categories |
|---|---|---|
| Three houses | Six | Over two hundred |
| Four houses | Twenty-four | Over thirteen thousand |
| Five houses | One hundred and twenty | Over one and a half million |
This is why the order of work matters. Fixed clues and tiles remove huge blocks of options in one stroke, so by the time you reach a case split there are only two or three layouts left to test.
What mathematics sits underneath these puzzles?
A Latin square of order n is an n by n grid filled with n symbols so that each symbol appears exactly once in every row and exactly once in every column [1].
A house puzzle is not a Latin square, but each category in it follows a smaller version of the same one-of-each idea. Draw a small table with houses down the side and colours across the top, and put a mark where a colour sits. The finished table has one mark in each row and one in each column, which is what a single symbol does inside a Latin square.
A grid that is only partly filled has its own name. A partial Latin square leaves some cells empty, and no symbol is repeated in any row or column [2]. That is a fair picture of your strip halfway through a solve: some boxes filled, none clashing, the rest still open.
There is also a picture in terms of networks. Put the rows of an n by n grid on one side and the columns on the other, and draw a line from every row to every column, so each line stands for one cell [2]. Colouring those lines with n colours so that no two lines meeting at the same point share a colour gives exactly a Latin square [2].
How many truly different Latin squares are there?
Many Latin squares are the same square in disguise. Two of them are put in the same isotopy class when one can be turned into the other by reordering the rows, the columns or the symbols [1].
A paper published on 1 March 2013 lists the class counts for small sizes [1]. Two squares lie in the same transposition class when one can be turned into the other by reordering rows, columns or symbols, by flipping the grid along its diagonal, or by both [1]. Squares linked by those reorderings, by swapping the roles of rows, columns and symbols, or by both lie in the same main class [1].
Among four by four squares there are only two transposition classes [1]. For six by six squares the same paper gives twelve main classes and twenty-two isotopy classes [1]. For eight by eight squares there are 1,676,267 isotopy classes, and the authors ran a computer program over a representative of each one [1].
What are the most common mistakes?
- Reading next to as directly left of. Next to allows both sides. Directly left of allows only one.
- Sliding a tile off the end. A two-box tile in a four-house row has only three starting places. Count them.
- Breaking a tile. Once the clock is joined to blue, they move together. Never place one without the other.
- Forgetting somewhere-right clues. A clue that says purple is somewhere right of grey also says grey is not at the right end and purple is not at the left end. Mark both.
- Skipping the final read-through. One tile placed a box too far can satisfy most clues and still be wrong.
What should you do when you get stuck?
- Pick the tile with the fewest possible places and test each place in turn.
- Look at the ends of the street. End houses have only one neighbour, so next-to clues there are much stronger.
- Ask which category has the most boxes already filled. The last one or two items in it are often forced.
- Write each case on a separate copy of the strip, so one test does not smudge the other.
Can you solve this practice puzzle?
Four houses stand in a row, numbered one to four from left to right. The colours are orange, white, grey and purple. The owner roles are pilot, weaver, builder and joiner. The items are a bucket, a globe, a ladder and a fan.
- The weaver lives directly right of the orange house.
- The purple house is somewhere right of the grey house.
- The ladder is in the grey house.
- The joiner lives at one end of the row.
- The fan is next to the ladder.
- The pilot keeps the bucket.
- The globe is not at either end.
- The builder lives next to the joiner.
- The joiner keeps the fan.
Which house has which colour, role and item? Draw the strip and try it before reading the answer.
Answer: House one is orange, with the pilot and the bucket. House two is white, with the weaver and the globe. House three is grey, with the builder and the ladder. House four is purple, with the joiner and the fan.
Why: The joiner and the fan form one tile at an end of the row. Suppose that tile sat in house one. Then the ladder and grey would be in house two, and the builder too.
Next, the weaver would need to be directly right of orange, which pushes orange to house three and the weaver to house four. The pilot and the bucket would land in house three, leaving the globe at the right end, which breaks clue seven.
So the joiner and the fan are in house four. The ladder, grey and the builder go to house three, and purple must be right of grey, so purple is house four. The weaver can only be in house two, with orange in house one. The pilot and the bucket take house one, the globe takes house two, and white is the last colour.
If you enjoyed fitting one-of-each pieces together, try a small matching riddle next: three people, three fruits and two clues, solved by the same habit of joining what must go together.
References
- Abel, R. J. R., Cavenagh, N. J., & Kuhl, J. (2013, March 1). Induced Subarrays of Latin Squares Without Repeated Symbols. The Electronic Journal of Combinatorics, 20(1), P44. DOI 10.37236/2372
- Cutler, J., & Öhman, L.-D. (2006, May 12). Latin Squares with Forbidden Entries. The Electronic Journal of Combinatorics, 13(1), R47. DOI 10.37236/1073