R/konstantinova.R

Defines functions konstantinova

Documented in konstantinova

konstantinova <- function(g, dist=NULL){
   # check if g is a graphNEL object
  if(class(g)[1]!="graphNEL"){
    stop("'g' must be a 'graphNEL' object")
  }
  stopifnot(.validateGraph(g))
  
  if(is.null(dist)){
    dist = distanceMatrix(g)
  }
  V = numNodes(g)
  d <- rowSums(dist)
  p <- unlist(dist/d)
  p <- p[p!=0]
  
  return(-sum(p*log2(p)))
}

Try the QuACN package in your browser

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

QuACN documentation built on May 2, 2019, 5:46 p.m.