From 99ec7a10905531e8966bcf269f18b9e08caa23a4 Mon Sep 17 00:00:00 2001 From: Maxime Vorwerk Date: Mon, 25 Sep 2023 04:30:40 +0200 Subject: [PATCH] removed nonrecursive variant due to benchmarks --- julia/PolycubeCounting.jl | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/julia/PolycubeCounting.jl b/julia/PolycubeCounting.jl index e7fcab2..26222ba 100644 --- a/julia/PolycubeCounting.jl +++ b/julia/PolycubeCounting.jl @@ -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)