Martin's Logic Puzzles

Monday, April 9, 2007

Graph Colouring Instructions

Here is a classic graph theory problem: Put numbers (or "colours") 1, 2, or 3 into each circle so that adjacent circles receive different numbers. I guess some puzzles may use more colours, and that will be indicated for each puzzle.

Here is a simple example:

Notice that the circle on the top is adjacent to circles already coloured 1 and 2. So that circle must be coloured with 3. Then the circle on the right must be coloured with 1. So the solution for this puzzle is
.

Labels: ,

Friday, April 6, 2007

MinMax Path Instruction

Given a graph, assign to the edges of the graph weights 1, 2, ..., m where m is the total number of edges. Assign a unique weight to each edge. Then find a shortest path joining the two black vertices, where the "length" of the path is the sum of the weights of all the edges in the path. The goal is to find an assignment of the edges so that the length of the shortest path is as large as possible. Note that there may be several optimal ways of assigning the weights, but the optimal value is unique.

I guess this may be a bit confusing, so here is a simple example: There are 4 edges in this graph, so we need to put weights 1, 2, 3, 4 on the edges.

There are essentially three ways to put the weights...

The shortest path between the two black vertices in the first assignment is 3. This is 4 in the second assignment, and 5 in the third assignment. Since 5 is the largest of them all, this is the answer for this puzzle.

Labels: ,

Thursday, February 15, 2007

Hexagonal Masyu Instruction

Masyu (and I still don't know how to properly pronounce that) is one of my favourite Nikoli puzzles. I find it to be quite easy to do, though sometimes too easy... I've created an extension of this puzzle, tiling the plane with hexagons instead of squares.

Instruction: Find a simple closed loop that travels between adjacent hexagons (cells) via the centres of the hexagons. At each cell containing a white circle, the loop must go straight through the cell, and then make a turn in the very next cell on at least one side of the white cell. At each cell containing a black circle, the loop must make a turn at the cell, and then continue straight for 2 more cells in both directions. The loop can only make 120/240-degree turns, i.e. no sharp 60-degree turns.

Here is an example:

Labels: ,

Wednesday, February 14, 2007

Breaking the Loop #1

I first encountered "Breaking the Loop" in WPC15 Bulgaria. The puzzle type is invented (I believe) by Vladimir Portugalov, who is quite pleasant to meet while I was in the WPC. Initially I thought this puzzle is impossibly hard to solve, but after I've solved the WPC instance of the puzzle with the help of my officemate, I got quite interested in it and made one myself.

Instruction: Find a loop that visits all grid nodes, and locate 16 breakpoints (some of which are marked by "x" in the diagram). There are two breakpoints in each row and each column of nodes. The 16 breakpoints break the loop into 16 segments, and the midpoints of all 16 segments are shown as dots. For an example, see this page.

I have two versions of the same puzzle in here. The hard version is shown here, and I think this might be just a bit too hard. An easier version is hidden behind this link. It's the hard version with a few more breakpoints added, making it (what I believe) a more reasonable puzzle.

Labels: ,