cana.control.fvs module

Feedback Vertex Set

The NP-complete Feedback Vertex Set (FVS) problem is defined as the minimum number of vertices that need to be removed from a directed graph so that the resulting graph has no direct cycle. [PQR98] [ABGD13].

Two methods are implemented here. A bruteforce and the Greedy Randomized Adaptive Search Procedure (GRASP) method by [PQR98].

cana.control.fvs.fvs_grasp(directed_graph, max_iter=100, keep_self_loops=True)[source]

The Feedback Vertex Set GRASP implementation. This implementation is not exact but it is recommended for very large graphs.

Parameters:
  • directed_graph (networkx.DiGraph) – The structure graph.

  • max_iter (int) – Maximum number of iterations for the search.

  • keep_self_loops (bool) – If self-loops are used in the computation. By FVS theory, all self-loop nodes are needed for control.

Returns:

A list of sets with the driver nodes.

Return type:

(list)

See also

fvs_bruteforce().

cana.control.fvs.fvs_bruteforce(directed_graph, max_search=5, keep_self_loops=True)[source]

The Feedback Vertex Set bruteforce implementation.

Parameters:
  • directed_graph (networkx.DiGraph) – The structure graph.

  • max_search (int) – Maximum number of additional variables to include in the search.

  • keep_self_loops (bool) – If self-loops are used in the computation. By FVS theory, all self-loop nodes are needed for control.

Returns:

A list of sets with with the driver nodes.

Return type:

(list)

Warning

Use the GRASP method for large graphs.

See also

fvs_grasp().