qat.generators.VertexCoverGenerator

class qat.generators.VertexCoverGenerator(job_type='qaoa')

Specialization of the CombinatorialOptimizerGenerator class for generator that solves the Vertex Cover problem

Parameters

job_type (str) – The job type of the batches to be generated. Can be either “qaoa”, “aqo” or “sqa”

generate(specs, graph, A=2, B=1, **kwargs)

Generate a batch that solves the Vertex Cover problem on a particular graph. The batch can then be sent to a computational stack of plugins and QPU to be executed. The result will be parsed into VertexCoverResult that contains interpretable information

Parameters
  • specs (HardwareSpecs) – will be used to run the job

  • graph (networkx.Graph) – a networkx graph to run the Vertex Cover algorithm on

  • A (double, optional) – a positive constant by which the terms inside \(H_A\) from \(H = H_A + H_B\) are multiplied. This equation comes from the Hamiltonian representation of the problem. Default is 2.

  • B (double, optional) – similar to \(A\), \(B\) is a positive factor for the \(H_B\) terms, default is 1

Returns

A parsed result of combinatorial optimization problem

Return type

VertexCoverResult