Skip to main content
Much simpler proof
Source Link
Victor Stafusa
  • 9.4k
  • 2
  • 33
  • 62

Suppose that instead of the hexagonal pattern, we had the 127 cells laid out as three linesStart with 42, 43 and 42 cells.

So what?

There, the 41 cells without communication to the exterior would necessarily be0 hallways, otherwise, either the hallway would be two or more disconnected sections or some cell would not be near a hallway. Plus some other exterior cell would also need to be a hallway in order to connect it toAdd the exterior, making up a minimum of 42 hallways cellsentrance in some edge.

But duh! It is not a three line pattern, it is an hexagonal pattern!

As long as you can fit it the hallways, it doesn't matter This will make 4 rooms accessible. If you can't fitstart in a corner instead, it would justthis will give you 1 less accessible room and will only make things worseyour solution less optimal.

Taking the three line pattern, we could make the entire middle line, with the exception of one of the cells in the very end asStarting add new hallways. We could also exchange the entrance for some cell in the other two lines connected to an existing hallway. But in any way, there would be a cellEvery time you do that we should call as, the "end-of-hallway cell" and a non-hallway cell covered byprevious hallway will give access to 1 less room than it that we should call as "the last room"used to do. SurelyEvery time you add a new hallway, at most 3 new rooms become accessible, but if thethat new hallway bifurcates (as it does), there wouldwill not be multiple cells eligible for being entitled as sucha dead-end, but we can choose any one of those new rooms will be turned to the multiple candidates andnext hallway, so, with the result isexception of the same.

Most commonlyentrance, each hallway cell connectsection gives access to other two hallway cells. Some hallway cells are bifurcations having three other hallway cells as neighbors and some are dead-ends, having only oneat most 2 rooms. However, every time we add a bifurcationAlso, we also addto get a new dead-end since cycles are inherent suboptimal. Hallway cells with four or more neighbors also being hallways can't be optimal since this would only increase the density of hallway cellsthat gives access to 3 new rooms, which is what we wantyou will also need to decreasemake a bifurcation that gives you 1 less room, so you still get 2 new reachable rooms per hallway in the best case.

So, with the exception of the end-of-hallway cell andThis means that the entrancebest you can get is 2 new accessible rooms per hallway, this impliesand 1 more than that inbecause the optimal case,entrance started giving 4. So the average number of neighbors that are hallway cells to other hallway cells neighbors is exactly two. Further, disregarding only "the last room", exactly a thirdone more than the triple of the cells must benumber of hallways, otherwise some room would be inaccessible.

We have 127 cells. OneOr put in the other way around, the number of themhallways is "the last room", so we have 126 other cells. Get a third of that and we have 42the number of cells minus one. Hence, $(127 - 1) \div 3 = 42$. So this is the best solution possible.

Thanks to Kruga for the sketch of the proof in a comment and also for Daniel Wagner that also gave something similar in another comment.

Suppose that instead of the hexagonal pattern, we had the 127 cells laid out as three lines with 42, 43 and 42 cells.

So what?

There, the 41 cells without communication to the exterior would necessarily be hallways, otherwise, either the hallway would be two or more disconnected sections or some cell would not be near a hallway. Plus some other exterior cell would also need to be a hallway in order to connect it to the exterior, making up a minimum of 42 hallways cells.

But duh! It is not a three line pattern, it is an hexagonal pattern!

As long as you can fit it the hallways, it doesn't matter. If you can't fit, it would just make things worse.

Taking the three line pattern, we could make the entire middle line, with the exception of one of the cells in the very end as hallways. We could also exchange the entrance for some cell in the other two lines. But in any way, there would be a cell that we should call as the "end-of-hallway cell" and a non-hallway cell covered by it that we should call as "the last room". Surely, if the hallway bifurcates (as it does), there would be multiple cells eligible for being entitled as such, but we can choose any one of the multiple candidates and the result is the same.

Most commonly, each hallway cell connect to other two hallway cells. Some hallway cells are bifurcations having three other hallway cells as neighbors and some are dead-ends, having only one. However, every time we add a bifurcation, we also add a dead-end since cycles are inherent suboptimal. Hallway cells with four or more neighbors also being hallways can't be optimal since this would only increase the density of hallway cells, which is what we want to decrease.

So, with the exception of the end-of-hallway cell and the entrance, this implies that in the optimal case, the average number of neighbors that are hallway cells to other hallway cells neighbors is exactly two. Further, disregarding only "the last room", exactly a third of the cells must be hallways, otherwise some room would be inaccessible.

We have 127 cells. One of them is "the last room", so we have 126 other cells. Get a third of that and we have 42. Hence, this is best possible.

Thanks to Kruga for the sketch of the proof in a comment.

Start with 0 hallways. Add the entrance in some edge. This will make 4 rooms accessible. If you start in a corner instead, this will give you 1 less accessible room and will only make your solution less optimal.

