Is it possible to use the callback function to stop the search when the cumulative sum of assigned vertex weights achieved a threshold value? Thanks,
Following the pseudo code:
graph1 <- make_ring(10)
weights <- c(1:10)
func1 <- function(graph, data, extra = weights) {
#stop bfs when the cumulative sum of vertices weights is >= 8
}
bfs <- bfs(graph1, root = 2, callback= func1, unreachable = FALSE)