Introduction

Problem Statement and Related Work: The community detection problem is about determining a partition of a graph into distinct communities such that the ratio between intra-community and inter-community connectivity is maximized. In this context, we refer to k-community detection as maximizing with respect to an arbitrary number of k communities. This problem is highly relevant in many practical applications such as the analysis of social networks [1, 11, 29], medical science [32], or biology and chemistry [16, 27]. In particular in software engineering, community detection is essential. Here, large systems frequently need to be decomposed into smaller ones in order to reduce the complexity toward manageable levels. This process is known as modularization [28]. Unfortunately, community detection or modularization for that matter are highly non-trivial problems in which the number of possibilities increases exponentially, according to the Bell number. Because of that, e.g., for a system with 10 elements there are already 115.975 possible modularizations [4]. Accordingly, several (classical) solutions to this problem have been developed in the past (see, e.g., [3, 6, 8, 12,13,14, 16, 19]).

With the dawn of quantum computing technologies, interesting alternatives to these classical solutions emerged and got investigated by researchers and engineers. The two most prominent general approaches that are currently utilized for this purpose are:

  • Gate-based (GB) quantum computing, where operators are applied to a quantum system to manipulate its state. Within this paradigm, algorithms for combinatorial optimization (e.g., QAOA [10] or Grover Adaptive Search [15]) can be utilized for community detection.

  • Quantum Annealing (QA), where the function which has to be optimized is encoded in the Hamiltonian of the quantum system.

These are considered the most promising candidates for demonstrating quantum advantage in solving a computationally hard problem faster than a classical state-of-the-art algorithm [35]. The recent review by Akbar & Saritha [1] provides a comprehensive overview to the field, which got established under the term quantum community detection. The review also contains a comparative analysis with a focus on quantum inspired algorithms, like the quantum inspired evolutionary algorithm [18].

However, current implementations of those quantum computing technologies are still in its infancy and are highly limited in its number of qubits. Because of this, the use of hybrid algorithms is considered a necessity for practical community detection problems [33]. In those hybrid algorithms (e.g., [30, 33, 35]), the overall solution is still handled by a classical framework, but adequately formulated sub-problems are solved by a quantum device (followed by the re-integration of the correspondingly determined solutions into the classical framework). As an example, the Quantum Local Search (QLS) algorithm [33] allows for a bipartition of a graph into two communities, where the manageable problem size significantly exceeds the potential of current quantum machines.

Here, machines for QA-based approaches are certainly more scalable with respect to the number of qubits that can be applied. For example, the D-Wave Advantage [24] (which is suitable for QA-based approaches) can handle up to 5000 qubits, while gate-based approaches rely on machines (e.g., by IBM or Google) that can handle a bit more than 100 qubits (with very impressive and ambitious roadmaps toward thousands of qubits though).Footnote 1 Using, e.g., an one-hot encoding as proposed in [29], this allows QA-based approaches the direct detection of a discrete number k of communities, while, to the best of our knowledge, all gate-based approaches proposed thus far are limited to detecting \(k=2\) communities only. Obviously, this makes comparing the current potential of QA-based and gate-based approaches impossible for identifying an arbitrary number of k communities in a given graph.

Moreover, existing QA-based solutions such as proposed in [29] and [30] have not been evaluated yet on recent hard- and software. Furthermore, Negre et al. (2020) [29] evaluated the algorithm for various real-world networks against a classical annealer, but no time metric is stated which indicates how long it took the algorithms to yield the given results.

Overall, this leaves a situation with multiple approaches utilizing quantum technologies to tackle the community detection problem. However, there is no comprehensive comparison between the, respectively, proposed quantum community detection solutions available yet.

This paper aims to fill the gap by, first, contributing two novel algorithms for gate-based devices (for \(k\ge 2\) communities), called GB1 and GB2 in the following. Second, reimplementing the QA-approaches reviewed above, which are subsequently called QA1 and QA2, utilizing current hard- and software. Finally (third), a structured comparative evaluation with standardized real-world and artificially generated benchmark graphs. The following discusses the research questions that guided our research. The utilized algorithms and according differences to previous work are summarized in Table 1.

Table 1 Hybrid algorithms utilized within this paper

