WLJS LogoWLJS Notebook

VertexCoverQ

VertexCoverQ[g, vlist] yields True if the vertex list vlist is a vertex cover of the graph g, and False otherwise.

Examples

Check if vertices form a cover:

g = Graph[{1 -> 2, 2 -> 3, 3 -> 1}];
VertexCoverQ[g, {1, 2}]

Not a cover:

VertexCoverQ[g, {1}]

Please visit the official Wolfram Language Reference for more details.

On this page