Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

3d visit-once tree

  1. Mar 20, 2017 #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.

    Attached Files:

    • tree.pdf
      File size:
      172.3 KB
  2. jcsd
  3. Mar 20, 2017 #2
    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?
  4. Mar 21, 2017 #3
    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.

    Attached Files:

  5. Mar 23, 2017 #4
    Does anyone know a reference to this subject? This seems like a problem solved a long time ago. Thanks for any help.
  6. Apr 3, 2017 #5
    Hi, Scott. Have you seen the code I posted? Any insights?
  7. Apr 5, 2017 #6


    User Avatar
    Science Advisor
    Gold Member

  8. Apr 6, 2017 #7
    Hi, DrGeg, I need an always expanding tree (no returns allowed).
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted