qlauncher.problems.problem_initialization.ec#

This module contains the EC class.

Summary#

Classes:

EC

Class for exact cover problem.

Reference#

class qlauncher.problems.problem_initialization.ec.EC(instance: list[set[int]] = None, instance_name: str = 'unnamed')[source]#

Bases: Problem

Class for exact cover problem.

The exact cover problem is a combinatorial optimization problem that involves finding a subset of a given set of elements such that the subset covers all elements and the number of elements in the subset is minimized. The class contains an instance of the problem, so it can be passed into QLauncher.

onehot#

The one-hot encoding used for the problem.

Type:

str

instance#

The instance of the problem.

Type:

any

instance_name#

The name of the instance.

Type:

str | None

instance_path#

The path to the instance file.

Type:

str

property setup: dict#
static from_preset(instance_name: str, **kwargs) EC[source]#
classmethod from_file(path: str, **kwargs) EC[source]#
read_instance(instance_path: str)[source]#
visualize(marked: str | None = None)[source]#
static generate_ec_instance(n: int, m: int, p: float = 0.5, **kwargs) EC[source]#