0

Background

I came across this puzzle on TikTok by Henry Dudeney. There is a cuboidal room, 30 units long, 12 units wide and 12 units high. There is a spider at point A on the inside wall, 1 unit below the center of the top right edge and an insect at point B, 1 unit above the center of the bottom left edge as shown in figure 1 below. The spider can only crawl along the walls of the cube and wants to get to the fly (which doesn't move) along the shortest path.

I'll leave the answer to this puzzle and how to generalize it for any positions of the spider, fly and cuboid dimensions in an answer in case you want to think about it yourself before spoiling the puzzle.

Figure 1: Original spider and insect puzzle. Figure-1: Original spider and insect puzzle.

The question

But now, what if the cuboid is replaced by a solid that is concave. For instance, the solid which is the flattened Teserract from Salvadore Dali's painting: https://en.wikipedia.org/wiki/Crucifixion_(Corpus_Hypercubus). Now imagine a spider on one of the faces of one of the cubes and the fly on another face of some other cube. Let's assume for now that the boundaries between the cubes don't exist. We now want to find a general algorithm for finding the shortest path between the spider and the fly. However, the trick we used before which involved flattening the cube doesn't apply anymore since there doesn't seem to be a way to flatten such a solid without having the faces overlap. An extension to this is to bring back the boundaries between the cubes and allow the spider to crawl on the boundaries and cross over to the cube on the other side once it reaches a common edge.

Figure 2: flattened Teserract

Rohit Pandey
  • 7,547
  • Unfolding that solid IS possible, but I agree that taking into account all configurations could turn into a combinatorial nightmare. – Intelligenti pauca May 16 '22 at 14:03
  • Oh, I didn't know it is possible. Is it also possible when the boundaries between the cubes are available to the spider to crawl on? Can you share one of the unfoldings for either case? That would be a valid answer in my mind even if there are a lot of unfoldings. – Rohit Pandey May 16 '22 at 16:33

1 Answers1

1

If you want to see the answer to the original puzzle in the question, it involves unfolding the cuboid, then finding a shortest path in the unfolded mesh. There are many ways to flatten a cuboid on a table (see here: How many distinct ways to flatten a cube?) and we have to take the minimum of the straight line paths across all the unfoldings. What happens to work best here is as follows (with the shortest path length being 40 units):

enter image description here

We can generalize this solution for any cuboid and positions of spider and fly by iterating through all the unfoldings.

The reason I started thinking about the solid in the question was that I wondered how to go about this if the spider and fly were on a Teserract instead of a cuboid.

Rohit Pandey
  • 7,547
  • 1
    Instead of posting an answer, you could just point to this Wikipedia page: https://en.wikipedia.org/wiki/The_spider_and_the_fly_problem – Intelligenti pauca May 16 '22 at 14:09
  • 1
    Ah, didn't know about that. I think I'll leave this in because it also provides some context on the motivation for the question. – Rohit Pandey May 16 '22 at 20:13