Starting add new hallways connected to an existing hallway. Every time you do that, the previous hallway will give access to 1 less room than it used to do. Every time you add a new hallway, at most 3 new rooms become accessible, but if that new hallway will not be a dead-end, one of those new rooms will be turned to the next hallway, so, with the exception of the entrance, each hallway section gives access to at most 2 rooms. Also, to get a new dead-end that gives access to 3 new rooms, you will also need to make a bifurcation that gives you 1 less room, so you still get 2 new reachable rooms per hallway in the best case.

This means that the best you can get is 2 new accessible rooms per hallway, and 1 more than that because the entrance started giving 4. So the number of cells is one more than the triple of the number of hallways. Or put in the other way around, the number of hallways is a third of the number of cells minus one. Hence, $(127 - 1) \div 3 = 42$. So this is the best solution possible.

Thanks to Kruga for the sketch of the proof in a comment and also for Daniel Wagner that also gave something similar in another comment.

Proof of optimality.
Source Link
Victor Stafusa
  • 9.4k
  • 2
  • 33
  • 62

I got a solution with:

42 cells as hallways.

And I think that it is optimal, but I have no proof of that yet.

Here it is:

enter image description here


Proof of optimality

Suppose that instead of the hexagonal pattern, we had the 127 cells laid out as three lines with 42, 43 and 42 cells.

So what?

There, the 41 cells without communication to the exterior would necessarily be hallways, otherwise, either the hallway would be two or more disconnected sections or some cell would not be near a hallway. Plus some other exterior cell would also need to be a hallway in order to connect it to the exterior, making up a minimum of 42 hallways cells.

But duh! It is not a three line pattern, it is an hexagonal pattern!

As long as you can fit it the hallways, it doesn't matter. If you can't fit, it would just make things worse.

Taking the three line pattern, we could make the entire middle line, with the exception of one of the cells in the very end as hallways. We could also exchange the entrance for some cell in the other two lines. But in any way, there would be a cell that we should call as the "end-of-hallway cell" and a non-hallway cell covered by it that we should call as "the last room". Surely, if the hallway bifurcates (as it does), there would be multiple cells eligible for being entitled as such, but we can choose any one of the multiple candidates and the result is the same.

Most commonly, each hallway cell connect to other two hallway cells. Some hallway cells are bifurcations having three other hallway cells as neighbors and some are dead-ends, having only one. However, every time we add a bifurcation, we also add a dead-end since cycles are inherent suboptimal. Hallway cells with four or more neighbors also being hallways can't be optimal since this would only increase the density of hallway cells, which is what we want to decrease.

So, with the exception of the end-of-hallway cell and the entrance, this implies that in the optimal case, the average number of neighbors that are hallway cells to other hallway cells neighbors is exactly two. Further, disregarding only "the last room", exactly a third of the cells must be hallways, otherwise some room would be inaccessible.

We have 127 cells. One of them is "the last room", so we have 126 other cells. Get a third of that and we have 42. Hence, this is best possible.

Thanks to Kruga for the sketch of the proof in a comment.

I got a solution with:

42 cells as hallways.

And I think that it is optimal, but I have no proof of that yet.

Here it is:

enter image description here

I got a solution with:

42 cells as hallways.

Here it is:

enter image description here


Proof of optimality

Suppose that instead of the hexagonal pattern, we had the 127 cells laid out as three lines with 42, 43 and 42 cells.

So what?

There, the 41 cells without communication to the exterior would necessarily be hallways, otherwise, either the hallway would be two or more disconnected sections or some cell would not be near a hallway. Plus some other exterior cell would also need to be a hallway in order to connect it to the exterior, making up a minimum of 42 hallways cells.

But duh! It is not a three line pattern, it is an hexagonal pattern!

As long as you can fit it the hallways, it doesn't matter. If you can't fit, it would just make things worse.

Taking the three line pattern, we could make the entire middle line, with the exception of one of the cells in the very end as hallways. We could also exchange the entrance for some cell in the other two lines. But in any way, there would be a cell that we should call as the "end-of-hallway cell" and a non-hallway cell covered by it that we should call as "the last room". Surely, if the hallway bifurcates (as it does), there would be multiple cells eligible for being entitled as such, but we can choose any one of the multiple candidates and the result is the same.

Most commonly, each hallway cell connect to other two hallway cells. Some hallway cells are bifurcations having three other hallway cells as neighbors and some are dead-ends, having only one. However, every time we add a bifurcation, we also add a dead-end since cycles are inherent suboptimal. Hallway cells with four or more neighbors also being hallways can't be optimal since this would only increase the density of hallway cells, which is what we want to decrease.

So, with the exception of the end-of-hallway cell and the entrance, this implies that in the optimal case, the average number of neighbors that are hallway cells to other hallway cells neighbors is exactly two. Further, disregarding only "the last room", exactly a third of the cells must be hallways, otherwise some room would be inaccessible.

We have 127 cells. One of them is "the last room", so we have 126 other cells. Get a third of that and we have 42. Hence, this is best possible.

Thanks to Kruga for the sketch of the proof in a comment.

Source Link
Victor Stafusa
  • 9.4k
  • 2
  • 33
  • 62

I got a solution with:

42 cells as hallways.

And I think that it is optimal, but I have no proof of that yet.

Here it is:

enter image description here