eulerian {PairViz}R Documentation

~~ Methods for Function eulerian ~~

Description

A generic function that returns an eulerian (or nearly eulerian) path based on self.

Usage

eulerian(self, start=NULL,weighted=TRUE)

Arguments

self

– see below

start

– see below

weighted

– see below

Value

A vector representing the eulerian- a character vector of node names for a graph, otherwise a numeric vector. If the graph is not connected, the result is a list of eulerians for each connected component.

Methods

self = "even_graph"

Uses etour to construct the eulerian. If weighted is TRUE a weighted eulerian is constructed, otherwise weights are ignored. A non-null start is the eulerian starting point.

self = "graphNEL"

Augments the graph using mk_euler_graph, then invokes eulerian again on the augmented verion. If self is not connected, (approximate) eulerians are formed for each connected component, which are returned as a list.

self = "matrix"

Builds a graph using mk_euler_graph, then invokes eulerian again on the result.

self = "numeric"

Builds a graph with self nodes using mk_euler_graph, then invokes eulerian again on the result.

self = "ANY"

Builds a graph using mk_euler_graph, then invokes eulerian again on the result.

Author(s)

C.B. Hurley and R.W. Oldford

References

C. Hierholzer (1873). Uber die Moglichkeit, einen Linienzug ohne Wiederholung und ohne Unterbrechung zu umfahren. Math. Annalen VI, pp. 30-32.

Also, see overview

Examples


require(PairViz)

d <- as.matrix(eurodist)[1:8,1:8]   # pick the first 8 cities

eulerian(d)
eulerian(d, weighted=FALSE) # In this case, starts at city 1 and ends at city 8



[Package PairViz version 1.3.6 Index]