removed nonrecursive variant due to benchmarks

This commit is contained in:
Maxime Vorwerk
2023-09-25 04:30:40 +02:00
parent 8a0cd223d5
commit 99ec7a1090

View File

@@ -14,36 +14,6 @@ function options()
end
function scanForPolycubes(MaxSize::Int64)
D = Dict{UInt, ImmutableOrientedPolycube}()
S = Vector{Polycube}();
cube = getCube()
immutableCube = getImmutableOrientedPolycube(cube)
D[immutableCube.hash] = immutableCube
push!(S, cube)
while !isempty(S)
cube = pop!(S)
growableSpaces = collect(getPossibleNeighbors(cube))
acceptable_growth = MaxSize - length(cube.cubes)
possibleGrowth = powerset(growableSpaces, 1, acceptable_growth)
for cubesToAdd possibleGrowth
newPolycube = Polycube(copy(cube.cubes), Set(cubesToAdd), deepcopy(cube.orderedLists))
for c cubesToAdd
push!(newPolycube, c)
end
collision = checkForCollision(newPolycube, D)
if !collision
push!(S, newPolycube)
immutableNewPolycube = getImmutableOrientedPolycube(newPolycube)
D[immutableNewPolycube.hash] = immutableNewPolycube
end
end
end
sanitizedData = sanitize(D, MaxSize)
serialize("julia/results.bin", sanitizedData)
end
function scanForPolycubesRec(MaxSize::Int64)
D = Dict{UInt, ImmutableOrientedPolycube}()
singletonCube = getCube()
immutableCube = getImmutableOrientedPolycube(singletonCube)