Research Questions: The overall objective of this paper is to evaluate the current potential of quantum computing for the k-community detection problem. Therefore, the two main prevailing quantum computing architectures are evaluated by comparing their performance and the performance of a classical heuristic algorithm for a given set of test graphs. To enable such a comparison, the creation of novel hybrid algorithms, which are built to run on current gate-based quantum computers, is necessary. This leads to the first research question:

  • RQ1: How can possible gate-based hybrid algorithms for k-community detection be constructed?

The newly developed algorithms as well as the quantum annealing and classical method are evaluated on a test graph. Furthermore, the impact of the quantum parts within the new gate-based algorithms is assessed via a substitution and subsequent evaluation with simulated annealing methods. Therefore, the following two research questions are answered:

  • RQ2: How do the new hybrid gate-based algorithms, the quantum annealing based methods, and the classical benchmark heuristic perform in k-community detection?

  • RQ3: What is the performance impact of quantum processing within the gate-based hybrid algorithms?

Due to current hardware limitations [33], the evaluation considers only on a small test graph. However, quantum annealing devices provide a higher number of qubits for combinatorial optimization problems and have already been utilized for a direct encoding of the k-community detection problem [29]. Therefore, we further evaluate the performance of the quantum annealing methods on more advanced larger test graphs, leading to the fourth research question.

  • RQ4: How do current quantum annealing based hybrid methods perform on artificially generated benchmark graphs compared to a classical heuristic algorithm?

The new developed hybrid algorithms, together with an implementation of the other algorithms used throughout this paper, are publicly available on Github [17] for reproducibility of the obtained results.

Structure of the paper The remainder of this paper is structured as follows. In Sect. 2, background information concerning the community detection problem and optimization on NISQ devices is given. This also includes a short description of the implemented algorithms which have been proposed in previous work. Section 3 presents the new hybrid algorithms for the k-community detection problem, which utilize gate-based quantum computers, providing an answer to the RQ1 (design question). In Sect. 4, the evaluation methodology, the obtained results of the experiments, and the critical discussion of the obtained results are stated. Therefore, RQ2, RQ3 and RQ4 (knowledge questions) are answered within this section. Finally, the conclusion can be found in Sect. 5. In addition, more details concerning the methodology are given in the appendix.

Background

This section provides introductory information concerning the problem of community detection and appropriate mathematical descriptions as well as the optimization approaches on current NISQ devices. Within the later, the focus lies on existent quantum or hybrid algorithms dealing with community detection.

Community detection problem

The most commonly used measure for the quality of a detected community is the so-called modularity as it has been defined by Newman and Girvan [1, 8]. Although the modularity must not be considered as generalizable to all random graphs, the mathematical formulation fits the requirements of quantum computation. Many optimization problems in quantum computing are stated in Ising form [35]. This mathematical abstraction represents the energy of n discrete spin variables \(s_i\in \{-1,1\}\), \(1\le i\le n\) with an according local field \(h_{i}\) and interactions \(J_{ij}\) between different spins. With this approach, the energy of a configuration is denoted by the Hamiltonian function [35]:

$$\begin{aligned} H(s)=\sum _{i,j} J_{ij}s_is_j+ \sum _ih_is_i,\qquad s_i\in \{-1,1\} \end{aligned}$$
(1)

An equivalent formulation is the Quadratic Unconstrained Binary Optimization (QUBO) form. With the appropriate variable substitution, one obtains [35]:

$$\begin{aligned} H(x)=\sum _{i<j}Q_{i,j}x_ix_j+\sum _iQ_{ii}x_i,\qquad x\in \{0,1\} \end{aligned}$$
(2)

Using one of these forms apparently constraints the problem to a binary form. For each node of a graph \(G=(V,E)\) representing one variable (\(s_i\) or \(x_i\)), the modularity of at most two communities is therefore given by [1]:

$$\begin{aligned} M=\frac{1}{2m}\sum _{i,j}B_{ij}\frac{s_is_j+1}{2} \end{aligned}$$
(3)

with m being the sum over all edge weights \(w_{ij}\) of the graph and the modularity matrix elements \(B_{ij}=A_{ij}-\frac{g_ig_j}{2m}\). In this context, the node degree is \(g_i=\sum _{j}A_{ij}\) where \(A_{ij}\) represents the according adjacency matrix elements. Similarly, the modularity for a discrete number of communities is given by [8]:

$$\begin{aligned} M=\frac{1}{2m} \sum _{i,j}B_{ij}\delta (c_i,c_i) \end{aligned}$$
(4)

Optimization on NISQ devices

