hasEulerianPath {eulerian}R Documentation

Method for checking whether an eulerian path exists.

Description

An eulerian path is a path in a graph which visits every edge exactly once.

Usage

hasEulerianPath(graph, start = NULL)

Arguments

graph

a graphNEL object.

start

character or NULL. The name of the start node of an eulerian path.

Details

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.

Value

TRUE, if there is an eulerian path. FALSE, otherwise.

Author(s)

Ashis Saha

Examples

	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

[Package eulerian version 1.0 Index]