Method for checking whether an eulerian cycle exists.

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)