The most prominent quantum approaches designed for NISQ devices are the Quantum Approximate Optimization Algorithm (QAOA) and Quantum Annealing (QA), both of which are inspired by the adiabatic theorem [35]. In QA, the system starts in the ground state of the initial Hamiltonian \(H_I\) and evolves according to [35]:

$$\begin{aligned} H(t)=\frac{t}{T}H_C+\left( 1-\frac{t}{T}\right) H_I, \quad t\in \{0,T\} \end{aligned}$$
(5)

to the final state, which is denoted by \(H_C\) in Ising form (Eq. 1). QAOA applies the logic of QA to gate-based quantum computers. Here, the time evolution operator of the system is represented by an alternating application of quantum operators, which are constructed by either \(H_M\) or \(H_C\) and according parameters \(\beta , \gamma \). The resulting trial states \({\varPsi }(\beta ,\gamma )\) for different parameter settings are measured, and the parameters are optimized classically to produce the ground state of \(H_C\) [35]:

$$\begin{aligned} \beta _*,\gamma _*=arg min_{\beta ,\gamma }\langle {\varPsi }(\beta ,\gamma )|H_C|{\varPsi }(\beta ,\gamma )\rangle \end{aligned}$$
(6)

An existent hybrid quantum-classical algorithm for community detection which implements QA or QAOA for sub-problem optimization is the Quantum Local Search (QLS) algorithm [33], which has also been implemented within a multi-level approach [35]. The algorithm starts with a random solution and iteratively populates subsets, which are optimized by QA or QAOA. The sub-problem is formulated by fixing the community assignment for all nodes which are not in the subset and encoding them as boundary conditions. The convergence criterion is defined by three iterations without any further improvement in modularity.

For quantum annealing devices only, the concept of logical super-nodes has been introduced, which allows to handle the k-community detection problem on such devices [29]. The higher number of available qubits enables the use of one-hot encoding. This approach has been tested with the D-Wave 2000Q and the qbsolv software. However, the recently launched D-Wave Advantage and the hybrid solver for discrete quadratic models (refer to the appendix), which builds on the super-node logic, have not been tested for community detection so far. These technologies have been used in the first quantum annealing approach (QA1) in the experiments stated in Sect. 4.

An alternative approach which utilizes quantum annealing has been suggested by Reittu et al. (2020) [30]. The algorithm is based on the Szemeredi’s Regularity Lemma, which is defined for large bipartite graphs. After an initial bipartition of the given graph, iteratively the strongest communities (based on the connectivity) are detected and removed from the graph. In contrast to other algorithms, the underlying metric for optimization is not the modularity but rather the difference in energy density compared to a mean. The D-Wave 2000Q and qbsolv have been utilized for the experiments. An implementation of this approach represents our second quantum annealing method (QA2).

Methods for gate-based k-community detection

To the best of our knowledge, there is currently a lack of hybrid algorithms for the k-community detection problem, which can be run on gate-based devices. For the purpose of evaluating the potential of currently available quantum architectures, novel algorithms have been created, which are inspired by previous work [29, 30, 33].

Density-based community detection algorithm

The first gate-based algorithm (GB1) works similarly to the one proposed by Reittu et al. (2020) [30] as it iteratively finds the strongest communities within a given graph. However, GB1 is designed for gate-based devices rather than quantum annealing machines and does not bipartite the graph randomly. Therefore, the Szemeredi’s Regularity Lemma which addresses large bipartite graphs cannot be taken as a mathematical foundation for this algorithm. However, for smaller graphs a random bipartition affects the community structure more likely and more severe. For this reason, which has also been tested experimentally, we decided to omit the initial bipartition of the graph. This experiments have been conducted for design purposes and are therefore not stated in the paper.

Due to the higher number of available qubits in quantum annealing devices, the algorithm proposed by Reittu et al. (2020) [30] can directly solve subproblems (the identification of just two communities for a given set of nodes in the graph) via quantum annealing. However, for gate-model machines the use of a hybrid algorithm which can handle a larger number of vertices for these subproblems is necessary. We implemented QLS [33] for this task. Furthermore, to assure that all proposed algorithms optimize the same objective function, the modularity (Eq. 4) has been taken for this purpose rather than an energy density deviation from the mean as it is used in the Szemeredi’s Regularity Lemma. The algorithm is outlined in Algorithm 1.

figure a

