Skip to contents

A convenience function to verify the correctness of a maximal packing created using the create.maximal.packing function. This function validates both the packing property (minimum separation distance) and maximality (no vertices can be added).

Usage

verify.maximal.packing(packing.result, verbose = TRUE)

Arguments

packing.result

The result returned by create.maximal.packing, which must be an object of class "maximal_packing".

verbose

Logical indicating whether to print detailed validation results. Default is TRUE.

Value

A logical value: TRUE if the packing is both valid (satisfies the distance constraint) and maximal (no vertices can be added), FALSE otherwise.

Details

This function takes the output of create.maximal.packing and verifies two key properties:

  1. The packing vertices are all separated by at least max_packing_radius

  2. The packing is maximal (no more vertices can be added without violating the distance constraint)

When \code{verbose = TRUE}, the function prints:
\itemize{
  \item Graph diameter
  \item Packing radius used
  \item Number of vertices in the packing
  \item Minimum distance between packing vertices
  \item Maximum coverage distance
  \item Validity and maximality status
  \item Any violations or potential additions (if applicable)
}

Examples

adj.list <- list(c(2), c(1, 3), c(2, 4), c(3, 5), c(4))
length.list <- list(c(1), c(1, 1), c(1, 1), c(1, 1), c(1))
result <- create.maximal.packing(adj.list, length.list, grid.size = 2)

verify.maximal.packing(result, verbose = FALSE)
#> [1] TRUE