# Are circles required on the edge of the grid?

The image below is a puzzle from the FlowFree app:

The image below is my solution to the above puzzle:

The rules stated in the app are:

Drag to connect matching colors with pipe, creating a flow. Pair all colors, and cover the entire board with pipe to solve each puzzle. But watch out, pipes will break if they cross or overlap!

For the example puzzle, there are two colored circles on the edge of the grid (a blue circle and a red circle on the bottom edge).

My question is:

Does there exist a grid (not necessarily square) with a set of colored pairs of circles in the grid such that there are no colored circles on the edge of the grid and there is a unique solution that satisfies the app’s rules?

The below answer is an optimization of Basss answer, it uses 1 color less:

The unique solution is as follows:

Edit (just for fun):
Additionally, if you want to use only 1 color that fill up every corner:

• +1 Wow! Amazingly simple! Commented May 20 at 17:35
• Your 2nd solution with the all green corner coloring reminds me of this Planar Langford sequence. Commented May 21 at 8:52
• @WillOctagonGibson I was hoping to get them all in one line, but then the solution wasnt unique, unfortunately. Commented May 21 at 9:54
• I posted a new related question here: puzzling.stackexchange.com/questions/126848/… Commented May 26 at 5:25

     .   .   .   .   .

.   A   B   A   .

.   C   B   C   .

.   .   .   .   .


with unique solution

     +---------------+
|               |
+---A   B   A---+
|
+---C   B   C---+
|               |
+---------------+


• @Bass OP's "Pair all colors, and cover the entire board with pipe to solve each puzzle." sounds like that requirement to me. As for simpler I'd be curious to see how. Commented May 20 at 6:49
• So it does. And the "much simpler" I had in mind had an alternate solution.
– Bass
Commented May 20 at 6:52
• See first alinea in this answer: puzzling.stackexchange.com/a/47689. As far as I know, immediate turns are not allowed, so this is not a correct solution. There are multiple solutions to just 'connect the dots', only if you want to cover the entire board this is the only solution. I think @Bass second image is the best example there is, to cover the entire board with just connecting the dots. Commented May 20 at 11:53
• @Lezzup One of the general rules mods keep reminding us of is puzzles should be self-contained, so unless it is something well established like chess or a sudoku the rules are what OP says. A link for explanation is not considered enough, much less requiring the solver to find by themselves an obscure post such as the one you are linking. As for this puzzle you seem to prefer different rules but they strike me as a tortured interpretation of what OP is actually writing and are certainly no grounds for calling my answer "incorrect". Commented May 20 at 17:17
• @Lezzup The official rules of the FlowFree app may have changed over time. On my version there is no mention of any restrictions on immediate turns. Commented May 20 at 18:22

(See the answer at the source for spoilers.)

Here's a much less interesting way to see the same thing:

• +1 That seems to work. I wonder if there is a puzzle with a smaller grid or fewer pairs of circles. Commented May 20 at 4:27
• I posted a new related question here: puzzling.stackexchange.com/questions/126848/… Commented May 26 at 5:28

Here's a relatively simple one here that should work:

Solution:

Simple, but I think it should satisfy the requirements.

Starting from the puzzle you provide in the question, you could

extend the grid by one row below the bottom, and a column on each vertical edge

You could then

start by travelling down from the blue and red that you have moved away from the edge, then away from centre, zig-zagging until you reach the other point of the same colour.

As shown in this (atrocious) diagram:

At its simplest, you could have

just one colour, adjacent to each other, surrounded by a single square in each direction (forming a 4x3 grid), then starting at the top-left coloured point, travel left then clockwise around until you get back to the square below the start; where you then join to the other colour

There are infinite variants on such a solution, even with multiple colours

• I would encourage you to post an image of your proposed solution. Commented May 20 at 17:58
• @WillOctagonGibson done! Commented May 21 at 14:05
• Your proposed layouts don't have unique solutions, though. For instance, in your first solution, cells B4 and B5 could be occupied by yellow line instead of blue line; and in your second, the solution could be mirrored around either axis. Commented May 21 at 14:49
• ah, sorry, I missed the requirement for a "unique" solution Commented May 22 at 10:32

This solution is a slight simplification of the nice solution posted by Yout Ried.

Grid:

Solution:

• The empty row in the center could be removed completely , and then it's (almost) the same as Bass answer. Commented May 23 at 4:31
• @Lezzup I see what you mean. I prefer grids where each colored circle is not immediately adjacent to its corresponding circle. Commented May 23 at 4:37
• Seems like an interesting concept. I wonder if with that extra constraint, this answer is the most optimized :) Commented May 23 at 6:43
• @Lezzup I don’t mind a colored circle to be diagonally adjacent to its corresponding circle (like your 1st solution). I just don’t want it to be horizontally or vertically adjacent. I want the paths between colored circles to go through at least one intermediate square. Commented May 23 at 7:35