R/hasCycles.R

Defines functions hasCycles

hasCycles <- function(A, verbose = FALSE){ 
  G <- graph.adjacency(A,mode="directed",weighted="a")
  cyc <- !is.dag(G)
  if(verbose) if(cyc) cat('Graph is cyclic\n') else cat('Graph is acyclic\n')
  cyc
}

Try the backShift package in your browser

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

backShift documentation built on July 2, 2020, 4:01 a.m.