R/Graph.R

Defines functions CalculateMST

CalculateMST <- function(x) {
  x <- as.matrix(dist(x))
  g <- igraph::graph_from_adjacency_matrix(x, mode = "undirected", weighted = "weight")
  igraph::mst(g)
}

Try the Canek package in your browser

Any scripts or data that you put into this service are public.

Canek documentation built on Nov. 6, 2023, 1:06 a.m.