Learn R Programming

gor (version 2.0)

shave_cycle: Shaving a hairy cycle

Description

Removing dangling vertices of a cycle obtained by adding a single edge to a spanning tree.

Usage

shave_cycle(v, eG)

Value

Edge vector of the shaven cycle, to be interpreted with respect to the edgelist eG.

Arguments

v

Edge vector of the hairy cycle

eG

Graph given as edgelist, see igraph::as_edgelist()

Author

Cesar Asensio

Details

When generating a fundamental cycle in a graph, addition of a single edge to a spanning tree gives a "hairy" cycle, that is, a single cycle with some dangling branches of the tree. This routine removes iteratively all leaves from this "hairy" tree until only a 2-regular, connected cycle remains, which is a fundamental cycle of the graph with respect the given spanning tree.

See Also

generate_fundamental_cycles generates the edge vectors of a system of fundamental cycles of a graph, apply_incidence_map applies the incidence map of a graph to an edge vector.

Examples

Run this code
## It is used as a subroutine in [generate_fundamental_cycles].

Run the code above in your browser using DataLab