Solve 3D Visit-Once Tree Puzzle with 16x16x16 Grid

  • Thread starter Thread starter intervoxel
  • Start date Start date
  • Tags Tags
    3d Tree
AI Thread Summary
A user is developing a software function to explore a 3D grid, aiming to visit each cell exactly once. Their current implementation fails to cover all cells in a 16x16x16 grid, visiting only 3436 out of 4095. They seek references or solutions to improve their approach and request clarification on the use of the boolean function isAllowed(), as well as insights into object principal. The user also asks for their code to be formatted for better readability and for added comments to facilitate understanding. They emphasize the need for a solution that generates an always expanding tree without any returns, expressing frustration over gaps in their current method. The discussion touches on whether a tree structure is essential or if a polygonal path could suffice, with a specific focus on achieving complete space coverage.
intervoxel
Messages
192
Reaction score
1
I'm trying to build a software function that explores a 3d grid visiting the cells just once. The file below is my last attempt, which misses some cells (for 16x16x16 it visits 3436 cells instead of 4095). Can anyone give me a reference to a solution, please.
 

Attachments

Physics news on Phys.org
I don't want to spend a whole lot of time on this, so you have to make things easy for me.
So how is boolean function isAllowed() used?
What is object principal?
Could you put your listing in single space so I can see more of it at a time?
Could you add some comments so that I don't have to figure it out from scratch?
 
I appreciate your interest in my problem, Scott. I prepared a simplified running demo, avoiding my program notation. The main goal is to generate a always expanding tree, filling completelly the space, as shown schematically in the figure. The present solution leaves gaps, which I could not solve. Thank you for any help.
 

Attachments

  • tree.png
    tree.png
    64.5 KB · Views: 438
  • tree.pdf
    tree.pdf
    176.8 KB · Views: 249
Does anyone know a reference to this subject? This seems like a problem solved a long time ago. Thanks for any help.
 
Hi, Scott. Have you seen the code I posted? Any insights?
 
Hi, DrGeg, I need an always expanding tree (no returns allowed).
 
Back
Top