hasEulerianCycle: Method for checking whether an eulerian cycle exists.

Description Usage Arguments Details Value Author(s) Examples

Description

An eulerian cycle is a path in a graph which visits every edge exactly once, and starts and ends at the same node.

Usage

1

Arguments

graph

a graphNEL object.

Details

A graph will have an euler cycle if and only if every node has same number of edges entering into and going out of it.

Value

TRUE, if graph has an auler cycle. FALSE, otherwise.

Author(s)

Ashis Saha

Examples

1
2
3
4
5
	require(graph)
	require(eulerian)
	g <- new("graphNEL", nodes=LETTERS[1:4], edgemode="directed")
	g <- addEdge(graph=g, from=LETTERS[1:4], to=LETTERS[c(2:4,1)])
	hasEulerianCycle(g)

Example output

Loading required package: graph
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package:BiocGenericsThe following objects are masked frompackage:parallel:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked frompackage:stats:

    IQR, mad, sd, var, xtabs

The following objects are masked frompackage:base:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which.max, which.min

[1] TRUE

eulerian documentation built on May 1, 2019, 8:19 p.m.