It is assumed that the maximum number of communities does not exceed \(\sqrt{n}\) with n being the number of nodes in the graph [36]. The loop searches for the strongest community, with the modularity per node as the underlying metric. This criterion is not based on mathematical analytical reasoning, but rather on heuristics. After the strongest community has been detected, it is stored and the according nodes are deleted from the original graph before the procedure repeats for the remaining nodes. The algorithm stops if the graph does not contain vertices anymore. An alternative breaking scenario occurs in case there is no initial improvement possible within the inner loop (i.e., \(m<0\)). It is assumed that the algorithm works best for graphs with heterogeneous community structure, because of the logic of iteratively detecting communities based on their connectivity.

Recursive-QLS community detection algorithm

The second gate-based algorithm (GB2) represents a recursive application of QLS. Here, the original system is separated into \(2^x\) communities using the recursive_QLS function as it is outlined in Algorithm 2. In each recursion, the function adds an attribute to all individual nodes according to the binary community assignment. The sub-graphs detected in that way serve as the graph parameter in the subsequent recursion. After a defined number of recursions has been executed, the given attributes of a node encode its final community. In our approach, we define this upper boundary as the next higher integer after \(\log _2(k)\), where again k is given by \(\sqrt{n}\).

Using GB2, the maximum modularity can then be found by a brute-force search in the space defined by the power set with the detected communities as its elements. Alternatively, one could look for the highest modularity in the set of community constellations of the respective recursions by iteratively skipping the last node attribute. Which alternative is appropriate depends on the existing knowledge concerning the topology and community structure of the graph. Although the scalability of the proposed algorithms is not within the scope of this paper, GB2 could be applied to larger graphs by considering the initially detected communities as nodes in a subsequent optimization iteration similarly like it happens within the Louvain algorithm [3]. Thereby, a considerable part of the limitations in the search space, which are induced by the recursive GB2, could be compensated.

However, the mentioned search space limitations suggest, that GB2 works best for a graph with \(2^x\) communities. Furthermore, it is expected that GB2 is faster than GB1, because the number of nodes which have to be optimized in a binary manner reduces faster with each recursion of GB2 than it does for the iterations in GB1.

figure b

Experiments and results

The overall objective of the paper is to evaluate the current potential of gate-model and quantum annealing based devices for the k-community detection problem. The introduction of the novel hybrid algorithms for gate-based devices (Sect. 3) enables an initial comparative evaluation of the different architectures.

The conducted experiments are twofold. The first part considers the performance of all algorithms that have been described above on a real social network, referring to research question RQ2 and RQ3. As the hybrid solver for discrete quadratic models [26] is considered the most suitable for scaled up problems, the algorithm is further tested and compared with a classical state-of-the-art algorithm on four artificial test graphs in the second part. Therefore, research question RQ4 is answered within this scope. The subsequent chapters deal with the underlying methodology of the experiments, the obtained results and the discussion of those results.

Methodology

General procedure. In order to assess the performance of the algorithms described above, they have been applied to standardized graphs. The metrics of interest are

  • Time-to-solution: How long does it take the algorithm to find the solution?

  • Quality: What is the modularity of the obtained solution as it has been defined in Sect. 2.1. (Eq. 4)?

Every experiment has been conducted five times in order to be able to state an average, best and worst result for each constellation. It has been criticized in [12] that in almost any paper, where a new method for community detection is introduced, the testing consists in applying the method to a small set of simple benchmark graphs. However, within the scope of this paper we have to follow this tradition by evaluating the algorithms on one prominent real-world dataset or several artificial benchmark graphs, respectively. Further research on the scalability and specificity of the proposed algorithms may be the subject of future work. The general framework is implemented in Python 3.8 with NetworkX for network analysis operations. For statistical testing of the obtained results, the Mann–Whitney U test [2] has been used, which is equivalent [23] to the Wilcoxon ranksum test. This test allows comparison between two solution sets without the assumption of normal distribution. The significance level has been chosen to be 95% (\(\alpha =0,05\)). The chosen classical state-of-the-art algorithm for community detection for benchmarking is the Louvain algorithm [3, 12]. First part. Every method described above (QA1, QA2, GB1, GB2, Louvain) has been tested on the Zachary Karate Club Graph [37], which consists of 34 nodes and 78 edges. This graph has been extensively used to benchmark graph algorithms and is considered to be by far the most investigated system [12]. The various methods utilize different hardware and software. However, our framework is modular and can easily be extended to utilize other quantum computing architectures as they become available. For details concerning the used technologies, we kindly refer the interested reader to the appendix.

