# Creating the hardest 7x7 maze with special pieces

This puzzle stems from these type of questions by Dimity Kamenetsky. Creating the hardest 7x7 maze Creating the hardest 6x6 maze

I wanted to know how the best possible solution would change, if I were to add in special squares with different effects. I have some more ideas I would like to try if people like this kind of puzzle.

There is an empty 7x7 grid. You are allowed to paint some of its cells as walls (black), while the remaining cells are either empty(white) or hold a special piece. A robot is programmed to start on the Start(green) square and visit all of the goal(purple) squares using the shortest path possible. The game is over once the robot touches the last goal, it does not have to go back to start. The robot automatically knows the shortest path (including the effects of the special squares) and its decisions cannot be influenced. The robot moves from one empty cell to an adjacent empty cell (Horizontally or vertically, but not diagonally). The special squares are 2 x slide squares(red, with an arrow) and 2 x slowing squares(blue). Special squares cannot be placed on starting squares or goal squares. Can you paint the walls and add the special squares in a way that forces the robot to take the most number of steps?

Map:

Slide Squares: The robot counts the slide as a part of moving onto the square. You may enter any direction except directly opposite of the arrow, and the spot directly opposite of the arrow must not be a wall. The robot will slide the direction the arrow is pointing. Once the slide has been used once, it disappears and you may go back across it in any direction. Here, it would take 3 moves to reach the goal, but 4 moves if it wanted to go from goal to start afterwards.

Slowing Squares: The robot counts this square as 2 moves. You may enter/exit from any direction and it has infinite uses. Here, It would take the robot 5 moves to reach the goal, and still 5 if it wanted to go from goal to start afterwards.

Create the longest solution that visits all goals using 2 x Slowing and 2 x Slide squares. Good Luck!

• I'm not sure that this question is really going to be humanly solvable - it looks to me like the only way to figure out you've optimized it is brute-force computer search.
– Deusovi
Jul 2, 2020 at 16:40
• @Deusovi Is it a requirement that a puzzle has an exact answer? I was looking for the best solutions we could find, just like the examples didnt know the exact answer, mine is 52. Also, why did you remove the logical-grid tag? Its still a logical grid puzzle, right? Jul 2, 2020 at 16:57
• At least in my opinion, a good puzzle has an intentional path to its solution. If a question doesn't have that, it's not a puzzle with a solution but more along the lines of a research question. (I understand that a lot of people here feel differently, though.) As for the tag, [logic-grid] specifically refers to puzzles like Einstein's riddle, where you get clues like "The French person does not own the dog; the cat is in the red house; ..." and have to figure out the associations.
– Deusovi
Jul 2, 2020 at 17:00
• Ah, I had the completely wrong idea of that tag then, my apologies. Jul 2, 2020 at 17:01

A different approach to the slides yields an improved solution:

The optimal solution has the goal sequence of BL-TR-BR and requires a total of 54 steps.

• This is great! Well done.
– user69943
Jul 5, 2020 at 1:22
• Nice job! My 52 step solution this exact board, but I didn't think to place my sliders like that. Jul 6, 2020 at 13:15

My solution:

N = 52

Part 1

My solution for the standard 7x7 is 46, though a greater number may be possible.

Part 2

The optimal solution requires the robot to visit the bottom two corners (in either order) and then the top right corner

The top right slide forces an undesired move, adding 1 step
The bottom left slide is unused, adding 0 steps
The bottom right slow is used twice, adding 2 steps
The bottom left slow is used three time, adding 3 steps

6 total steps are added, yielding N = 52