Shortest paths along the surfaces of concave solids

63 Views Asked by At

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

1

There are 1 best solutions below

2
On

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.