Optimizee for Community Detection with Quantum Annealing

This Optimizee employs a hybrid approach that integrates classical computing and quantum annealing to facilitate community detection. To submit jobs to the quantum annealer, it is necessary to establish access to the cloud platform. It is imperative that the problem be formulated as a cost function. The fitness function is equivalent to 1/modularity, meaning that the optimized minimizes the fitness value.

HybridCommunityOptimizee

class l2l.optimizees.community_detection.HybridCommunityOptimizee(traj, parameters)[source]

Bases: Optimizee

create_individual()[source]

Creates and returns the individual

bounding_func(individual)[source]

Bounds the individual within the required bounds via coordinate clipping

simulate(traj)[source]

Performs community detection on the graph using the D-Wave Quantum Computer.

Args: - traj: The trajectory object containing the individual’s parameters.

Returns: - A tuple containing the fitness value (1/modularity) of the clustering.

HybridCommunityOptimizeeParameters

class l2l.optimizees.community_detection.HybridCommunityOptimizeeParameters(APIToken, config_path, num_partitions, Graph, result_path, one_hot_strength, weight)
APIToken
Graph
config_path
num_partitions
one_hot_strength
result_path
weight

l2l.optimizees.community_detection.helpers

Contains some helper functions to access the D-Wave quantum annealer via cloud.

l2l.optimizees.community_detection.helpers.create_config(API_token, path)[source]

Creates a configuration file for DWave API connection.

Args: - API_token (str): The token for authentication with DWave API. - path (str): The directory path where the configuration file will be saved.

Returns: - None

l2l.optimizees.community_detection.helpers.result_csv(path, embedding_time, wall_time, qpu_time, generation, ind_idx, best_sample, communities, modularity)[source]
l2l.optimizees.community_detection.helpers.result_csv_hybrid(path, wall_time, generation, ind_idx, best_sample, communities, modularity)[source]