Within the first quantum annealing approach (QA1), the problem is solved by the D-Wave Hybrid Solver Service [26] with the D-Wave Advantage quantum annealer [24] as the underlying hardware. This hybrid solver allows to directly address discrete quadratic problems. Due to a high degree of automation, a parameter tuning like it has been conducted in [29] was not possible. The implementation of QA2 also runs on the D-Wave Advantage quantum annealer with the parameters set to the default values. Automatically minor embedding has been used, which is re-calculated each time a sampling method is called. The simulated annealing methods make use of the dwave-neal software tool. Therefore, the problem runs on servers of Amazon Web Services. This shall enhance the comparability of the obtained results as currently running quantum algorithms represent a form of online computation.

Concerning the gate-based algorithms, these utilize the Qiskit Aqua library, which provides an implementation of QAOA with the MinimumEigenOptimizer as a wrapper. Another implementation of QAOA is publicly available [17], but has not been used in the experiments. Communication with the hardware happened via the Qiskit IBM Quantum Provider. The problems have been sent to the IBM Melbourne quantum computer (15 qubits) with a QLS subset size of 12. The convergence criterion in QLS has been set to 3 iterations. To estimate the impact of the subset size on the number of required iterations, tests have been conducted with a subset size of 16 using simulated annealing. Hereby, one iteration is defined as one sub-problem optimization.

It has to be mentioned, that different definitions of the time-to-solution have been used. In QA1 and the Louvain algorithm, the overall time required to obtain a solution has been regarded, which is more meaningful for practical applications. Within QA2, GB1 and GB2, the time-to-solution is defined as the sum of all quantum processing (or simulated annealing) parts within the hybrid algorithm. Therefore, the queueing time is not considered in the metric, which makes it more representative. Furthermore, the biases of local computation differences are reduced. Additional information concerning timing issues of the utilized quantum systems are stated in the appendix. This mixed evaluation is justified by the overall objective of the paper, which is to assess the current potential of quantum technologies for the k-community detection problem in general, thus allowing to compare the different state-of-the-art of quantum annealing and gate-based methods.

Second Part. The second part extends the evaluation of the QA1. For this purpose, 12 test graphs of different size and density have been generated. These are the planted l-partition graph [9] and the LFR-benchmark graph [20], which are considered prominent artificial graphs for testing community detection algorithms [1, 12]. The planted l-partition graph shows a homogeneous community structure, whereas the LFR-benchmark graph is heterogeneous in community size and connectivity [12]. Both types of graphs have been generated with 100, 246, 496, 747, 1000 and 1500 nodes, with parameters that ensure a rather well-defined community structure and stable degree (for further details please consult to the appendix).

Results

This section states the results of the experiments, which are going to be discussed in the subsequent chapter. All raw result data are publicly available [17]. The experimental results concerning the first part are stated in Table 2 for the average, best and worst performance values out of the 5 runs, based on the modularity. All time values are in milliseconds. The obtained results for simulated annealing are stated in brackets. Furthermore, the results concerning the impact of the subset size in QLS are stated in Table 3.

Table 2 Average, best and worst performance values of hybrid algorithms and the Louvain algorithm for the Zachary Karate Club Graph; results for simulated annealing are stated in brackets
Table 3 Average, lowest and highest number of iterations for different subset sizes

Table 4 provides information concerning the statistical significance of the obtained modularity values yielded by the compared algorithms. All time values are considered to be significant. The modularities obtained by utilizing the IBMQ Melbourne or simulated annealing for sub-problem optimization show no significant difference for GB1 and GB2.

Table 4 Statistical significance of the compared algorithms regarding the obtained modularities

The experimental results concerning the second part are stated in Table 5 for the average, best and worst performance values, based on the modularity. Time values are given in milliseconds. Table 5 additionally states, whether the difference in the obtained modularity values can be considered as statistically significant.

Table 5 Average, best and worst performance values of the QA1 and Louvain algorithm for different artificial graphs

Discussion of results

The discussion is structured according to the two parts of the experimental setup: the first one considering the performance on the Zachary Karate Club Graph only (RQ2, RQ3), and the second one extending the experiments for QA1 to artificially generated test graphs (RQ4).

