Quantum computing method for obtaining an optimal solution of a problem with multiple discrete variables, wherein the problem is represented by a cost function, the method comprising: - generating a graph structure from the cost function, - dividing the graph structure into at least two disjunct subgraph structures, wherein each subgraph structure comprises a subset of the multiple variables, - mapping each subgraph structure to a local cost function represented as local cost Hamiltonian, - determining, for each local cost Hamiltonian, all eigenstates corresponding to an energy below a predetermined cut off energy using a quantum processing device, wherein each variable of the subset of multiple variables is represented by a qubit of the quantum processing device, wherein the at least two subgraph structures are interconnected, wherein a coupling of one subgraph structure to an adjacent subgraph structure is quantified by a coupling strength, and wherein the predetermined cut off energy is determined for each subgraph structure by summing over the coupling strength of each of its couplings, and wherein each of the at least two subgraph structures is constrained such that the cardinality of its subset of the multiple variables is smaller or equal to a number of qubits of the quantum processing device, - recombining the determined eigenstates, wherein the determined eigenstates are recombined by generating a representation of the cost function in a reduced Hilbert space (cost Hamiltonian) spanned by the determined eigenstates, the cost Hamiltonian consisting of two terms, - wherein the first term of the cost Hamiltonian sums over the different communities, wherein the summand is a diagonal matrix in which the diagonal elements are given by the determined energy levels in the respective community, and - wherein the second term sums over all community pairs wherein the summand is a diagonal matrix in which the diagonal entries assign an intercommunity coupling weight to every reduced qubit state pair, and - approximating a ground state from the recombined eigenstates, wherein the ground state represents the optimal solution. - generating a graph structure from the cost function, - dividing the graph structure into at least two disjunct subgraph structures, wherein each subgraph structure comprises a subset of the multiple variables, - mapping each subgraph structure to a local cost function represented as local cost Hamiltonian, - determining, for each local cost Hamiltonian, all eigenstates corresponding to an energy below a predetermined cut off energy using a quantum processing device, wherein each variable of the subset of multiple variables is represented by a qubit of the quantum processing device, wherein the at least two subgraph structures are interconnected, wherein a coupling of one subgraph structure to an adjacent subgraph structure is quantified by a coupling strength, and wherein the predetermined cut off energy is determined for each subgraph structure by summing over the coupling strength of each of its couplings, and wherein each of the at least two subgraph structures is constrained such that the cardinality of its subset of the multiple variables is smaller or equal to a number of qubits of the quantum processing device, - recombining the determined eigenstates, wherein the determined eigenstates are recombined by generating a representation of the cost function in a reduced Hilbert space (cost Hamiltonian) spanned by the determined eigenstates, the cost Hamiltonian consisting of two terms, - wherein the first term of the cost Hamiltonian sums over the different communities, wherein the summand is a diagonal matrix in which the diagonal elements are given by the determined energy levels in the respective community, and - wherein the second term sums over all community pairs wherein the summand is a diagonal matrix in which the diagonal entries assign an intercommunity coupling weight to every reduced qubit state pair, and - wherein the first term of the cost Hamiltonian sums over the different communities, wherein the summand is a diagonal matrix in which the diagonal elements are given by the determined energy levels in the respective community, and - wherein the second term sums over all community pairs wherein the summand is a diagonal matrix in which the diagonal entries assign an intercommunity coupling weight to every reduced qubit state pair, and - approximating a ground state from the recombined eigenstates, wherein the ground state represents the optimal solution.