Matthew Henderson
Two different greedy procedures for building maximal partial Room squares in R inspired by Meszka and Rosa (2021).
greedy1
visits all cells in order placing into the next cell the first
available pair such that the conditions of being a partial Room square
will not be violated.
R <- greedy1(6)
plot_room_square_labs(R)
In this plot colour represents the order in which cells were filled. The cells were filled in order from lightest to darkest.
# is R a maximal partial Room square?
is_maximal_proom(R)
#> [1] TRUE
greedy2
iterates through all pairs in order placing the next pair in
the first available cell such that the conditions of being a partial
Room square are not violated.
R <- greedy2(8)
plot_room_square_labs(R)
Again colour represents order of filling, proceeding from lightest to darkest.
# is R a maximal partial Room square?
is_maximal_proom(R)
#> [1] TRUE
Meszka, Mariusz, and Alexander Rosa. 2021. “Maximal Partial Room Squares.” Journal of Combinatorial Designs 29 (7): 482–501. https://doi.org/10.1002/jcd.21777.