View source: R/graph_maximal_packing.R
| verify.maximal.packing | R Documentation |
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).
verify.maximal.packing(packing.result, verbose = TRUE)
packing.result |
The result returned by
|
verbose |
Logical indicating whether to print detailed validation results. Default is TRUE. |
This function takes the output of create.maximal.packing
and verifies two key properties:
The packing vertices are all separated by at least
max_packing_radius
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)
}
A logical value: TRUE if the packing is both valid (satisfies the distance constraint) and maximal (no vertices can be added), FALSE otherwise.
create.maximal.packing,
validate.maximal.packing
adj.list <- list(c(2), c(1, 3), c(2, 4), c(3, 5), c(4))
weight.list <- list(c(1), c(1, 1), c(1, 1), c(1, 1), c(1))
result <- create.maximal.packing(adj.list, weight.list, grid.size = 2)
verify.maximal.packing(result, verbose = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.