Starting with the "hashtable-less" algorithm described by presseyt in #11, it seems it could be faster if we change the approach in checking if we have the correct polycube for output:
- Start with seed polycube
p. Extend by candidate cube a to yield polycube q (q = p + a).
- Repeat step 1 for all possible additions of
a.
- Filter the results of step 2 to only have unique values, saving the highest found value of the index of
a in each q.
- For each
q, check if there is any possible r at a higher index of q that can be removed while remaining a polycube. Otherwise output q.
The advantage of this method is we don't need to recanonize the resulting polycubes after removing the values of r. This doesn't come completely for free, as we have to check for duplicates within the set of polycubes generated by the seed polycube p and do some connection checks. This is because symmetric seed polycubes will create at least 2 of the same generated polycube, though we check only within this set because the index of the added point is always the same in the output for the same seed polycube.
I made my own C implementation based on this idea in this repository. Profiling on low numbers of N seems to indicate the connection checks for step 4 take about 15% of the total processing time. Testing shows it seems faster (N=15 in 1 hour 38 minutes on an old FX-8350 processor) than the current rust hashless or point-list versions on my machine, though I'm not sure how it compares to the solution described in #27. Admittedly, I'm rather limited in testing larger values of N because of how long I'll have to tie up my machine with its limited processing capability.
Starting with the "hashtable-less" algorithm described by presseyt in #11, it seems it could be faster if we change the approach in checking if we have the correct polycube for output:
p. Extend by candidate cubeato yield polycubeq(q=p+a).a.ain eachq.q, check if there is any possiblerat a higher index ofqthat can be removed while remaining a polycube. Otherwise outputq.The advantage of this method is we don't need to recanonize the resulting polycubes after removing the values of
r. This doesn't come completely for free, as we have to check for duplicates within the set of polycubes generated by the seed polycubepand do some connection checks. This is because symmetric seed polycubes will create at least 2 of the same generated polycube, though we check only within this set because the index of the added point is always the same in the output for the same seed polycube.I made my own C implementation based on this idea in this repository. Profiling on low numbers of N seems to indicate the connection checks for step 4 take about 15% of the total processing time. Testing shows it seems faster (N=15 in 1 hour 38 minutes on an old FX-8350 processor) than the current rust hashless or point-list versions on my machine, though I'm not sure how it compares to the solution described in #27. Admittedly, I'm rather limited in testing larger values of N because of how long I'll have to tie up my machine with its limited processing capability.