Community Detection Using Hybrid Quantum Annealing on Amazon Braket – Part 1

Community Detection Using Hybrid Quantum Annealing on Amazon Braket – Part 1Learn About Amazon VGT2 Learning Manager Chanci Turner

As of 11/17/2022, D-Wave is no longer available on Amazon Braket and has transitioned to the AWS Marketplace. Consequently, the information on this page may be outdated. Learn more.

Many organizations struggle with the effective extraction of insights hidden within intricate network structures. For instance, a healthcare insurance provider may need to identify fraudulent claims by detecting unusual relationships between patients and providers, while a financial institution could require an anti-money laundering tool to spot suspicious transactions among various entities. Similarly, a marketing firm might seek to segment its audience for targeted campaigns. These challenges all revolve around uncovering network entity relationships, commonly referred to as community detection problems.

The techniques for addressing community detection issues have significantly progressed over the last ten years, evolving from greedy algorithms like Girvan-Newman and Louvain to nature-inspired algorithms like extremal optimization, and more recently, deep learning models. Notably, Negre et al. explored the potential of a quantum computer, specifically a quantum annealer, to tackle community detection as an optimization challenge.

This article marks the first installment of a two-part series focused on utilizing a hybrid classical-quantum annealing algorithm on Amazon Braket to solve community detection issues:

In this first part, we will guide you through the process of framing community detection as a Quadratic Unconstrained Binary Optimization (QUBO) problem, akin to the methodology employed by Negre et al. We will also demonstrate how to leverage the open-source QBSolv library, which offers quantum-classical hybrid solvers for QUBO issues, integrating both classical computing resources and D-Wave quantum annealers to tackle community detection on Amazon Braket.

In the second part, we will apply this quantum annealing-based community detection strategy to real-world networks and conduct a comprehensive analysis of solution performance and scalability.

For detailed code implementation and a tutorial notebook on using QBSolv for community detection in complex networks, please visit our AWS GitHub code repository.

Modularity-based Community Detection

The foundational concept of community structure in complex networks was first introduced and examined by Girvan and Newman. Essentially, the idea is to partition a network (or graph) into groups of nodes that belong to distinct communities (also known as clusters), where the nodes within each community are highly interconnected (high intra-connectivity), while nodes across different communities have lower connectivity (low inter-connectivity).

To evaluate the quality of a specific network segmentation into communities, Newman and Girvan proposed a metric known as modularity M. This metric contrasts the connectivity of edges within communities against that of a network’s null model, where edges would be randomly distributed under the condition that the expected degree of each node aligns with that of the original graph.

Formally, we consider a graph G with an adjacency matrix Aij that describes the weight between nodes i and j. In the null model, the expected number of edges between nodes i and j is approximately given by gigj/2m, where gi = ∑j Aij indicates the degree of node i and m=1/2∑i gi represents the total weight in the graph. By using a null model as a baseline, we define the modularity M as the difference between the actual weight Aij and the expected weight within the null model gigj/2m, summed over all pairs of vertices i, j that belong to the same group.

To normalize the equation, we arrive at the modularity M defined as:

M = (1/2m) ∑i,j (Aij – (gigj/2m)) δ(ci , cj)

where the Kronecker delta δ(ci, cj) equals 1 if node i and node j are in the same community, and 0 otherwise. The objective is to maximize the modularity M by optimizing community assignments ci for each node i in the graph. This optimization challenge is recognized as NP-hard.

Community Detection as a QUBO Problem

Numerous heuristic search algorithms have been developed to address the community detection problem. In this article, we concentrate on framing the community detection issue as a Quadratic Unconstrained Binary Optimization (QUBO) problem and showcase how to utilize D-Wave’s QBSolv solver on Amazon Braket to identify two or more communities in a given network.

For two communities (k = 2): Initially, we consider the scenario where we seek a graph partitioning into k = 2 communities. In this case, we can employ binary spin variables si ∈ {-1, 1} to indicate which community node i belongs to. The term (1 + sisj)/2 results in 1 if nodes i and j are part of the same community and 0 otherwise, enabling us to express the modularity metric compactly.

For k > 2 communities: The more complex task of community detection with k > 2 communities requires one-hot encoding of the binary variables xi. This involves setting xi,c = 1 if node i belongs to community c, and xi,c = 0 otherwise.

This encoding necessitates k variables per logical node, expanding the binary decision vector x from a length of N for the two-community case to k × N for the k-community situation. Consequently, we define x = (x1,1, x2,1, …, xN,1, …, x1,k, x2,k, …, xN,k).

By formulating the k > 2 community detection problem as a binary minimization task, we can construct the k-community QUBO Hamiltonian, integrating a penalty term to constrain solution constraints. For comprehensive guidance on community management, you can refer to this excellent resource that provides further insights.

For those interested in maintaining a positive work environment, SHRM offers authoritative advice on handling toxic coworkers.

This blog post is a part of an ongoing discussion about how quantum technologies can revolutionize various fields. For additional engaging content, check out this insightful piece on TED Talks.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *