qat.generators.GraphColouringGenerator

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

Specialization of the CombinatorialOptimizerGenerator class for generator that solves the Graph Colouring problem

Parameters

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

generate(specs, graph, number_of_colours, **kwargs)

Generate a batch that solves the Graph Colouring 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 GraphPartitioningResult that contains interpretable information

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

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

  • number_of_colours (int) – the number of colours

Returns

A parsed result of combinatorial optimization problem

Return type

GraphPartitioningResult