Description Usage Arguments Details Value Author(s) Examples
An eulerian path is a path in a graph which visits every edge exactly once.
1 | hasEulerianPath(graph, start = NULL)
|
graph |
a |
start |
|
If start is NULL, this function returns whether there exists any eulerian path in graph. If start is not NULL, the function determines if there exists an eulerian path starting from start.
TRUE, if there is an eulerian path. FALSE, otherwise.
Ashis Saha
1 2 3 4 5 6 | require(graph)
require(eulerian)
g <- new("graphNEL", nodes=LETTERS[1:4], edgemode="undirected")
g <- addEdge(graph=g, from=LETTERS[c(1:4)], to=LETTERS[c(2:4,4)])
hasEulerianPath(g) #TRUE
hasEulerianPath(g, "B") #FALSE
|
Loading required package: graph
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, sd, var, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, basename, cbind, colMeans, colSums, colnames,
dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
intersect, is.unsorted, lapply, lengths, mapply, match, mget,
order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
union, unique, unsplit, which, which.max, which.min
[1] TRUE
[1] FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.