Skip to contents

[Experimental]

A feedback vertex set of a graph is a subset of vertices whose removal breaks all cycles in the graph. Finding a minimum feedback vertex set is an NP-complete problem, both on directed and undirected graphs.

Usage

feedback_vertex_set(graph, weights = NULL, algo = c("exact_ip"))

Arguments

graph

The input graph

weights

Potential vertex weights. If the graph has a vertex attribute called ‘weight’, and this argument is NULL, then the vertex attribute is used automatically. The goal of the feedback vertex set problem is to find a feedback vertex set with the smallest total weight.

algo

Specifies the algorithm to use. Currently, “exact_ip”, which solves the feedback vertex set problem with an exact integer programming approach, is the only option.

Value

A vertex sequence (by default, but see the return.vs.es option of igraph_options()) containing the feedback vertex set.

feedback_vertex_set().

Examples


g <- make_lattice(c(3,3))
feedback_vertex_set(g)
#> + 2/9 vertices, from 436ddf0:
#> [1] 2 8