To our knowledge, the best modularity value for the Zachary Karate Club Graph is 0,4198 [3, 6], resulting in 4 communities. The subsequent interpretation of the results requires to consider the following aspects:

  • Varying certain elements of the hybrid algorithms (e.g., different QAOA implementation, different subset size and convergence criterion in QLS, parameter tuning in QA2) may significantly alter the performance of the algorithms, although they have been set consciously.

  • The characteristics of the Zachary Karate Club Graph, with its 4 communities, fit the recursive nature of GB2. However, QA2 struggles with such small graphs due to the applicability of the Szemeredi’s Regularity Lemma and the initial random bipartition of the network.

  • The Louvain algorithm is explicitly designed to solve the community detection problem especially for larger networks. GB1, GB2, QA1 and QA2 just need minor adoptions to the underlying optimization function to be more generally applicable.

Answering RQ2. The QA1 is able to reach the highest known modularity in all runs, but needs considerable time to do so. Due to the arguments mentioned above, the QA2 performs rather poor on the small Zachary Karate Club Graph. More interestingly, GB1 and GB2 both show no significant difference in the obtained modularities compared to the state-of-the-art classical Louvain algorithm. Although GB2 performs significantly slightly better than GB1 in this particular experiment, the later is considered the more versatile algorithm.

The values for the time-to-solution appear to vary notably between the utilized algorithms. A decrease in the time-to-solution for GB1 and GB2 could happen via a lower number of iterations per run. This in turn is indicated by the results to be possible with larger subset sizes. However, the downturn of larger sub-problems may be longer times for the solution per iteration. Which effect dominates in practice may be the subject of further studies. How different subset sizes may affect not only the number of iterations but also the obtained modularity and time-to-solution could be roughly extracted from the data provided on Github [17], but does not lie within the focus of this paper.

Lastly, it shall be mentioned that due to practical run-time reasons, the maximum number of iterations in the inner loop of GB1 has been set to 5. This number has sometimes been reached in our experiments, indicating that with more computation time even better modularity values may be possible.

Answering RQ3. Substituting QAOA within GB1 and GB2 with simulated annealing shows no significant differences in the obtained modularity values, which indicates a rather high solution quality of the IBMQ Melbourne concerning small problems. The values for the time-to-solution on the other hand vary notably with the use of simulated annealing.

For this reason, the proposed hybrid classical-quantum algorithms are considered to yield practical value only after the sub-problem optimization by QAOA exceeds simulated annealing methods, which heavily depends on future advances on the physical hardware level.

Answering RQ4. Concerning the obtained modularity values, it can be observed that for smaller graphs (e.g., PP100, PP246, LFR496) the QA1 and Louvain Algorithm (LA) yield equal values. This indicates that the global optimum may has been found, or both get easily trapped in the same local minimum. For graphs of up to 747 nodes, the QA1 yields equal results for every run which are better or worse than the ones of the LA and are probably caused by same partitions of the graph. The obtained results for larger graphs show a higher variance for both algorithms which may be caused by the according larger search spaces. This may also be the reason for the statistical differences when it comes to larger problem instances. What could also be noticed is a trend for better performance of the QA1 for more heterogeneous graphs (LFR-graphs). This may be caused by a potentially larger spectral gap between the different community assignments which in turn would be favorable for quantum annealing. Concerning the obtained time-to-solution values, the QA1 scales linearly or even slightly better as it is shown in Fig. 1, whereas the LA appears to run in time O(n*logn) [19]. Figure 1 shows that there is almost no difference in the obtained values for PP and LFR graphs. This may be caused by the hybrid solver framework of D-Wave which unfortunately does not provide transparent analysis of the conducted steps. Looking at the time values in Table 5 clearly shows the longer, but more robust, running times of QA1.

Fig. 1
figure 1

Time-to-solution against number of nodes for the QA1

Overall, it was not possible to identify an remarkable increase in solution quality or time-to-solution with the QA1 compared to a state-of-the-art heuristic classical solver. However, as [25] claims accelerated time-to-solutions for very large problems, it would be interesting to extend the evaluation to graphs of bigger sizes.

But not only the graph size and density shall be considered. The obtained results show that there are significant performance differences which arise only due to the community structure of the graph, which is defined by its homogeneity, average degree, ratio of intra- and inter-community connectivity, etc. Therefore, as criticized in [12], the specificity of the algorithms for given problems has to be examined without restrictions to size and density.

Finally, it should be mentioned that both the D-Wave Advantage and the hybrid solver for DQM where utilized in their first version, suggesting space for near-term efficiency improvements.

Threats to validity

