qlauncher.problems.optimization.vertex_cover#

Summary#

Classes:

VertexCover

Class for the Vertex Cover problem which is a combinatorial problem involving choosing a subset of graph vertices such that each edge of the graph has at least one vertex in the chosen subset.

Reference#

class qlauncher.problems.optimization.vertex_cover.VertexCover(instance: Graph, instance_name: str = 'unnamed')[source]#

Bases: Problem

Class for the Vertex Cover problem which is a combinatorial problem involving choosing a subset of graph vertices such that each edge of the graph has at least one vertex in the chosen subset.

instance#

The graph for which the coloring problem is to be solved.

Type:

nx.Graph

visualize(solution: list[int] | None = None) None[source]#
static from_preset(instance_name: Literal['default'], **kwargs) VertexCover[source]#
static generate_vertex_cover_instance(num_vertices: int, edge_probability: int) VertexCover[source]#
to_bqm(constraint_weight: int = 5, cost_weight: int = 1) BQM[source]#