def _solve_single_graph()

in src/qbsolv_community.py [0:0]


    def _solve_single_graph(self):
        """
        Call QUBO classical/hybrid solver to process a single graph for community detection
        
        :param graph: a networkX graph
        :param num_comm: int, number of communities to solve for
        """
        
        QbsolvComm = QbsolvCommunity(
            self.graph, self.solver_limit, self.num_repeats, self.num_reads, self.seed, self.alpha)
        
        t0 = time.time()
        if self.mode == 'classical':
            comm_results, response = QbsolvComm.solve_classical(self.num_comm)
        elif self.mode == 'hybrid':
            comm_results, response = QbsolvComm.solve_hybrid(self.num_comm, self.s3_folder, self.device_arn)
        else:
            raise ValueError(f"Invalid qbsolv mode {self.mode}. Mode has to be in ['classical', 'hybrid']!")

        time_spent = round(time.time()-t0, 2)
        
        return comm_results, response, time_spent