Although already partially mentioned in the previous discussions, this section provides a structured review of the threads to validity following the scheme of [31].

Construct validity. To assess the current potential of quantum computing for the k-community detection problem, existing and novel algorithms have been utilized. However, varying parameters in the hybrid algorithms or optimizing pre- and postprocessing of each quantum query [21] could affect the obtained results. These effects are not within the scope of this work, because hybrid applications for practical usage require automatized parameter settings. Therefore, the automatic parameter setting by the vendors has been used or a conscious setting of the given parameters has been conducted (e.g., a subset size of 12 to account for ancillary qubits [21]).

Internal validity. Concerning the obtained modularity results of the substitution with simulated annealing, we regard the quality of the IBMQ Melbourne as the prevailing cause. However, there is still the possibility of leveling of poor results by the hybrid algorithm. As the research question concerns only the affect within the hybrid algorithm, the quality of the QAOA results has not been further investigated.

External validity. The proposed hybrid algorithms should be considered just as prototypes of possible quantum computing approaches for tackling the k-community detection problem. The mentioned specificity and dependence on the given problem, the parameter setting, as well as the underlying quantum parts make generalizing a difficult endeavor. In this sense, QAOA and quantum annealing are still to be considered in an early stage where their characteristics are being figured out currently (e.g., [38, 22]) and improvements are made on a regular basis (e.g., [7, 39]). For this reasons, we expect the algorithms to show similar performance when applied to similar problem instances as those examined in this work. However, we cannot state further generalizations as a sound sensitivity analysis is not within the scope of this paper, but may be a subject of future work. Furthermore, in the first part of this evaluation, no statements concerning the scaling of the proposed algorithms are made. Accounting for the criticism in [12], we stated the graph features carefully and varied certain parameters only while keeping others stable to ensure a higher degree of causality. Specific details are stated in previous sections and in the appendix.

Reliability. Although dealing with heuristic algorithms, which are stochastic in nature, we specified the used technologies and methodology in detail and provide all code and raw data on Github [17] for reproducibility. In order to be able to state statistically significant results, the Wilcoxon ranksum test has been applied.

Conclusion

In this paper, we have evaluated the potential of current NISQ devices for the k-community detection problem. Therefore, we have proposed novel hybrid algorithms for gate-model devices and compared their performance to existing quantum annealing-based approaches and a state-of-the-art classical heuristic solver. We ran our experiments on the 15 qubit IBMQ Melbourne and the D-Wave Advantage devices. Furthermore, the quantum processing parts have been substituted with simulated annealing to obtain information concerning the impact of quantum computing within the hybrid algorithms. The obtained answers to the given research questions are summarized in Table 6.

Table 6 Results at a glance

Considering the modularity obtained with the various methods on the Zachary Karate Club Graph (RQ2), the QA1 which utilizes the D-Wave hybrid solver for discrete quadratic models performs best. GB1 and GB2 show no significant difference to the classical benchmark method (Louvain algorithm). The substitution with simulated annealing (RQ3) does not yield any significant difference in modularity, whereas the time-to-solution is notably decreased.

Utilizing the hybrid solver for discrete quadratic models provided by D-Wave, we were able to obtain modularity values similar to those of the Louvain algorithm, but got much longer time-to-solution values (RQ4). Furthermore, the results show that not only the graph size and density should be considered in the evaluation due to the significant impact of other factors which are related to the underlying community structure. These may be highly specific to each utilized algorithm.

Overall, quantum computing for the k-community detection problem has been figured out to yield good modularity values for small graphs, but still the computation times are too high to be of practical relevance. Given the current and near-term hardware limitations, we consider versatile and modularizable hybrid quantum classical algorithms, like the ones outlined, to be crucial for proceeding toward practical usage of NISQ devices, and therefore, for justification of quantum computing in general. As the potential of available NISQ devices increases, we are optimistic that similar methods can lead to a broad utilization of quantum computing to a variety of real-world applications.

Future Work: We are currently experimenting with quantum algorithms other than QAOA, such as the Grover Adaptive Search [15], in our proposed hybrid algorithms. Furthermore, we are working on a concept, how to model the use of these algorithms according to Model Driven Software Engineering principles [5]. In this sense, we will investigate how to reuse existing algorithms for a particular problem, but also how to model the hybrid workflows of solving combinatorial optimization problems on NISQ devices. The scalability and specificity of the proposed algorithms may be an additional subject of further studies.