powered by
Re-orients a path/cycle, preserving adjacencies so that weights tend to decrease. From specifies the starting point, for cycles only.
best_orientation(path, d, cycle=FALSE, path_dir= path_cor, from=NULL)
A vector giving a hamiltonian.
A dist, used to provide edge weights.
dist
If TRUE, the path is interpreted as a closed path.
TRUE
path
A function used to evaluate a path start and orientation
Sepcifies the starting point, for cycles only.
C.B. Hurley and R.W. Oldford
see overview
hpaths, eulerian.
hpaths
eulerian
require(PairViz) rdist <- function(n) { d <- matrix(0,n,n) d[lower.tri(d)] <- runif(n*(n-1)/2) return(as.dist(d)) } r <- rdist(7) best_orientation(1:7,r) best_orientation(1:7,r,cycle=TRUE)
Run the code above in your browser using DataLab