5
$\begingroup$

Rules

You are given a square grid, with numbers (0-9) in some of its cells. You have to connect some of the numbers, so that each "island" of numbers has the same total sum. A number can have anywhere from 0 to 4 connections that go straight up, down, left or right. Two connections may never intersect.

Some notes:

  • You can't just connect all numbers together, you must have at least 2 "islands" of numbers.
  • The only place a T-intersection may happen is at a number, not in an empty cell.

Solved examples

Here the sum of every group is 3 (note that the lonely 3 is still a valid group)

 1-----1  1
 | 3      |
 1     2--0

Alternate solution

 1-----1--1
   3
 1-----2--0

A bigger example

 1--0--3     5
 |  |        |
 |  2-----4  |
 |           |
 8     7-----6

Problem

Image of the grid

Here are a few textual versions of the image.

Compressed:

2    00
3  02  3
 0 140
  4  3 4
  023
01 25
3  1 22
46     3

Another version, easier to read:

 2              0  0

 3        0  2        3

    0     1  4  0

       4        3     4

       0  2  3

 0  1     2  5

 3        1     2  2

 4  6                 3

EDIT: Ok, It seems to be quite easy, right? Now here is a harder challenge: Can you split it into a maximal number of "islands"? (Thanks to @ghosts_in_the_code for this addition)

$\endgroup$
  • 2
    $\begingroup$ I suggest modifying the question to ask for maximum possible islands. $\endgroup$ – ghosts_in_the_code Oct 22 '15 at 16:14
  • $\begingroup$ @ghosts_in_the_code Thanks, done (somewhat). $\endgroup$ – Bojidar Marinov Oct 22 '15 at 17:00
5
$\begingroup$

Once you realize that a number needs to be at each corner (e.g. no intersections in a blank square), then the difficulty crops up.

So, here is a solution with 6 islands.

I think this is the largest count of islands you can get. I thought at first that it could be 10, but with the 4 locked in the lower left, then the lowest value would be 7, which is not a factor of 60 (the total value of numbers in the puzzle). With the way the puzzle is set up, your lowest factor would be 10.

enter image description here

$\endgroup$
  • $\begingroup$ I would accept it as this is almost my solution, but if somebody comes with more islands, I would have to accept his/hers instead. $\endgroup$ – Bojidar Marinov Oct 22 '15 at 17:05
  • $\begingroup$ No problem. I think there might be multiple solutions for a 6 island layout, but as I said, that 4 and 3 in the bottom left seem to make 6 the highest number of islands you can have. What I would like to see are 3, 4, and 5 island solutions as well... $\endgroup$ – APrough Oct 22 '15 at 17:07
  • 3
    $\begingroup$ In my opinion you should've connected the two lonely 0s to the existing islands because they are technically two seperate islands with sum 0. $\endgroup$ – Ivo Beckers Oct 22 '15 at 21:45
5
$\begingroup$

A quick argument that APrough's solution with 6 islands (each with sum 10) already maximizes the number of islands:

  • The sum of all numbers is 60. Hence the only possibilities for $x$ islands each with sum $y$ are the following twelve pairs $(x,y)$: $~~(1,60)$, $~(2,30)$, $~(3,20)$ , $~(4,15)$, $~(5,12)$, $~(6,10)$, $~(10,6)$, $~(12,5)$, $~(15,4)$, $~(20,3)$, $~(30,2)$, and $~(60,1)$.
  • The first pair has $x=1$, and a single island is forbidden by the rules.
  • The number $6$ (in row $8$, column $2$) enforces $y\ge6$.
  • This leaves us with the six pairs $~(2,30)$, $~(3,20)$ , $~(4,15)$, $~(5,12)$, $~(6,10)$, $~(10,6)$.
  • Also $(x,y)=(10,6)$ is impossible: In this case, the entry $4$ in the lower left corner can neither be connected to its right neighbor $6$ (as the sum of the resulting island would exceed $6$), not can it be connected to its upper neighbor $3$ (as the sum be violated again), nor can it stay alone.
$\endgroup$
  • $\begingroup$ Nice, that's what I was waiting for... $\endgroup$ – Bojidar Marinov Oct 22 '15 at 17:22
  • 1
    $\begingroup$ It would be nice to know whether the other three potentially possible solutions (3,20), (4,15), (5,12) can indeed be implemented. In fact, (3,20) can be implemented by merging the six islands in APrough's solution into three islands. $\endgroup$ – Gamow Oct 22 '15 at 17:31
  • 1
    $\begingroup$ There exists a 5 island solution as well. However, the 4 island solution is not possible. $\endgroup$ – APrough Oct 22 '15 at 17:58
3
$\begingroup$
    2--------------0--0
    |
    3---------0--2--------3
              |  | 
        0-----1  4--0
        |           | 
        |  4--------3-----4
        |  |              |
        |  0  2--3        | 
        |     |           |
     0  1     2--5        |
     |        |           |
     3--------1-----2--2  |
     |                    |
     4--6                 3

A simple 2 island solution.

$\endgroup$
1
$\begingroup$

The puzzle is way too easy.

Keep the first five rows in Group A, and the last three in Group B. Transfer the '1' at row 6 col 2 to Group A, and the '2' at row 5 col 4 to Group B. Connections within the group is very easy. Now we have 2 groups that add up to $30$ each.

$\endgroup$
  • $\begingroup$ Doesn't work (altough something very similar does), you have crossing lines (if i'm mistaken, please copy my solution and use it draw in your lines) $\endgroup$ – DrunkWolf Oct 22 '15 at 16:45
  • $\begingroup$ Yeah, seems like you can't connect both the 4 at {4:2} (row:col) and the 3 at {5:4} $\endgroup$ – Bojidar Marinov Oct 22 '15 at 17:12
1
$\begingroup$

Initial question and examples didn't make it clear whether existing islands could be split up, so keeping existing islands together I came up with this.

Here we go:

Ans

Easier to read:

enter image description here

uhhh...I need help with formatting.

2 00+ 3 02--3 |0+140 | 4 3 4 | 023 | 01 25 | 3 1 22+ 46-----3

"+" indicate intersections and 2 islands add up to 30 each.

$\endgroup$
  • $\begingroup$ Can you please use the "easier-to-read" version of the grid? $\endgroup$ – Bojidar Marinov Oct 22 '15 at 17:01
  • $\begingroup$ @mchoy25. I think the problem is that you can only have a path from a number going in any of the four directions. In your example, the green path has the two 2's that cannot be connected to any other green number in this way. $\endgroup$ – APrough Oct 22 '15 at 18:35
  • $\begingroup$ @APrough. He mentioned that "The only place a T-intersection may happen is at a number, not in an empty cell." The space to the right is at the number 2 and so I can place a T-intersection. Whereas I can't go from r6c1 to r4c1 and then place a turn towards the 4 in r4c3 since I am not at a number. At least, that's how I interpreted the sentence. $\endgroup$ – mchoy25 Oct 22 '15 at 19:39
  • $\begingroup$ Aprough is right though, you don't place the intersection AT a number, you place it next to it. ALL lines between numbers should be straight lines. There is no cells in your green area that you can connect with a straight line from the two 2's, therefor, it's not a valid solution/ $\endgroup$ – DrunkWolf Oct 23 '15 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.