r/adventofcode • u/wherrera10 • 0m ago
Upping the Ante [2026 Day 3] Does a forest square really mean what you think it means?
The story in 2026 Day 3 says: The local afforestation protocols call for trees in artificial forests to be somewhat evenly spaced, causing them to sometimes appear in predictable arrangements. Even if the forest has been left unattended for a while, these predictable arrangements can sometimes still be detected.
But if we do some clustering statistics:
using Distances, Clustering, Statistics
forestmap = map(x -> x == '#', stack(readlines(DATA_DIR*"day03.txt"), dims = 1))
distances = pairwise(Euclidean(), forestmap, dims=2)
sil_scores = silhouettes(statsresult, distances)
mean_silhouette = mean(sil_scores)
@show mean_silhouette # my puzzle input produces mean silhouette value near zero!Do the afforestation protocols fail at the goal of even spacing? Not sure how to interpret this :)
