Function ADS::vertexCover

Function Documentation

inline std::optional<Nodes> ADS::vertexCover(const Adjacency &G, int k)

at most k nodes that touch every edge, or nothing

Pre:

G is unoriented, i.e., square and symmetric

Post:

a set returned has at most k nodes and covers the edges