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 May 1, 2019, 9:25 p.m.