Learn R Programming

HyperG (version 1.0.0)

reorder_vertices: Reorder the vertices of a hypergraph.

Description

Return a hypergraph in which the vertices have been reordered so that they are in the given order as columns of the incidence matrix.

Usage

reorder_vertices(h,ord,decreasing=FALSE)

Arguments

h

a hypergraph.

ord

an ordering of the vertices.

decreasing

if ord is not given, the order function is called on the names of the vertices as controlled by the decreasing variable.

Value

a hypergraph.

See Also

order

Examples

Run this code
# NOT RUN {
   h <- hypergraph_from_edgelist(list(3:7,8:12,c(1,3,9)))
	k <- reorder_vertices(h)
	hnames(h)
	hnames(k)

   h <- hypergraph_from_edgelist(list(letters[3:7],letters[8:12],
	                                   LETTERS[c(1,3,9)]))
	k <- reorder_vertices(h)
	hnames(h)
	hnames(k)

# }

Run the code above in your browser using DataLab