R/warshall.R

Defines functions warshall

Documented in warshall

warshall<-function(M) {
  d<-sqrt(length(M))
  path<-M
  for (k in 1:d) {
    for (i in 1:d) {
      for (j in 1:d) {
        path[i,j]<-max(path[i,j],min(path[i,k],path[k,j]))
      }
    }
  }
  return(path)
}

Try the interventionalDBN package in your browser

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

interventionalDBN documentation built on May 2, 2019, 4:04 p.m.