Allocation device, allocation method, and program
By prioritizing product binary variables on a chimera graph, the allocation device optimizes node usage, improving the efficiency of solving the traveling salesman problem on quantum annealing machines.
Patent Information
- Application Number
- JP2020123262
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-07-17
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-07-17
AI Technical Summary
Existing methods for converting the traveling salesman problem into a chimera graph for quantum annealing machines do not guarantee a reduced number of nodes used, leading to inefficiencies in problem-solving.
An allocation device and method that prioritizes binary variables that are products in the objective function of the QUBO problem, assigning them to interconnected nodes on a chimera graph, thereby reducing the number of nodes required for problem-solving.
This approach ensures a more efficient use of nodes on the chimera graph, enhancing the speed and accuracy of solving the traveling salesman problem using quantum annealing machines.
Smart Images

Figure 0007540222000039 
Figure 0007540222000034 
Figure 0007540222000042
Abstract
Description
[Technical field]
[0001] The present invention relates to an allocation device, an allocation method, and a program, and in particular to converting a traveling salesman problem into a Chimera graph. [Background technology]
[0002] Converting the Traveling Salesman Problem to a Chimera Graph corresponds to identifying the correspondence between the objective function when the Traveling Salesman Problem is expressed as a QUBO (Quadratic Unconstrained Binary Optimization) problem and a specific Chimera Graph composed of nodes and edges. The reason for converting to a Chimera Graph is that it is necessary to convert to a Chimera Graph when solving the Traveling Salesman Problem using a quantum annealing machine or the like. In other words, such conversion is necessary when expressing the Traveling Salesman Problem as a QUBO problem and solving it using quantum annealing or the like.
[0003] In general, to represent a QUBO problem on a Chimera graph, it is necessary to appropriately assign variables of the objective function to nodes.
[0004] An example of a method for finding an assignment that satisfies conditions for general QUBO problems, not limited to the traveling salesman problem, is described in Non-Patent Document 1, and another example is described in Non-Patent Document 2. [Prior art documents] [Non-patent literature]
[0005] [Non-Patent Document 1] PI Bunyk et al, “Architectural Considerations in the Design of a Superconducting Quantum Annealing Processor”, IEEE Transactions on Applied Superconductivity, vol. 24, 2014 [Non-Patent Document 2] J. Cai et al., “A practical heuristic for finding graph minors”, arXiv:1406.2741 (2014). Summary of the Invention [Problem to be solved by the invention]
[0006] The method described in Non-Patent Document 1 is a method that can be applied to any QUBO problem. However, in this method, the same allocation is made for all QUBO problems, so there is a possibility that there is an allocation that can reduce the number of nodes used on the Chimera graph for each QUBO problem. The method described in Non-Patent Document 2 is a heuristic method. In this method, an allocation can be found, but there is no guarantee that the same allocation can be obtained every time it is performed. In particular, there is no guarantee that the number of nodes used can be reduced. Therefore, the above two methods have a problem that when expressing and solving the traveling salesman problem on a Chimera graph, it is not possible to find an allocation that uses a small number of nodes, or there is no guarantee that such an allocation can be found.
[0007] The present disclosure has been made to solve such problems, and aims to provide an allocation device, an allocation method, and a program that can obtain a correspondence between the variables of a QUBO problem corresponding to the traveling salesman problem and the nodes of a graph for solving this QUBO problem, while reducing the number of nodes used. [Means for solving the problem]
[0008] An allocation device according to a first aspect of the present disclosure, an input receiving unit that receives an input of the number of cities in the traveling salesman problem; an assignment unit that assigns a binary variable according to the number of cities in the traveling salesman problem expressed as a QUBO (Quadratic Unconstrained Binary Optimization) problem to a node on a Chimera graph; an output unit that outputs information indicating a correspondence relationship between the binary variables and the nodes based on a result of the assignment of the binary variables to the nodes; having The assignment unit preferentially assigns pairs of binary variables that are products in the objective function of the QUBO problem to the nodes that are connected to each other by edges in the Chimera graph, over pairs of binary variables that are not products in the objective function of the QUBO problem.
[0009] In the allocation method according to the second aspect of the present disclosure, Accepts input of the number of cities in the traveling salesman problem, A binary variable corresponding to the number of cities in the traveling salesman problem expressed as a QUBO problem is assigned to a node on a Chimera graph; outputting information indicating a correspondence relationship between the binary variables and the nodes based on a result of the assignment of the binary variables to the nodes; In assigning the binary variables to the nodes, the set of binary variables that are products in the objective function of the QUBO problem is preferentially assigned to the nodes that are interconnected by edges in the Chimera graph, over the set of binary variables that are not products in the objective function of the QUBO problem.
[0010] A program according to the third aspect of the present disclosure includes: an input receiving step of receiving an input of the number of cities in the traveling salesman problem; An assignment step of assigning a binary variable according to the number of cities in the traveling salesman problem expressed as a QUBO problem to a node on a Chimera graph; an output step of outputting information indicating a correspondence relationship between the binary variables and the nodes based on a result of the assignment of the binary variables to the nodes; on the computer, In the assignment step, the set of binary variables that are products in the objective function of the QUBO problem are preferentially assigned to the nodes that are connected to each other by edges in the Chimera graph, over the set of binary variables that are not products in the objective function of the QUBO problem. Effect of the Invention
[0011] According to the above-mentioned aspects, it is possible to provide an allocation device, an allocation method, and a program that can obtain a correspondence between the variables of a QUBO problem corresponding to a traveling salesman problem and the nodes of a graph for solving this QUBO problem, while reducing the number of nodes used. [Brief description of the drawings]
[0012] [Figure 1] This is a schematic diagram showing a chimera graph in which K(4) units are arranged in 4 rows and 4 columns. [Diagram 2] FIG. 1 is a schematic diagram showing an example of a chain. [Diagram 3] A schematic diagram showing three chains connected by edges. [Figure 4] FIG. 1 is a schematic diagram illustrating an example of a computing system according to a first embodiment. [Diagram 5] 2 is a block diagram illustrating an example of a functional configuration of an allocation device according to a first embodiment. FIG. [Figure 6] 2 is a block diagram showing an example of a hardware configuration of an allocation device according to an embodiment; [Figure 7] FIG. 2 is a schematic diagram showing an example of a bundle. [Figure 8] FIG. 11 is a schematic diagram showing the nodes to be used, divided into blocks, before the fourth process is performed. [Figure 9] FIG. 11 is a schematic diagram showing the nodes to be used, divided into blocks, after the fourth process has been performed. [Figure 10] FIG. 13 is a schematic diagram showing an example of a number representing a node position. [Figure 11]FIG. 11 is a schematic diagram showing an allocation result when N=5 according to the first embodiment. [Figure 12] FIG. 12 is a schematic diagram showing a group of units used by each bundle in the allocation shown in FIG. 11. [Figure 13] FIG. 13 is a schematic diagram showing the arrangement of the bundles at the end of the third process. [Figure 14] FIG. 11 is a schematic diagram showing an allocation result when N=6 according to the first embodiment. [Figure 15] FIG. 15 is a schematic diagram showing a group of units used by each bundle in the allocation shown in FIG. 14. [Figure 16] 4 is a flowchart showing the flow of operations of the allocation device according to the first embodiment. [Figure 17] 1 is a flowchart showing a flow of a calculation operation for a traveling salesman problem (QUBO problem) by a calculation system according to an embodiment. [Figure 18] This is a table showing the experimental results for the traveling salesman problem with eight cities. [Figure 19] FIG. 11 is a schematic diagram illustrating an example of a computing system according to a second embodiment. [Figure 20] 11 is a flowchart showing the flow of operations of the allocation device according to the second embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] In the following description, the subscripts of variables may be expressed using underscores to clarify that they are subscripts. For example, the notation x_i indicates that i is the subscript of x.
[0014] To aid in understanding the embodiments, the following describes the traveling salesman problem, the QUBO problem, Chimera graphs, the representation of the traveling salesman problem expressed as the QUBO problem on a Chimera graph, and the quantum annealing machine associated therewith.
[0015] The traveling salesman problem is a combinatorial optimization problem that is difficult to solve, which asks what order a salesman should take to visit all given cities once and return to the first city in order to take the shortest route. The specific problem of the traveling salesman problem is given by the number of cities and the distances between the cities. The traveling salesman problem can also be expressed as a QUBO problem, which is explained below.
[0016] The QUBO problem is generally expressed as follows. First, prepare N variables that can take the values 0 and 1, i.e., binary variables. These are represented as x_i, where i can take the values 1, 2, ..., N, and x_i are differentiated by the value of i. Then, define the objective function H as the following equation (1).
[0017] <Formula (1)>
number
[0018] Q_ij on the right hand side of equation (1) is the value of row i and column j of matrix Q, where both i and j can take the values 1, 2, ..., N. Q_ij can take real values. Note that x_i is either 0 or 1, so x_i×x_i = x_i. That is, Q_ii x_i x_i = Q_ii x_i. Therefore, equation (1) is a general expression of linear and quadratic real coefficient polynomials consisting of N variables x_i that take only the values 0 or 1. Also, since it is sufficient to generalize the expression by assuming that all Q_ij for i>j are 0, in the following, we will assume that all Q_ij for i>j are 0 and only Q_ij for i≦j will be considered. The QUBO problem is a problem of finding a combination of values of x_i (i = 1, 2, ..., N) that minimizes H in equation (1) when matrix Q is specifically given.
[0019] The traveling salesman problem can be expressed as a QUBO problem. In other words, there is always a matrix Q that corresponds to a specific problem of the traveling salesman problem, and it can be used to express the traveling salesman problem in the form of equation (1). In other words, the traveling salesman problem can be expressed as a problem of finding a combination of variables that gives the minimum value of an objective function, and the objective function can be expressed as linear and quadratic real coefficient polynomials of variables that can only take the values 0 or 1. There are multiple ways to express the traveling salesman problem as a QUBO problem. In other words, there are multiple corresponding matrices Q. The following equation (2) is one of those expressions. In this expression, the objective function H of the QUBO problem is expressed as equation (2).
[0020] <Formula (2)>
number
[0021] In formula (2), x, which is distinguished by a subscript, is a binary variable of the QUBO problem. That is, x with a subscript such as x_i,a or x_j,a+1 in formula (2) is a binary variable of the QUBO problem and can take the values 0 and 1. In this expression, there are two subscripts for each x. The first subscript (represented as i and j) specifies the city in the specific problem of the traveling salesman problem and can take an integer from 0 to N-2. Here, N represents the number of cities. The other subscript of x (represented as a, a+1, N-2, and 0) indicates which city is to be visited and can take an integer from 0 to N-2. The reason why the value of these subscripts is not N-1 will be described later. x_i,a can take the values 0 and 1, but x_i,a = 0 means that city i is not visited in the ath place, and x_i,a = 1 means that city i is visited in the ath place. In this way, x_i,a is a variable that indicates whether or not city i is visited in the ath place. Once all the values of x are determined, and they satisfy the conditions described later, it is possible to uniquely determine which city to visit and in what order. In other words, the combination of x values corresponds to the order in which the cities are visited. W_ij is an integer that represents the distance between city i and city j. Also, C is a parameter that can be adjusted. As will be described later, by adjusting C, it is possible to ensure that the combination of x values that minimizes H becomes a solution to the traveling salesman problem. However, C is a predetermined positive value.
[0022] Since equation (2) is a linear and quadratic polynomial with variables x_i,a that can only take 0 and 1, it can be expressed in the form of equation (1). However, the subscripts in equation (2) are different from those in equation (1). Note that the pair (i, a) of two subscripts i and a in equation (2) corresponds to i and j in equation (1). There is some arbitrariness in which a pair of subscripts in equation (2) corresponds to a subscript in equation (1). For example, if (i, a) = (0,0) corresponds to i = 1 in equation (1) and (i, a) = (0,1) corresponds to i = 2 in equation (1), then when equation (2) is written in the form of equation (1), Q_11 = Q_22 = -2C, Q_12 = 2C. Note, however, that W_00 = 0. Furthermore, if (i, a) = (1, 1) corresponds to i = 3 in equation (1), then when equation (2) is written in the form of equation (1), Q_33 = -2C, Q_13 = W_01, and Q_23 = 2C. In this way, equation (2) can be expressed in the form of equation (1), and when expressed in this way, each element of matrix Q is represented by W and C. How each element of matrix Q is specifically expressed can be obtained by expanding equation (2) with respect to x and checking its coefficients.
[0023] The conditions for a combination of x values to uniquely determine a route around cities are that the following two conditions are satisfied. The first is that, for the same i value and different a values, only one of x_i and a is 1 and the others are all 0, and this is true for all values of i. The second is that, for the same a value and different i values, only one of x_i and a is 1 and the others are all 0, and this is true for all values of a. Satisfying the first condition means that the number of visits to city i is 1. Satisfying the second condition means that there is only one city visited the ath time. There may be combinations of x values that do not satisfy these conditions, but such combinations would represent, for example, visiting the same city multiple times or visiting multiple cities at once, and would not correspond to the tour route we are looking for.
[0024] When the combination of x values satisfies the conditions for uniquely determining a route around the cities, the term with coefficient C in formula (2) becomes 0. In that case, H becomes only the first three terms of formula (2) (terms other than the term with coefficient C). In addition, since W_ij represents the distance between city i and city j, if city i is visited ath and city j is visited a+1th on the route corresponding to the combination of x values, W_ij x_i,a x_j,a+1 becomes W_ij, and otherwise becomes 0. Therefore, by adding up W_ij x_i,a x_j,a+1 for all i and j, the distance from the city visited ath to the city visited a+1th on the route corresponding to that combination of x values is obtained. Furthermore, by adding up a, the total distance of the route corresponding to the combination of x values is obtained.
[0025] However, in formula (2), care must be taken with the distance from the N-2th city to the N-1th city and the distance from the N-1th city to the Nth city (the same city as the first city). This is because formula (2) only deals with the route that visits city N-1 as the N-1st city. A circular route can have different visiting numbers even if the cities from which you move to which cities are the same. For example, if you increase the visiting number by 1 and visit the city that was previously the N-1st city to the Nth city, you will get a route that has the same cities from which you move to which cities, but different visiting numbers. These two routes have the same total distance. For the purpose of finding a circular route with a short total distance, what you need to know is which city you move from to which city. To remove this arbitrariness, only the route that visits city N-1 as the N-1st city is considered. Therefore, the subscripts i and a of x do not become N-1. In equation (2) constructed based on this idea, the distance from the N-2th city to the N-1th city (i.e. city N-1) is given by summing W_i,N-1 x_i,N-2 with respect to i. And the distance from the N-1th city to the Nth city (the same city as the first (0th) city) is given by summing W_N-1,j x_j,0 with respect to j.
[0026] From the above, when the combination of x values meets the conditions for uniquely determining a route around the city, the term with C as a coefficient in formula (2) will be 0, and the other terms will be the total distance of the route corresponding to the combination of x values. Therefore, at this time, H in formula (2) gives the total distance of the route corresponding to the combination of x values.
[0027] Conversely, when the combination of x values does not satisfy the conditions for uniquely determining a route around the city, the term with C (a positive value) as the coefficient in formula (2) will take a positive value, and H will be large. Therefore, by making C large, H corresponding to combinations of x values that do not correspond to a route will become large. Therefore, making the value of H small will also lead to not selecting combinations of x values that do not correspond to a route.
[0028] As described above, when W_ij is given for the traveling salesman problem for a specific city layout, and the parameter C is also determined, H in formula (2) is determined. Since H is a linear and quadratic polynomial in the variable x that takes values of 0 and 1, it can be considered as the objective function of the QUBO problem. Finding the combination of values of x that minimizes H corresponds to finding the shortest route to visit the cities in that layout. In other words, the traveling salesman problem is expressed as the QUBO problem in formula (2).
[0029] Next, we will explain the chimera graph. Figure 1 is a diagram showing an example of a chimera graph. A chimera graph consists of multiple nodes 900 and edges 901 connecting them. A chimera graph is composed of an array of units 902. A unit is a unit graph that constitutes a chimera graph. In a chimera graph, the units 902 are arranged in a square lattice shape, or in a structure that can be transformed into a square lattice shape. In the following, we consider a square lattice shape consisting of vertical and horizontal directions. A chimera graph is specified by the number of nodes 900 in a unit 902, the number of units 902 in the vertical direction (also called the column direction) and the number of units 902 in the horizontal direction (also called the row direction).
[0030] In the following, a unit of a chimera graph is represented as K(r). K(r) has two sets of r nodes, totaling 2r nodes, and one set of r nodes is connected to all of the other set of r nodes by edges. In other words, a chimera graph is a complete bipartite graph with 2r nodes. Of the two sets of r nodes in a unit, the r nodes in one set are connected to nodes in the same location in the units on both sides of the horizontal direction by edges, and the r nodes in the other set are connected to nodes in the same location in the units on both sides of the vertical direction by edges. However, a unit located at the edge of the graph is connected to only the unit on the opposite side of this edge by edges, not to its neighbors on both sides. Note that Figure 1 shows a chimera graph in which the unit is K(4) and there are four each in the vertical and horizontal directions (total of 16), but as mentioned above, the number of nodes and units in a unit is not limited to the example shown in Figure 1.
[0031] Next, we will explain how to express the Traveling Salesman Problem expressed as a QUBO problem on a Chimera graph. Expressing the Traveling Salesman Problem expressed as a QUBO problem on a Chimera graph is equivalent to expressing the Traveling Salesman Problem as a QUBO problem and appropriately assigning the variables of its objective function to the nodes of the Chimera graph. What constitutes "appropriate" will be explained later. The assignment is expressed by enumerating the nodes to which each of the variables of the QUBO problem, i.e., the variables of the objective function, is assigned. In this case, a single variable may be assigned to multiple nodes.
[0032] The reason behind assigning the variables of the objective function to the nodes of the Chimera graph is that by doing so, the QUBO problem can be solved by a machine that uses the Chimera graph, for example, a quantum annealing machine. Although it does not necessarily have to be a quantum annealing machine, in the following, we will assume that a quantum annealing machine is used to solve the QUBO problem.
[0033] A quantum annealing machine has quantum bits and connections between quantum bits. A quantum bit has two main states, and which of the two states it is in can be treated as a binary variable. It is also possible to define the energy of the entire quantum bit. One method for finding the combination of quantum bit states that results in the lowest energy is called quantum annealing. A quantum annealing machine performs quantum annealing and aims to find the combination of quantum bit states that results in the lowest energy. This can be used to solve the QUBO problem as follows. The two quantum bit states are made to correspond to the variables of the QUBO problem, and the energy of the entire quantum bit is made to correspond to the objective function of the QUBO problem. In this way, obtaining a state with low energy for the entire quantum bit with a quantum annealing machine is equivalent to finding a combination of variables that reduces the value of the objective function of the corresponding QUBO problem.
[0034] In order to make the energy of all the qubits in a quantum annealing machine correspond to the objective function of the QUBO problem, it is necessary to make the two states of the qubits correspond to the variables of the QUBO problem, and to make the coupling between the qubits correspond to the product of the variables in the objective function. The correspondence between the coupling and the product of the variables is established by making the strength of the coupling between the i-th qubit and the j-th qubit equal to Q_ij of the objective function. Then, if all the elements of the objective function matrix Q are similarly made to correspond to the strength of the coupling between the qubits, the energy of all the qubits corresponds to the objective function of the QUBO problem. Therefore, in order to solve the QUBO problem with a quantum annealing machine, it is necessary to input the matrix Q into the quantum annealing machine and adjust the strength of the coupling between the qubits to match Q_ij. However, in the first place, the coupling between the qubits of the quantum annealing machine does not necessarily exist for all combinations of qubits. In fact, the coupling of the qubits in the quantum annealing machine developed by D-Wave Systems Inc. has a chimera graph structure. In other words, the qubits are at the nodes of the chimera graph, and the coupling between the qubits corresponds to the edges of the chimera graph.
[0035] As explained above, there is a correspondence between the variables of the QUBO problem, the quantum bits, and the nodes of the Chimera graph. At the same time, there is also a correspondence between the products of the variables of the QUBO problem, the connections of the quantum bits, and the edges of the Chimera graph. In order to solve the QUBO problem with a quantum annealing machine, the variables of the QUBO problem and the quantum bits are made to correspond to each other, which is equivalent to making the variables of the QUBO problem correspond to the nodes of the Chimera graph. At the same time, it is necessary to make the products of the variables of the QUBO problem correspond to the connections of the quantum bits, so that the products of the variables of the QUBO problem correspond to the edges of the Chimera graph. As explained above, when solving the QUBO problem with a quantum annealing machine, the variables of the problem are assigned to the nodes of the Chimera graph. In addition, the assignment must be such that the products of the variables of the QUBO problem correspond to the edges of the Chimera graph. When this is satisfied, it is an appropriate assignment. When this appropriate assignment is obtained, it is clear which connections between quantum bits on the Chimera graph should correspond to the products of the variables of the QUBO problem. By inputting this assignment and the matrix Q of the QUBO problem into a quantum annealing machine, the strength of the coupling between quantum bits can be made to correspond to the matrix Q. As a result, the quantum annealing machine can solve the QUBO problem.
[0036] As mentioned above, in general, to express a QUBO problem on a Chimera graph, it is necessary to appropriately assign variables to nodes. One variable may be assigned to multiple nodes. To specifically state what kind of assignment is appropriate, we first introduce chains. A chain is a set of nodes to which one variable is assigned, that is, a set of nodes to which the same variable is assigned. Therefore, a chain is a series of nodes connected by edges. However, a chain may have one or more nodes. If there are multiple nodes in a chain, all nodes in the chain must be connected by edges to at least one node in the same chain. Figure 2 is a schematic diagram showing an example of a chain. In Figure 2, the numbers written on the nodes are the chain numbers, and nodes with the same number written belong to the same chain. In Figure 2, four chains, chains 910, 911, 912, and 913, are shown.
[0037] The condition for a proper assignment is a condition required for all pairs of variables that are products in the objective function of the QUBO problem. The condition for a proper assignment is that two chains of pairs of variables that are products in the objective function of the QUBO problem are connected by an edge. A chain is connected by an edge when at least one node in one chain is connected by an edge to at least one node in the other chain. Here, a pair of variables that are products is generally a pair of x_i and x_j represented by i and j where Q_ij ≠ 0 in formula (1). When Q_ij = 0, it is interpreted that the pair of x_i and x_j does not appear as a product in the objective function. However, in formula (1), Q_ij, which is 0, is also expressed in order to maintain generality of expression. When considering the same thing for equation (2), note that the subscripts in equation (2) and equation (1) are different, and that the pair (i, a) of the two subscripts i and a in equation (2) corresponds to i and j in equation (1). Also, in equation (2), the product of x_i and x_j with a coefficient of 0 (i.e., the product of x_i and x_j corresponding to Q_ij = 0) is not originally expressed. In equation (2), x_i,a and x_i,a+1 are multiplied, but x_i,a and x_i+1,a+2 are not multiplied. As a concrete example, if the variable that is multiplied with x_1,1 in equation (2) is represented as x_j,b, j or b corresponds to one of the following four cases. In the first case, j = 1, in the second case, b = 1, in the third case, b = 0, and in the fourth case, b = 2. The first case corresponds to x_1,0, x_1,1, ..., x_1,N-2. The second case corresponds to x_0,1, x_1,1, ..., x_N-2,1. The third case corresponds to x_0,0, x_1,0, ..., x_N-2,0. The fourth case corresponds to x_0,2, x_1,2, ..., x_N-1,2. And x_1,1 is not multiplied with any other variable. The products corresponding to the first and second cases (j = 1 and b = 1) appear when expanding the sum with coefficient C in equation (2). The products corresponding to the third and fourth cases (b = 0 and b = 2) appear in the first sum in equation (2).
[0038] For example, the chain shown in Figure 2 gives an appropriate assignment of the objective function of the QUBO problem expressed by the following formula (3) to a Chimera graph. Formula (3) has four variables in the QUBO problem, and any pair of two variables appears as a product in the objective function. Note that the variable numbers in formula (3) correspond to the chain numbers in Figure 2.
[0039] <Formula (3)>
number
[0040] The background of the conditions for assignment is as follows. As explained assuming that the QUBO problem is solved by a quantum annealing machine, in order to solve the traveling salesman problem, it is necessary to match the product of variables in the objective function of the QUBO problem with the edges of the Chimera graph. Therefore, the condition for assigning variables to nodes is, simply put, that the nodes to which two variables that are a product in the objective function are assigned are connected by an edge. However, in a Chimera graph, not all pairs of nodes are connected by an edge, so this cannot necessarily be achieved. Therefore, chains are used.
[0041] The nodes in a chain are assigned the same variables in the QUBO problem. Therefore, if the chains are connected by an edge, the product of the variables corresponding to the two chains can be expressed on the Chimera graph. Therefore, by constructing the chains well, it is possible to express all products of variables in the objective function as edges between chains on the Chimera graph. In fact, an example of this method is given in Non-Patent Document 1. The above is the background of the above-mentioned conditions.
[0042] When assigning variables to nodes on a Chimera graph to solve a problem using a quantum annealing machine, there is a point to be aware of. The quantum annealing machine solves the problem only by obtaining information about the problem on the Chimera graph, and is not aware of the original problem before the assignment. In other words, the quantum annealing machine is not aware of the existence of the chain, and is solving a problem in which the qubits of the nodes in the chain are different variables. However, from the perspective of the person solving the original QUBO problem, the states of the qubits of the nodes in the chain must all be the same. This is because the nodes in the chain are assigned the same variables in the original QUBO problem. Therefore, the bonds between the qubits corresponding to the edges connecting the nodes in the chain provide a strong interaction, so that the qubits of the nodes in the chain end up in the same state. The strength of this bond is specified when solving the problem with the quantum annealing machine.
[0043] The fact that the quantum annealing machine solves problems with different nodes on the Chimera graph as different variables also means that for one QUBO problem, if variables are assigned to the Chimera graph by different assignments, the representation of the problem on the Chimera graph obtained by those different assignments will be recognized as a different problem by the quantum annealing machine. Therefore, when different assignments exist, it is necessary to consider which assignment should be made.
[0044] In general, an assignment that satisfies the above conditions for a particular problem is not unique. Among the multiple possible assignments, an assignment that uses fewer nodes is preferable. This is because, when solving a problem using a quantum annealing machine or the like, it tends to be more difficult to obtain the correct answer if more nodes on the Chimera graph are used. The reason is as follows.
[0045] First, when solving a QUBO problem, the more variables there are, the more combinations there are, so it is generally more difficult to get the correct answer. This can also be said to take longer to calculate to reliably get the correct answer. The problem that a quantum annealing machine actually solves is expressed on a Chimera graph, and the number of variables in the problem that the quantum annealing machine solves is the number of nodes used on the Chimera graph. Therefore, if the number of nodes used by the assignment is large, the number of variables in the problem that the quantum annealing machine solves will also increase, making it more difficult to get the correct answer. In other words, even if the original QUBO problem is the same, if a different assignment is made, the difficulty of getting the correct answer using the quantum annealing machine will change. Therefore, among the multiple possible assignments, an assignment that uses fewer nodes is preferable.
[0046] The above-mentioned Non-Patent Document 1 and Non-Patent Document 2 are not aimed at finding an allocation with a small number of nodes used. It is not easy to find an allocation that satisfies the conditions for an appropriate allocation and uses a small number of nodes. Therefore, in this disclosure, an embodiment will be described in which a correspondence relationship can be obtained that suppresses the number of nodes used as a correspondence relationship between the variables of a QUBO problem corresponding to a traveling salesman problem and the nodes of a graph for solving this QUBO problem.
[0047] <Outline of the embodiment> Before describing the embodiment in detail, an overview will be given. In this embodiment, when the traveling salesman problem is expressed as a QUBO problem and expressed on a chimera graph to solve it, a method is provided for assigning variables of the QUBO problem to nodes on the chimera graph. In the following description, the variables of the QUBO problem, i.e., binary variables, are also referred to as QUBO variables.
[0048] In this embodiment, when assigning variables of a QUBO problem to multiple nodes on a Chimera graph, the aim is to reduce the total number of nodes used by configuring a chain with a small number of nodes. The policy for configuring a chain with a small number of nodes is as follows.
[0049] The variables of the QUBO problem are assigned to the chains. For pairs of variables that appear in the form of a product in the objective function of the QUBO problem, the pair of variables and the pair of corresponding chains must be connected by edges on the Chimera graph. In the objective function, variables appear in the form of a product with other variables, but there are multiple variables that can be products of one variable. For example, in formula (2), x_1,1 is a product of x_1,2, and also a product of x_2,1. The product of x_1,1 and x_1,2 appears when the first sum of formula (2) and the sum with coefficient C are expanded. The product of x_1,1 and x_2,1 appears when the sum of formula (2) with coefficient C is expanded. In this way, since there are multiple variables that are products of one variable, the chain must be connected to multiple different chains by edges. There are six edges going out from one node on the Chimera graph whose unit is K(4) (however, some nodes in the unit at the edge of the graph have five edges). In order for one chain to be connected to more than one chain via edges, the chain must be composed of multiple nodes.
[0050] A connection of one chain (here called A) to multiple chains (here, two chains called B and C) by edges will be described with reference to FIG. 3. In FIG. 3, the chain corresponding to chain A is represented by reference numeral 920A, the chain corresponding to chain B is represented by reference numeral 920B, and the chain corresponding to chain C is represented by reference numeral 920C. In order for chain A to be connected to chains B and C by edges, chain A must include a node (here called b) connected to chain B and a node (here called c) connected to chain C by an edge. As described above, since the nodes in a chain must be connected by edges, in order to include nodes b and c in chain A, they must be connected via edges and nodes. Connecting via edges and nodes means the following. That is, node d connected to node b by an edge, node e connected to node b by an edge, and node f connected to node b by an edge are included in the chain, and finally node g connected to node c by an edge is included in the chain. An example of such a connection relationship is shown in FIG. 3. In this case, multiple nodes are used in some cases, which increases the number of nodes in the chain. When nodes other than node b and node c in chain A (i.e., the above-mentioned nodes d, e, f, and g) fall into one of the following two cases, those nodes are included in chain A only to connect node b and node c. The two cases are when the node is not connected to other chains by an edge, and when the node is connected by an edge only to a chain to which a QUBO variable that does not become a product in the objective function is assigned. A node that falls into either of these two cases does not directly contribute to the product of the variables in the original QUBO problem. Reducing the number of these nodes is a means for configuring a chain with a small number of nodes in this embodiment. As mentioned above, a QUBO variable that does not become a product in the objective function is generally a pair of x_i and x_j for i and j where Q_ij = 0 in equation (1).When considering the same thing with respect to equation (2), note that the subscripts in equation (2) and equation (1) are different, and that the pair (i, a) of the two subscripts i and a in equation (2) corresponds to i, j, etc. in equation (1). If the variables in equation (2) that are not products of x_i,a are represented as x_j,b, j and b do not satisfy any of the following four cases. The first unsatisfied case is j = i. The second unsatisfied case is b = a. The third unsatisfied case is b = a-1. The fourth unsatisfied case is b = a+1.
[0051] Next, we outline a method for reducing the number of nodes as mentioned above. The nodes as mentioned above are nodes that are not connected to other chains by edges, and nodes that are connected only to chains that are assigned QUBO variables that are not products in the objective function. The method consists of four steps.
[0052] In the first process, which nodes are to be included in the same chain are determined in the same way as in Non-Patent Document 1. Here, the variables of the QUBO problem to be assigned to each chain are not determined. At this time, the nodes that compose each chain are determined so that all nodes in the chain share the same units as the nodes of a predetermined number of other chains (specifically, r-1). In the second process, variables are assigned to the chains. At this time, variables are assigned so that in each chain, nodes (called node a) that satisfy the following conditions are gathered at the end of the chain. To explain the conditions, consider a chain that includes node a and another chain that is connected to node a by an edge. The condition is that for all chains connected to node a by an edge, the QUBO variables assigned to the chain and the QUBO variables assigned to the chain to which node a belongs do not appear in the form of a product in the objective function. In other words, node a can also be said to be a node that is not connected to a node to which a variable that constitutes a product with the variable assigned to node a is assigned. In this way, node a is a node that is not connected by an edge to a chain to which a binary variable that is a product in the objective function of the QUBO problem is assigned. In the second process, a binary variable is assigned to the chain so that at least one of node a is placed at the end of the chain. The specific variable assignment will be described later. A node that is connected by an edge only to a chain corresponding to a QUBO variable that is not a product in the objective function does not need to be included in that chain. Therefore, in the third process, a node that satisfies the above condition is removed from the end of the chain. That is, node a is removed from the end of the chain. Since removing a node from the end does not split the chain into two, unnecessary nodes that satisfy the above condition can be removed. Nodes that satisfy the above condition that are not at the end of the chain cannot be removed because removing them would break the chain. However, in the fourth process, the number of such nodes is reduced by changing the position of the nodes used. The specific changes will be described below.
[0053] Hereinafter, the embodiments will be described in detail with reference to the drawings. [Embodiment 1] In the first embodiment, assignment of variables to nodes when the number of nodes included in a unit of a chimera graph is a predetermined value (specifically, 4) will be described. [Configuration Description] FIG. 4 is a schematic diagram showing an example of the computation system 10 according to the first embodiment. In this embodiment, the assignment device 100 determines the correspondence between the variables and the nodes of the QUBO problem. In the computation system 10 shown in FIG. 4, it is assumed that the quantum annealing machine 200 is used to solve the traveling salesman problem. Note that, instead of the quantum annealing machine 200, any other device that solves the QUBO problem using a chimera graph may be used. In addition, the computation system 10 includes a computation device 300 and an input / output device 400 as auxiliary devices for inputting a problem to the quantum annealing machine 200 and obtaining an output of the computation result. Thus, in the example shown in FIG. 4, as an example, the computation system 10 has the assignment device 100, the quantum annealing machine 200, the computation device 300, and the input / output device 400.
[0054] The allocation device 100 is a device that receives the number of cities N in the traveling salesman problem as an input and outputs information indicating the correspondence between the variables of the QUBO problem and the nodes of the chimera graph. In this embodiment, information indicating the correspondence between the variables of the QUBO problem and the nodes of the chimera graph is input to the input / output device 400. Information may be input to the input / output device 400 via a user's input operation, or may be input directly from the allocation device 100. The calculation device 300 is a device that receives the distance between cities in the traveling salesman problem to be solved (W_ij in formula (2)) as an input and outputs the coefficients of the variables of the QUBO problem. In this embodiment, the calculation device 300 also receives the value of C shown in formula (2) as an input, but the calculation device 300 may not receive the input of this value and may use a predetermined value as the value of C. In this embodiment, the coefficients of the variables of the QUBO problem calculated by the calculation device 300 are input to the input / output device 400. The input of coefficients to the input / output device 400 may be performed via a user's input operation, or may be directly input from the calculation device 300. The input / output device 400 is a device that performs input / output processing with the quantum annealing machine 200. Based on the output results of the allocation device 100 and the calculation device 300, the input / output device 400 outputs the quantum bits to be used and the strength of the coupling between the quantum bits to the quantum annealing machine 200. In addition, the input / output device 400 acquires the final state of the quantum bits from the quantum annealing machine 200, and outputs a solution to the QUBO problem.
[0055] The allocation device 100 , the calculation device 300 , and the input / output device 400 are so-called classical computers, and some or all of the functions of the calculation device 300 and the input / output device 400 may be incorporated into the allocation device 100 .
[0056] In addition, some or all of the allocation device 100, the quantum annealing machine 200, the calculation device 300, and the input / output device 400 may be realized by the cloud. For example, only the quantum annealing machine 200 and the input / output device 400 may be realized by the cloud. When only the quantum annealing machine 200 and the input / output device 400 are realized by the cloud, the output from the allocation device 100 and the calculation device 300 may be input to the input / output device 400 via a network. Then, the output of the input / output device 400 is input to the quantum annealing machine 200, and the output from the quantum annealing machine 200 is input to the input / output device 400. Furthermore, the output of the calculation result from the input / output device 400 is performed via a network.
[0057] As described above, the allocation device 100 receives the number of cities in the traveling salesman problem as an input. Then, based on the expression of the objective function (equation (2)) of the QUBO problem corresponding to the traveling salesman problem, the allocation device 100 outputs information indicating to which node on the Chimera graph of K(4) units should allocate the variables of the objective function.
[0058] The calculation device 300 also receives as input the distance W between cities in the traveling salesman problem to be solved and a parameter C. As the value of the parameter C, a predetermined large value is input that allows the combination of the x values that minimize H to be considered as a solution to the traveling salesman problem. Then, the calculation device 300 calculates and outputs the coefficients of the QUBO variables of the objective function shown in formula (2) based on this input. The coefficients of the QUBO variables mean Q_ij when formula (2) is expressed as formula (1). Specifically, the calculation device 300 outputs a list of the coefficients of the variables x_i,a and the coefficients of the products of the variables x_i,a and x_j,b for i, j = 0, 1, 2, ..., N-2 and a, b = 0, 1, 2, ..., N-2. The calculation performed by the calculation device 300 is the expansion of a quadratic expression of the variables of the QUBO problem, and can be easily calculated.
[0059] The output (allocation result) of the allocation device 100 and the output (coefficients of QUBO variables) of the calculation device 300 are input to the input / output device 400. Furthermore, the user specifies the strength of the bond between the quantum bits corresponding to the edges connecting the nodes in the chain (chain strength), and inputs the value of that strength to the input / output device 400. This value is input so that all quantum bits of the nodes in the chain are in the same state. The chain strength specified here is the same for all chains.
[0060] The input / output device 400 uses the allocation result, the coefficients of the QUBO variables, and the chain strength to determine the quantum bits to be used in the quantum annealing machine 200, and calculates the strength of the coupling between the quantum bits. The strength of the coupling between the quantum bits calculated here includes the strength of the coupling corresponding to the edges in the chain, all of which are equal to the specified chain strength. The input / output device 400 then inputs the list of quantum bits to be used and the strength of the coupling between the quantum bits to the quantum annealing machine 200.
[0061] The quantum annealing machine 200 realizes the strength of the quantum bit coupling specified by the input for the quantum bits specified by the input. The quantum annealing machine 200 then executes quantum annealing and outputs a list indicating the final quantum bit states to the input / output device 400. The input / output device 400 converts the list indicating the quantum bit states into a list indicating the values of QUBO variables, and outputs it to an output device (not shown) (for example, a display or an electronic file).
[0062] The relationship between the Chimera graph and the quantum annealing machine is as described above. That is, which quantum bits of the quantum annealing machine 200 are coupled to which quantum bits correspond to the structure of the Chimera graph. That is, the quantum bits are at the nodes of the Chimera graph, and the coupling between the quantum bits corresponds to the edges of the Chimera graph. The quantum bits are composed of two states, and which state they are in can be treated as a binary variable. This binary variable can then be made to correspond to the variables of the QUBO problem. By making the QUBO problem correspond to the Chimera graph and making the values of the QUBO variables assigned to the nodes on the Chimera graph correspond to the states of the quantum bits, the quantum annealing machine 200 can solve the QUBO problem. However, when making the QUBO problem correspond to the Chimera graph, it is necessary to appropriately assign the variables of the QUBO problem to the nodes on the Chimera graph, as described above.
[0063] The allocation device 100 will be described in detail below. FIG. 5 is a block diagram showing an example of a functional configuration of the allocation device 100. As shown in FIG. 5, the allocation device 100 includes an input receiving unit 101, an allocation unit 102, and an output unit 103. The input receiving unit 101 receives an input of the number of cities N of the traveling salesman problem. This input is input, for example, via an input device (not shown) such as a keyboard. For example, a user inputs the number of cities N of the traveling salesman problem to be solved. The allocation unit 102 performs a process of allocating binary variables according to the number of cities of the traveling salesman problem expressed as a QUBO problem to nodes on a Chimera graph. At this time, the allocation unit 102 preferentially allocates a pair of binary variables that are a product in the objective function of the QUBO problem to nodes connected to each other by edges in the Chimera graph, over a pair of binary variables that are not a product in the objective function of the QUBO problem. The output unit 103 outputs information indicating the correspondence between the binary variables and the nodes based on the result of the assignment of the binary variables to the nodes by the assignment unit 102. For example, the output unit 103 outputs to an output device (not shown) such as a display. The output unit 103 outputs, for example, a list indicating the correspondence between the binary variables and the nodes. For example, the output unit 103 outputs a list enumerating the nodes on the Chimera graph to which the variables x_i,a are assigned, for i = 0, 1, 2, ..., N-2 and a = 0, 1, 2, ..., N-2, that is, a list of lists. For example, if x_0,0 is assigned to nodes 0 and 1, x_0,1 is assigned to nodes 2 and 3, x_1,0 is assigned to nodes 4 and 5, and x_1,1 is assigned to nodes 6 and 7, the output unit 103 outputs information represented as {x_0,0: [0, 1], x_0,1: [2, 3], x_1,0: [4, 5], x_1,1: [6, 7]}.
[0064] Fig. 6 is a block diagram showing an example of a hardware configuration of the allocation device 100. As shown in Fig. 6, the allocation device 100 includes a network interface 150, a memory 151, and a processor 152. The network interface 150, the memory 151, and the processor 152 are connected to each other via a data bus or the like.
[0065] The network interface 150 is used to communicate with any other device and may include, for example, a network interface card (NIC).
[0066] The memory 151 is configured, for example, by a combination of a volatile memory and a non-volatile memory. The memory 151 is used to store software (computer programs) including one or more instructions executed by the processor 152, data used for various processes of the allocation device 100, and the like.
[0067] The processor 152 reads out and executes software (computer programs) from the memory 151 to perform processing of each of the components shown in FIG.
[0068] The processor 152 may be a microprocessor, a microprocessor unit (MPU), a central processing unit (CPU), etc. The processor 152 may include multiple processors. In this manner, the allocation device 100 functions as a computer, and is also called an information processing device.
[0069] The above-mentioned program can be stored and supplied to a computer using various types of non-transitory computer readable media. The non-transitory computer readable medium includes various types of tangible storage media. Examples of the non-transitory computer readable medium include magnetic recording media (e.g., flexible disks, magnetic tapes, hard disk drives), magneto-optical recording media (e.g., magneto-optical disks), CD-ROM (Read Only Memory), CD-R, CD-R / W, and semiconductor memory (e.g., mask ROM, PROM (Programmable ROM), EPROM (Erasable PROM), flash ROM, RAM (Random Access Memory)). The program may also be supplied to a computer by various types of transitory computer readable media. Examples of the transitory computer readable medium include electric signals, optical signals, and electromagnetic waves. The transitory computer readable medium can supply the program to a computer via a wired communication path such as an electric wire and an optical fiber, or via a wireless communication path.
[0070] The allocation by allocation section 102 will now be described. First, before describing the details of the allocation by the allocation unit 102, an outline of the allocation will be given. The outline is as follows. As described above, the allocation is based on four processes. However, in the actual allocation process of the allocation unit 102 of the allocation device 100, these four processes are not passed through. The allocation device 100 stores an allocation formula (lookup table) that realizes the allocation based on the four processes in, for example, the memory 151 in advance. A plurality of types of this allocation formula are prepared according to the number of cities. When the input reception unit 101 receives the value of the number of cities, the allocation unit 102 refers to the allocation formula according to the received number of cities and performs the allocation. Therefore, it can be said that the four processes explain the background against which the allocation formula stored in the allocation device 100 was determined. The allocation unit 102 may function as a processing unit that performs each of the above-mentioned four processes. In other words, in the actual allocation process, the above-mentioned four processes may be passed through.
[0071] Here, we consider the case where the unit of the chimera graph is K(4). In the first process, which nodes are included in the same chain are determined in the same way as in Non-Patent Document 1. Specifically, which nodes are included in the same chain are determined according to Equation (5) described later. In this method, all nodes in each chain share the same unit as the nodes in the other three chains. In other words, there exist chains A, B, C, and D such that the unit containing the node of chain A always contains the nodes of chains B, C, and D. If the total number of chains is a multiple of 4, then the total number of chains is divided into groups of four, such as chains A, B, C, and D. If the total number of chains is not a multiple of 4, then one group is generated with the number of chains equal to the remainder when divided by 4. Hereafter, a group consisting of these four chains will be called a bundle. If there is a remainder, the group consisting of the remainder chain will also be called a bundle. The reason why the number of chains in a bundle is 4 or less is because the chimera graph considered here is K(4), i.e., r = 4. In other words, when a chimera graph with unit K(r) is used, the number of chains in a bundle is r or less.
[0072] FIG. 7 shows an example of a bundle. This shows a bundle resulting from the first process when the QUBO problem has eight variables. Note that FIG. 7 is a diagram for understanding bundles, and when the traveling salesman problem is expressed as a QUBO problem, there are not exactly eight variables. In FIG. 7, the number written on the node indicates the number of the chain to which the node belongs. Chains 930, 931, 932, and 933 share units at all nodes, and these chains constitute bundle 940A. Chains 934, 935, 936, and 937 similarly constitute bundle 940B. Therefore, in this case, there are two bundles. When a bundle consists of four chains, the number of bundles that can use one unit is two or less. For example, the unit in the lower left of FIG. 7 is used by two bundles, the units in the upper left and lower right are both used by one bundle, and there is no bundle that uses the unit in the upper right.
[0073] In the second process, variables are assigned to chains. At this time, the chains in the bundle are assigned the same variable a among the variables x_i,a. However, if the number of possible values of i, that is, N-1, is greater than 4, the assignment destination is split into multiple bundles. In this case, the number of bundles to which the same variable a is assigned is ceil(N-1 / 4). Here, ceil(·) is the ceiling function. In other words, ceil(y) is the smallest integer equal to or greater than y. The specific method of assignment here will be described later.
[0074] In the third process, starting from the end of the chain, remove nodes that are connected by edges only to chains that correspond to QUBO variables that do not result in a product in the objective function. There are nodes other than the ends of the chain that are connected by edges only to chains that correspond to QUBO variables that do not result in a product in the objective function, but these nodes cannot be removed because removing them would split the chain. Therefore, in the fourth process, the nodes used by the chain are changed to reduce the number of such nodes, and the final allocation is determined.
[0075] The node change in the fourth process will be described with reference to FIG. 8 and FIG. 9. In FIG. 8 and FIG. 9, the nodes on the Chimera graph used in the allocation of QUBO variables are divided into blocks. Here, FIG. 8 shows the allocation based on Non-Patent Document 1, and FIG. 9 shows the allocation according to this embodiment. In the example shown in FIG. 8 and FIG. 9, N=9 is assumed. In FIG. 8, blocks 800A, 800B, 800C, and 800D are used. Note that block 800E is a block composed of a part of block 800C. Also, in FIG. 9, blocks 810A, 810B, and 810E are used. Block 810A corresponds to block 800A, block 810B corresponds to block 800B, and block 810E corresponds to block 800E. Note that details regarding which nodes each block contains will be described later.
[0076] In the change from the state shown in FIG. 8 to the state shown in FIG. 9, first, block 800D is removed. This is exactly what is done in the third process. Next, instead of using the nodes in blocks 800B and 800C in FIG. 8, the use of nodes is changed to use the nodes in blocks 810B and 810E in FIG. 9, respectively. This makes it possible to remove nodes related to block 800C in particular from the list of nodes to be used. This leads to removing nodes that were not at the end of the chain in the assignment shown in FIG. 8 from the list of nodes that are connected by edges only to chains corresponding to QUBO variables that are not products in the objective function. However, the change of nodes in this fourth process is only performed when N>5. When N≦5, the chain is not long enough to perform this process. When N>5, there are multiple bundles consisting of chains that assign the same variable a among the variables x_i,a. In FIG. 8, they are divided into two groups, the bundle included in block 800A and the bundle included in block 800B. Similarly, they are divided into two sets in Fig. 9 as bundles contained in block 810A and bundles contained in block 810B. The description of the allocation differs depending on the number of bundles contained in each set, but there are general rules for their description, as shown below.
[0077] Next, the allocation method will be explained in detail. To explain the allocation method in detail, first, numbers are assigned to the positions of nodes on the Chimera graph. The kth node of the unit in the mth row and nth column is numbered (L×m + n)×8 + k. Thus, for example, the node numbers when L=2 are shown as in Figure 10. In the graph shown in Figure 10, the numbers written on the nodes are the node numbers. The function that gives the number of the corresponding node when m, n, and k are determined is f(m, n, k), and is expressed by the following equation (4).
[0078] <Formula (4)>
number
[0079] Here, m, n, and k are integers equal to or greater than 0. In this embodiment, since binary variables are assigned to a chimera graph with K (4) units, k = 0, 1, 2, ..., 7. The upper limit of m and n is L-1. That is, m, n = 0, 1, 2, ..., L-1. L is an arbitrary integer greater than N × N / 4.
[0080] As described above, in the first process, it is decided which nodes are to be included in the same chain in the same way as in the method of Non-Patent Document 1. Here, the chains are distinguished by number s (where s is an integer equal to or greater than 0). The node to be included in the sth chain is the node expressed by formula (5).
[0081] <Formula (5)>
number
[0082] t and u are uniquely determined by the value of s. t is the largest integer less than or equal to s / 4. That is, t = floor(s / 4). Here, floor(·) is the floor function. That is, floor(y) is the largest integer less than or equal to y. u is the remainder when s is divided by 4 (u = s - 4×floor(s / 4)). The relationship s = 4×t + u also holds. For example, when s = 1, t = 0 and u = 1, and when s = 6, t = 1 and u = 2. From these relationships, chains are differentiated by the number s and are also represented as (t, u). For example, chain 1 is also represented as chain (0, 1). Equation (5) is written in the order in which the nodes connected by edges are arranged. Therefore, in formula (5), each node is directly connected to the nodes listed next to it by edges, but is not directly connected to nodes not listed next to it. For example, f(t,1,u+4) is connected to f(t,0,u+4) and f(t,2,u+4) by edges, but is not connected to other nodes that appear in formula (5). Due to this relationship, f(t,0,u+4) and f(L-1,t,u) are called the ends of the chain.
[0083] In the construction of this chain, only the unit in the mth row and nth column, where n≦m≦N-2, is used. There are eight chains that include the node of the unit in the mth row and nth column: chains (m, 0), (m, 1), (m, 2), (m, 3), (n, 0), (n, 1), (n, 2), and (n, 3). In particular, the first four chains use four vertical nodes in the unit, and the remaining four chains use four horizontal nodes in the unit. As is clear from the unit structure shown in Figure 1, each of the former four chains is connected to each of the latter four chains by an edge. For example, chain (m, 0) is connected to chains (n, 0), (n, 1), (n, 2), and (n, 3) by an edge. The former four chains and the latter four chains do not share other units. In other words, chain (m, h) and chain (n, v) are connected by an edge only at the unit in the mth row and nth column.
[0084] Chain (m, h) is connected to chain (n, v) by an edge at the unit in row m and column n, and the nodes that connect the two chains by an edge are f(m, n, h+4) and f(m, n, v). Here, f(m, n, h+4) is a node that belongs to chain (m, h), and f(m, n, v) is a node that belongs to chain (n, v). This is because the nodes of chain (m, h) are those for which t = m in formula (5), and the node included in the unit in row m and column n is f(m, n, h+4). Similarly, the nodes of chain (n, v) are those for which t = n in formula (5), and the node included in the unit in row m and column n is f(m, n, v). Considering the order of the nodes in equation (5), chain (m, h) and chain (n, v) are connected at the end nodes of the chains if the difference between m and n is larger.
[0085] The variables of the QUBO problem are assigned to the chain in the second to fourth steps described above. The description of the assignment method differs depending on the value of N. The assignment is performed by dividing the bundles into two sets. Therefore, the assignment differs greatly depending on the number of bundles for the same a's x_i,a. If there is one bundle for the same a's x_i,a, it is not divided into two sets. If there are two bundles for the same a's x_i,a, it is divided into two sets, and the number of bundles in each set is 1. If there are three or four bundles for the same a's x_i,a, it is divided into two sets, and the number of bundles in each set is 1 or 2. The description of the assignment differs depending on whether it is divided into sets and the number of bundles in the set with the more bundles when it is divided (2 if there are three bundles above).
[0086] First, consider the case where N = 4, 5, that is, the number of bundles (ceil(N-1 / 4)) for the same a for x_i,a is 1. In this case, in the second process, the variables x_i,a are assigned to the s-th chain determined by the relationship s = 4×a + i. The nodes of the s-th chain are determined in the first process, specifically, as given by equation (5).
[0087] The third step is to remove the nodes f(N-1, a, i), f(N, a, i), f(N+1, a, i), ..., f(L-1, a, i) from chain (a, i), which is the chain corresponding to variable x_i,a. The reason is that the chain to which these nodes are connected by edges does not correspond to variables in the objective function. For example, f(N-1, a, i) is a node connected by an edge to chain (N-1, j), but the variable x_N-1,j corresponding to this chain (N-1, j) does not exist in the objective function.
[0088] When N = 4, 5, the fourth step is not performed. This is because the chains obtained in the steps so far do not have nodes that are connected by edges only to chains corresponding to QUBO variables that are not products in the objective function. Therefore, the assignment determined in the third step becomes the final assignment.
[0089] In order to realize the allocation corresponding to the above-mentioned process, when N = 4, 5, the allocation unit 102 allocates the variables x_i,a of the QUBO problem in equation (2) to the N nodes expressed in equation (6) below for the input N.
[0090] <Formula (6)>
number
[0091] As mentioned above, when the number of bundles (ceil(N-1 / 4)) for x_i,a of the same a is 1, it means that x_i,a with the same a but different i are assigned to nodes in the same unit. Indeed, for a node in formula (6), the unit it contains does not depend on i. This can be seen from the fact that m and n in f(m,n,k) specify the unit as the unit in the mth row and nth column, and i is not included in the part corresponding to m and n in formula (6). In other words, the unit used by a bundle for x_i,a of the same a is determined by a, and which node in the unit a chain in the bundle uses is determined by i.
[0092] FIG. 11 is a schematic diagram showing an example of an allocation result according to the present embodiment, specifically, an allocation result when variables of an objective function of a QUBO problem of a traveling salesman problem with N=5 are allocated to nodes on a Chimera graph with K(4) units. In FIG. 11, the symbols of the chains correspond to the subscripts of the variables x_i,a allocated to the chains. That is, the chain C"i""a" means the chain to which the variables x_i,a are assigned. For example, in FIG. 11, the chain C00 is the chain to which the variables x_0,0 are assigned, and the chain C01 is the chain to which the variables x_0,1 are assigned. In addition, FIG. 12 shows a group of units used by each bundle in the allocation shown in FIG. 11. In FIG. 12, the bundle 950 is the bundle corresponding to x_i,0 (where i=0,1,2,3). Similarly, bundle 951 is the bundle corresponding to x_i,1 (where i=0,1,2,3), bundle 952 is the bundle corresponding to x_i,2 (where i=0,1,2,3), and bundle 953 is the bundle corresponding to x_i,3 (where i=0,1,2,3).
[0093] As can be seen from Figures 11 and 12, there is a unit shared by two different bundles, and in that unit, any chain of each bundle is connected by an edge. In other words, it is possible to express an objective function in which a QUBO variable assigned to a chain of one bundle appears in the form of a product with any QUBO variable assigned to the other bundle. And for any pair of two bundles, such a shared unit exists. Therefore, chains belonging to any different bundles are connected by an edge. Also, in a unit used only by one bundle, different chains in the bundle are connected by edges, so the product in the objective function of the QUBO variables corresponding to those chains can be expressed. The configuration of the chains in this unit used only by one bundle is the same as the configuration shown in Figure 2. As a result, any two chains are connected by an edge. If this assignment is used, the appropriate assignment will be made no matter which two QUBO variables appear as a product in the objective function of the QUBO problem. Therefore, the objective function of the traveling salesman problem will also be an appropriate assignment. However, in the traveling salesman problem, there are pairs of QUBO variables that do not form a product in the objective function, so when N>5, allocation is made taking this into consideration.
[0094] Next, consider the case where 6≦N≦9, that is, the number of bundles (ceil(N-1 / 4)) for the same a x_i,a is 2. For the input N, the allocation device 100 performs different allocations expressed by different formulas for two bundles for the same a x_i,a among the variables x_i,a of the QUBO problem in formula (2). x_i,a for i = 0, 1, 2, 3 correspond to one bundle, and x_i,a for i = 4, 5, ..., N-2 correspond to another bundle.
[0095] In the second step, the variables x_i,a for i = 0, 1, 2, 3 are assigned to the s-th chain determined by the relationship s = 4×a + i. The nodes of the s-th chain are determined in the first step, specifically given by equation (5). This chain is also represented as chain(a, i). The variables x_i,a for i = 4, ..., N-2 are assigned to the s-th chain determined by the relationship s = 4×(N - 1 + a) + i-4. This chain is also represented as chain((N-1)+a, i-4).
[0096] In the allocation so far, we explain that nodes that can be removed from the chain, i.e., nodes that are connected by edges only to chains corresponding to QUBO variables that are not products in the objective function, are concentrated at the ends of the chain. In this regard, it plays an important role that the greater the difference between m and n, the more likely it is that chain (m, h) and chain (n, v) will be connected at the ends of the chain. If the variables x_i,a that are products in the objective function are represented as x_j,b, j and b correspond to at least one of the following four cases. That is, as mentioned above, the first case is j = i, the second case is b = a, the third case is b = a-1, and the fourth case is b = a+1.
[0097] First, consider the cases where i = 0, 1, 2, 3. In the above-mentioned assignment, x_i,a is assigned to the chain (a, i). Also, x_j,b that satisfies j = i in the first of the above cases, that is, x_i,b is assigned to the chain (b, i). Assuming a ≥ b, the chains (a, i) and (b, i) are connected by an edge only in the unit of the a-th row and b-th column. Therefore, the node f(a, b, i + 4) of the chain (a, i) to which x_i,a is assigned is connected by an edge to the chain (b, i) to which x_i,b is assigned. When a < b, the chains (a, i) and (b, i) are connected by an edge only in the unit of the b-th row and a-th column, and the node f(b, a, i) of the chain (a, i) to which x_i,a is assigned is connected by an edge to the chain (b, i) to which x_i,b is assigned. Thus, the chain of x_i,a is connected by an edge to the chains of x_j,b that satisfies j = i, that is, x_i,0, x_i,1, ..., x_i,N - 2, at the nodes f(a, 0, i + 4), f(a, 1, i + 4), ..., f(a, a, i + 4), f(a, a, i), f(a + 1, a, i), f(a + 2, a, i), ..., f(N - 2, a, i).
[0098] Next, consider at which unit an edge connects the chain (a, i) to which x_i,a is assigned and the chain to which x_j,b, which satisfies b = a in the second case, i.e., the chain to which x_j,a is assigned. This differs depending on whether j is 0, 1, 2, 3, or j = 4, 5, ..., N-2. First, consider the case of j = 0, 1, 2, 3. In this case, x_j,a is assigned to the chain (a, j). And the chain (a, i) and the chain (a, j) are connected by an edge at the unit in row a and column a. In this case, the node f(a, a, i) of the chain (a, i) to which x_i,a is assigned is connected to the chain (a, j) by an edge. Next, consider the case of j = 4, 5, ..., N-2. In this case, x_j,a is assigned to the chain (N-1+a, j-4). Then, chain (a, i) and chain (N-1+a, j-4) are connected by an edge at the unit in row (N-1+a) and column a. In this case, node f(N-1+a, a, i) of chain (a, i) to which x_i,a is assigned is connected to chain (N-1+a, j-4) by an edge.
[0099] Similarly, consider a chain (a, i) to which x_i,a is assigned and a chain to which x_j,b satisfying b = a-1, i.e., a chain to which x_j,a-1 is assigned. These two chains are connected by an edge at the unit in row a, column (a-1) or the unit in row (N-2+a), column a, depending on the value of j. In this case, depending on the value of j, node f(a, a-1, i+4) or node f(N-2+a, a, i) of the chain (a, i) to which x_i,a is assigned is connected by an edge to the chain to which x_j,a-1 is assigned. Also, node f(a+1, a, i) or node f(N+a, a, i) of the chain (a, i) to which x_i,a is assigned is connected by an edge to the chain to which x_j,b satisfying b = a+1, i.e., a chain to which x_j,a+1 is assigned.
[0100] From the above, when i = 0, 1, 2, 3, we can see which nodes are connected by edges to chains corresponding to variables that are products of the objective function for variables x_i,a. These are f(a, 0, i+4), f(a, 1, i+4), ..., f(a, a-1, i+4), f(a, a, i+4), f(a, a, i), f(a+1, a, i), f(a+2, a, i), ..., f(N-2, a, i), f(N-2+a, a, i), f(N-1+a, a, i), f(N+a, a, i). Nodes other than these are nodes that are connected by edges only to chains corresponding to QUBO variables that are not products in the objective function. Specifically, they are f(N-1, a, i), f(N, a, i), ..., f(N-3+a, a, i), f(N+a+1, a, i), f(N+a+2, a, i), ..., f(L-1, a, i). Comparing with equation (5), f(N+a+1, a, i), f(N+a+2, a, i), ..., f(L-1, a, i) can be said to be gathered at the end of the chain. In the third step mentioned above, these nodes are removed from the chain. However, f(N-1, a, i), f(N, a, i), ..., f(N-3+a, a, i) cannot be removed because they play a role in connecting the chain together.
[0101] Next, consider the case where i = 4, 5, 6, ..., N-2. In the above assignment, x_i,a is assigned to the chain (N-1+a, i-4). Also, x_j,b, which satisfies j = i in the first case, that is, x_i,b is assigned to the chain (N-1+b, i-4). In this case, the chain of x_i,a is connected by edges to the chain of x_j,b, that is, x_i,0, x_i,1, ..., x_i,N-2, for j = i, at nodes f(N-1+a, N-1, i), f(N-1+a, N, i), ..., f(N-1+a, N-1+a, i), f(N-1+a, N-1+a, i-4), f(N+a, N-1+a, i-4), f(N+a+1, N-1+a, i-4), ..., f(2N-3, N-1+a, i-4).
[0102] Next, consider the second case, x_j,b, where b = a, that is, the chain to which x_j,a is assigned. For j = 0, 1, 2, 3, node f(N-1+a, a, i) of x_i,a's chain (N-1+a, i-4) is connected to x_j,a's chain (a, j) by an edge at the unit in row (N-1+a), column (a). For j = 4, 5, ..., N-2, node f(N-1+a, N-1+a, i) of x_i,a's chain (N-1+a, i-4) is connected to x_j,a's chain (N-1+a, j-4) by an edge at the unit in row (N-1+a), column (N-1+a).
[0103] Similarly, consider the third case, x_j,b, where b = a-1, that is, x_j,a-1. The chains of x_i,a and x_j,a-1 are connected by an edge at the unit in row (N-1+a) and column (a-1) or at the unit in row (N-1+a) and column (N-2+a), depending on the value of j. In this case, node f(N-1+a, a-1, i) or node f(N-1+a, N-2+a, i) of the chain (N-1+a, i-4) of x_i,a is connected by an edge to the chain of x_j,a-1. In addition, node f(N-1+a, a+1, i) or node f(N+a, N-1+a, i-4) in the chain (N-1+a, i) of x_i,a is connected by an edge to the chain of x_j,b, which satisfies b = a+1, i.e., x_j,a+1.
[0104] From the above, when i = 4, 5, ..., N-2, we can see which nodes are connected by edges to the chains corresponding to the variables that are products of the objective function for the variables x_i,a. These are f(N-1+a, a-1, i), f(N-1+a, a, i), f(N-1+a, a+1, i), f(N-1+a, N-1, i), f(N-1+a, N, i), ..., f(N-1+a, N-1+a, i), f(N-1+a, N-1+a, i-4), f(N+a, N-1+a, i-4), f(N+a+1, N-1+a, i-4), ..., f(2N-3, N-1+a, i-4). Nodes other than these are nodes that are connected by edges only to chains corresponding to QUBO variables that are not products in the objective function. Specifically, they are f(N-1+a, 0, i), f(N-1+a, 1, i), ..., f(N-1+a, a-2, i), f(N-1+a, a+2, i), f(N-1+a, a+3, i), ..., f(N-1+a, N-2, i), f(2N-2, N-1+a, i-4), f(2N-1, N-1+a, i-4), ..., f(L-1, N-1+a, i-4). Comparing with equation (5), f(N-1+a, 0, i), f(N-1+a, 1, i), ..., f(N-1+a, a-2, i) can be said to be concentrated at the end of the chain. Also, f(2N-2, N-1+a, i-4), f(2N-1, N-1+a, i-4), ..., f(L-1, N-1+a, i-4) are gathered at the end of the chain. In the third step described above, these nodes are removed from the chain. However, f(N-1+a, a+2, i), f(N-1+a, a+3, i), ..., f(N-1+a, N-2, i) cannot be removed because they play a role in connecting the chain together.
[0105] In the following, we will explain the fourth step mentioned above. To do so, we will use the blocks on the Chimera graph depicted in Figure 8. However, Figure 8 shows the blocks for N=9. In general, block 800A consists of nodes used only by the chains of x_i,a with i=0, 1, 2, 3, and block 800B consists of nodes used only by the chains of x_i,a with i=4, 5, ..., N-2. Block 800C consists of the remaining nodes used by the chains. Block 800D is the part removed in the third step.
[0106] In the fourth step, nodes that only play a role in connecting chains together are removed from the chain. For example, for i = 0, 1, 2, 3, f(N-1, a, i), f(N, a, i), ..., f(N-3+a, a, i) only play a role in connecting chains together and are not directly involved in the product of the QUBO variables of the objective function. However, they are necessary to connect chains together and cannot be removed. Such nodes are located in block 800C. On the other hand, the nodes in block 800C that directly contribute to the product of the QUBO variables of the objective function are in the units of row (N-2+a), column (N-1+a), column (N+a), and column (N+a) for a = 0, 1, ..., N-2. These are the units of block 800E in the dotted line area of block 800C in Figure 8. The two hypotenuses of block 800E are parallel to the hypotenuses of block 800A and block 800B. Therefore, if block 800E can be placed so that its two hypotenuses are in contact with the hypotenuses of block 800A and block 800B, the remaining part of block 800C (the part of the node that is not directly involved in the product of the QUBO variables of the objective function) becomes unnecessary and can be removed.
[0107] To help understand this fourth process, the arrangement of bundles at the stage where the third process is completed will be described here. FIG. 13 is a schematic diagram showing the arrangement of bundles at the stage where the third process is completed. When N=9, there are 16 bundles 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, and 975. The bundle 960 uses units from row 0, column 0 to row 0, column 9 arranged vertically (column direction). The bundle 961 uses units from row 0, column 1 to row 1, column 1 arranged horizontally (row direction) and units from row 1, column 1 to row 10 arranged vertically (column direction). Similarly, bundle 962 uses the units arranged horizontally (row direction) from row 2, column 0 to row 2, column 2, and the units arranged vertically (column direction) from row 2, column 2 to row 2, column 11. Thus, at the end of the third process, each bundle uses the following unit groups from the nodes of block 800A, block 800B, and block 800C: Each bundle uses the unit in row z, column z (z is an integer equal to or greater than 0) and the unit group connected in the row direction (however, limited to units whose column number is z or less), and the unit in row z, column z and the unit group connected in the column direction (however, limited to units whose row number is z or more).
[0108] In FIG. 13, if the units of the block 800C other than the block 800E are not used, the chain included in the bundle using the unit is disconnected. That is, the series of chains is divided into a partial chain belonging to the block 800A and a partial chain belonging to the block 800E. Or, the series of chains is divided into a partial chain belonging to the block 800B and a partial chain belonging to the block 800E. For this reason, in the fourth process, the nodes to be used are changed so that the first partial chain and the second partial chain connected by an unnecessary node are connected without passing through the unnecessary node. That is, the nodes constituting the chain in the chimera graph are changed so that the two partial chains of the chain including the first partial chain and the second partial chain connected by an unnecessary node are connected without passing through the unnecessary node. Then, the unnecessary node is removed from the chain to determine the final assignment of the binary variables to the nodes. Here, the first partial chain is a partial chain belonging to block 800A or 800B, and the second partial chain is a partial chain belonging to block 800E. The unnecessary node here is a node that is not connected by an edge to a chain to which a binary variable that is a product in the objective function of the QUBO problem is assigned. For this reason, the block 800B is moved, and the block 800C (block 800E) is placed between the block 800A and the block 800B, as shown in FIG. 9.
[0109] In this block movement, block 800A is moved by two units in the column direction (vertical direction) in the direction in which the row number increases. As a result, block 810A in FIG. 9 is used instead of block 800A in FIG. 8. This is to make space for block 810B (block 800B) and block 810E (block 800E). In addition, the change from block 800B to block 810B involves not only translation but also rotation. As a result, block 810B in FIG. 9 is used instead of block 800B in FIG. 8. This also changes the node used by the chain of variable x_i,a (where i = 4, 5, ..., N-2). If variable x_i,a used node f(m, n, k) in block 800B before the movement, after the movement, it will use f(n-(N-1), m-(N-3), k') instead. However, when k<4, k'=k+4, and when k≧4, k'=k-4. Swapping n and m and swapping k and k' represents rotation, while subtracting (N-1) or (N-3) represents translation. In particular, swapping k and k' in rotation represents swapping the nodes used within a unit. In other words, if one of the four nodes arranged horizontally (vertically) within a unit is used before the move, then after the move, one of the four nodes arranged vertically (horizontally) within the unit will be used. Before the move, variables x_i,a used f(N-1+a, N-1, i), f(N-1+a, N, i), ..., f(N-1+a, N-1+a, i), f(N-1+a, N-1+a, i-4), f(N+a, N-1+a, i-4), f(N+a+1, N-1+a, i-4), ..., f(2N-3, N-1+a, i-4), but after the move, they use f(0, a+2, i-4), f(1, a+2, i-4), ..., f(a, a+2, i-4), f(a, a+2, i), f(a, a+3, i), ..., f(a, N, i).
[0110] In addition, the nodes used by the chain of x_i,a in block 800E are also changed by the move. As a result, block 810E in FIG. 9 is used instead of block 800E in FIG. 8. If f(m, n, k) was used before the move, then f(n+2, m-(N-3), k') is used after the move. However, when k<4, k'=k+4, and when k≧4, k'=k-4. Specifically, variables x_i,a used f(N-2+a, a, i), f(N-1+a, a, i), and f(N+a, a, i) before the move, but now use f(a+2, a+1, i+4), f(a+2, a+2, i+4), and f(a+2, a+3, i+4). The remaining nodes in block 800C are removed from the chain.
[0111] Through the above four steps, the final allocation performed by the allocation unit 102 of the allocation device 100 is obtained.
[0112] If 6≦N≦9, the allocation unit 102 of the allocation device 100 allocates x_i,a with i = 0, 1, 2, 3 to the N+3 nodes expressed by equation (7), and allocates x_i,a with i = 4, 5, ..., N-2 to the N+3 nodes expressed by equation (8).
[0113] <Formula (7)>
number
[0114] The allocation in formula (7) is the allocation in formula (6) for N = 4, 5, where m in f(m,n,k) is increased by 2, and three additional nodes f(a+2, a+1, i+4), f(a+2, a+2, i+4), and f(a+2, a+3, i+4) are added. This means that the units used are shifted two units vertically from the allocation in formula (6), and three additional nodes are used. The added nodes correspond to the nodes in block 810E in Figure 9.
[0115] <Formula (8)>
number
[0116] If the node used in the allocation in formula (7) is f(m,n,k), then the node used in formula (8) is f(n,m,k'). However, when k<4, k'=k+4, and when k≧4, k'=k-4. Swapping m and n represents the swapping of the row and column of the unit used, and swapping k and k' represents the swapping of the nodes used within the unit. When formula (7) uses one of the four nodes arranged horizontally (vertically) within the unit, formula (8) uses one of the four nodes arranged vertically (horizontally) within the unit. When considering this, note that formula (7) has i = 0, 1, 2, 3, and formula (8) has i = 4, 5,..., N-2.
[0117] FIG. 14 is a schematic diagram showing an allocation result in the case of N=6 according to the present embodiment. That is, FIG. 14 shows an allocation result when the variables of the objective function of the QUBO problem of the traveling salesman problem of N=6 are allocated to nodes on a Chimera graph with a unit of K(4). In FIG. 14, the symbol of the chain corresponds to the subscript of the variable x_i,a assigned to the chain. That is, the chain D"i""a" means the chain to which the variable x_i,a is assigned. For example, in FIG. 14, the chain D00 is the chain to which the variable x_0,0 is assigned, and the chain D01 is the chain to which the variable x_0,1 is assigned. Also, FIG. 15 shows the unit group used by each bundle in the allocation shown in FIG. 14. In FIG. 15, the bundle 980 is the bundle corresponding to x_i,0 (where i=0,1,2,3). Similarly, bundle 981 is the bundle corresponding to x_i,1 (where i=0,1,2,3). Bundle 982 is the bundle corresponding to x_i,2 (where i=0,1,2,3). Bundle 983 is the bundle corresponding to x_i,3 (where i=0,1,2,3). Bundle 984 is the bundle corresponding to x_i,4 (where i=0,1,2,3). Bundle 985 is the bundle corresponding to x_4,0. Bundle 986 is the bundle corresponding to x_4,1. Bundle 987 is the bundle corresponding to x_4,2. Bundle 988 is the bundle corresponding to x_4,3. Bundle 989 is the bundle corresponding to x_4,4.
[0118] Next, consider the case where N > 9. In this embodiment, the allocation is performed by dividing the bundles into two sets, and the maximum value in each set for the number of bundles for x_i,a of the same a (represented as p) affects the allocation. When N is greater than 9, the number of bundles ceil(N-1 / 4) for x_i,a of the same a becomes greater than 2. Therefore, when the bundles for x_i,a of the same a are divided into two sets, the number of bundles in one set becomes greater than 1. Therefore, the allocation formula is different from the case where N≦9. In order to express them generally, p is used to represent the allocation formula. p for a specific N is p that satisfies 8 (p - 1) + 2≦N≦8×p + 1. For example, when N=9, the number of bundles ceil(N-1 / 4) for x_i,a of the same a is 2, and p=1. When N=10, the number of bundles ceil(N-1 / 4) for x_i,a of the same a is 3, and p=2. When N=17, the number of bundles ceil(N-1 / 4) for the same a for x_i,a is 4, and p=2. Also, when 10≦N≦17, p=2. And when N=18, p=3.
[0119] To consider the case of N>9, let p be an integer greater than or equal to 2. In the second process, for i = 0, 1, 2, ..., 4p-1, the variables x_i,a are assigned to the s-th chain determined by the relationship s = 4×p×a+i. In addition, for i = 4p, 4p+1, ..., N-2, the variables x_i,a are assigned to the s-th chain determined by the relationship s = 4p×(N - 1 + a) + i-4p. The nodes of the s-th chain are determined in the first process, specifically as given by equation (5).
[0120] As in the case of p = 1, the nodes that can be removed from the chain in the assignments up to this point are concentrated at the end of the chain, and in the third step, these nodes are removed from the chain. Specifically, the following nodes are removed. The nodes that can be removed at the end of the chain corresponding to variables x_i,a are f(p(N+a+1), pa+i / / 4, i%4), f(p(N+a+1)+1, pa+i / / 4, i%4), ..., f(L-1, pa+i / / 4, i%4) for i = 0, 1, 2, …, 4p-1. Here, i / / y represents the integer part when i is divided by y (e.g., 3 / / 4 = 0, 4 / / 4 = 5 / / 4 = 1), and i%y represents the remainder when i is divided by y (e.g., 3%4 = 3, 4%4 = 0, 5%4 = 1). For i = 4p, 4p+1, …, N-2, the nodes at the ends of the chain that can be removed are f(p(N-1+a)+i / / 4-p, 0, i%4+4), f(p(N-1+a)+i / / 4-p, 1, i%4+4), ..., f(p(N-1+a)+i / / 4-p, p(a-1)-1, i%4+4) and f(p(2N-2), p(N-1+a)+i / / 4-p, i%4), f(p(2N-2)+1, p(N-1+a)+i / / 4-p, i%4), …, f(L-1, p(N-1+a)+i / / 4-p, i%4).
[0121] The fourth step is performed by considering blocks in the same way as for p=1. Block 800A consists of nodes used only by the chain x_i,a for i=0, 1, ..., 4p-1, block 800B consists of nodes used only by the chain x_i,a for i=4p, 4p+1, ..., N-2, block 800C consists of the remaining nodes used by the chain.
[0122] In block 800C, the nodes that directly contribute to the product of the QUBO variables of the objective function, that is, the nodes that belong to block 800E, are in the units of q(N-2+a) row qa column, q(N-1+a) row qa column, and q(N+a) row qa column for a = 0, 1, ..., N-2 and q = 1, 2, ..., p. As in the case of p = 1, block 800E has two hypotenuses, which are parallel to the hypotenuses of blocks 800A and 800B. Block 800B is moved and block 800C (block 800E) is placed between blocks 800A and 800B, so that the two hypotenuses of block 800E are tangent to the hypotenuses of blocks 800A and 800B. The remaining part of block 800C (the part of the node that is not directly involved in the product of the QUBO variables of the objective function) is excluded.
[0123] In this block movement, block 800A is moved by 2p units in the column direction (vertical direction) in the direction in which the row number increases. As a result, block 810A in FIG. 9 is used instead of block 800A in FIG. 8. In changing block 800B to block 810B, not only translation but also rotation is performed. As a result, block 810B in FIG. 9 is used instead of block 800B in FIG. 8. This also changes the node used by the chain of variable x_i,a (where i = 4p, 4p+1, ..., N-2). If variable x_i,a used node f(m, n, k) in block 800B before the movement, after the movement, it will use f(np(N-1), mp(N-3), k') instead. However, when k<4, k'=k+4, and when k≧4, k'=k-4. Before the move, variables x_i,a are f(p(N-1+a)+i / / 4-p, p(N-1), i%4+4), f(p(N-1+a)+i / / 4-p, N, i%4+4), ..., f(p(N-1+a)+i / / 4-p, p(N-1+a)+i / / 4-p, i%4+4), f(p(N-1+a)+i / / 4-p, p(N-1+a)+i / / 4-p, i%4), f(p(N-1+a)+i / / 4-p+1, p(N-1+a)+i / / 4-p, i%4), f(p(N-1+a)+i / / 4-p+2, p(N-1+a)+i / / 4-p, i%4), ..., f(p(2N-2)-1, Previously, p(N-1+a)+i / / 4-p, i%4) was used, but due to movement, f(0, p(a+2)+i / / 4-p, i%4), f(1, p(a+2)+i / / 4-pi%4), ..., f(pa+i / / 4-p, p(a+2)+i / / 4-p, i%4), f(pa+i / / 4-p, p(a+2)+i / / 4-p, i%4+4), f(pa+i / / 4-p, p(a+2)+i / / 4-p+1, i%4+4), ..., f(pa+i / / 4-p, p(N+1)-1, i%4+4) is used. Note that the meanings of " / / " and "%" are as described above. The nodes used by the chain of x_i,a in block 800E are also changed by the move. As a result, block 810E in Fig. 9 is used instead of block 800E in Fig. 8. If f(m, n, k) was used before the move, then f(n+2p, mp(N-3), k') is used after the move. However, if k<4, then k'=k+4, and if k≧4, then k'=k-4. For example, for variables x_i,a, i = 0, 1, …, 4p-1, before the move, f(p(N-2+a)+i / / 4, pa+i / / 4, i%4), f(p(N-2+a)+i / / 4+1, pa+i / / 4, i%4), …, f(p(N+a+1)-1, pa+i / / 4, i%4) was used, but after the move, f(p(a+2)+i / / 4, p(a+1)+i / / 4, i%4+4), f(p(a+2)+i / / 4, p(a+1)+i / / 4+1, i%4+4), f(p(a+2)+i / / 4, p(a+1)+i / / 4+2, i%4+4), …, f(p(a+2)+i / / 4, p(a+4)-1, i%4+4) The remaining nodes in block 800C are removed from the chain.
[0124] Through the above four steps, the final allocation performed by the allocation unit 102 of the allocation device 100 is obtained.
[0125] When N>9, the allocation unit 102 of the allocation device 100 allocates variables x_i,a of the QUBO problem in formula (2) with i=0, 1, 2, 3 to p(N+3) nodes represented by formula (9) for the input N. In addition, the allocation unit 102 allocates variables x_i,a with i=4p, 4p+1, 4p+2, 4p+3 to p(N+3) nodes represented by formula (10).
[0126] <Formula (9)>
number
[0127] The assignment of Equation (9) is an extension of Equation (7) when 6 ≦ N ≦ 9. The number of nodes used is p times that of Equation (7). The position of the initially described node f(pa + 2p, pa, i) moves p units vertically and horizontally for each increase of a by 1. Among the units in between, there are the other p - 1 bundles for x_i,a with the same a.
[0128] <Equation (10)>
Number
[0129] Let the nodes used in the assignment of Equation (9) be f(m,n,k), then the nodes used in Equation (10) are f(n, m, k’). However, when k < 4, k’ = k + 4, and when k ≧ 4, k’ = k - 4. The interchange of m and n represents the interchange of the rows and columns of the units used, and the interchange of k and k’ represents the interchange of the nodes used within the unit. When using one of the four nodes arranged horizontally (vertically) within the unit in Equation (9), in Equation (10), one of the four nodes arranged vertically (horizontally) within the unit is used. When considering this, note that for Equation (9), i = 0, 1, 2, 3, and for Equation (10), i = 4p, 4p + 1, 4p + 2, 4p + 3.
[0130] Here, we are considering the case where p is an integer greater than or equal to 2. When p = 1, Equation (9) coincides with Equation (7), and Equation (10) coincides with Equation (8). When p = 1, all assignments are completed by Equations (7) and (8). However, when p ≧ 2, there are x_i,a for i other than i = 0, 1, 2, 3, 4p, 4p + 1, 4p + 2, 4p + 3 assigned by Equations (9) and (10), and they have not been assigned yet. This is due to the number of bundles being 3 or more. Using an integer q satisfying 1 ≦ q < p, the i of the unassigned x_i,a is represented as i = 4q, 4q + 1, 4q + 2, 4q + 3, 4(p + q), 4(p + q) + 1, 4(p + q) + 2, 4(p + q) + 3.
[0131] Assign \(x_{i,a}\) with \(i = 4q, 4q + 1, 4q + 2, 4q + 3\) (\(1\leq q\lt p\)) to the nodes, and assign them in order from the ones with smaller values of \(q\). First, consider \(x_{i,a}\) with \(q = 1\) (\(i = 4, 5, 6, 7\)). For this purpose, consider the nodes to which \(x_{i - 4,a}\) has been assigned. Here, \(i - 4 = 0, 1, 2, 3\), and \(x_{i - 4,a}\) has already been assigned to the nodes by Equation (9). Move the row by +1 and the column by +1 in parallel with respect to the unit from the node to which \(x_{i - 4,a}\) has been assigned. That is, if one of the nodes to which \(x_{i - 4,a}\) has been assigned is \(f(m, n, k)\), it means moving to \(f(m + 1, n + 1, k)\). Assign \(x_{i,a}\) to the node at the position after such parallel movement. Since there are \(p(N + 3)\) nodes to which \(x_{i - 4,a}\) has been assigned, assign \(x_{i,a}\) to the nodes after parallel movement in the same way for them. However, do not assign \(x_{i,a}\) to the node \(f(p(N + 1), pa + q, i - 4q)\). Instead, assign \(x_{i,a}\) to \(f(pa + 2p + q, pa + q, i - 4(q - 1))\). Next, consider \(x_{i,a}\) corresponding to \(q = 2\) (\(i = 8, 9, 10, 11\)). Similarly to the above, assign \(x_{i,a}\) to the nodes after parallel movement of the row by +1 and the column by +1 with respect to the unit from the nodes to which \(x_{i - 4,a}\) (\(i - 4 = 4, 5, 6, 7\)) has been assigned. However, do not assign \(x_{i,a}\) to the node \(f(p(N + 1), pa + q, i - 4q)\). Instead, assign \(x_{i,a}\) to \(f(pa + 2p + q, pa + q, i - 4(q - 1))\). Perform the same assignment while increasing \(q\) by 1 up to \(q = p\).
[0132] Next, assign \(x_{i,a}\) to nodes where \(i = 4(p + q)\), \(4(p + q)+1\), \(4(p + q)+2\), \(4(p + q)+3\) (\(1\leq q < p\)). First, start with \(q = 1\). Similar to the above, starting from the position of the node assigned to \(x_{i - 4,a}\), move the row and column by \(+1\) unit in parallel, and assign \(x_{i,a}\) to the node at that position. However, do not assign \(x_{i,a}\) to the node of \(f(pa + q,p(N + 1),i - 4(p + q - 1))\). Instead, assign \(x_{i,a}\) to \(f(pa + q,pa + 2p + q,i - 4(p + q))\). Then, assign \(x_{i,a}\) corresponding to \(q = 2\). While increasing \(q\) by \(1\) each time, perform the same assignment until \(q = p\). Through the above process, the assignment unit 102 of the assignment device 100 assigns all variables \(x_{i,a}\) to nodes.
[0133] [Explanation of Operations] Next, the operations of this embodiment will be described with reference to the drawings. FIG. 16 is a flowchart showing the operation flow of the assignment device 100. Also, FIG. 17 is a flowchart showing the operation flow of the traveling salesman problem (QUBO problem) calculation by the calculation system 10.
[0134] The operation flow of the assignment device 100 will be described while referring to FIG. 16. First, the input reception unit 101 of the assignment device 100 receives the input of the number of cities \(N\) of the traveling salesman problem via an input device (not shown) (step S101).
[0135] Next, the assignment unit 102 of the assignment device 100 represents the traveling salesman problem with the input number of cities as a QUBO problem in the form of formula (2) stored in advance, and assigns the binary variable (QUBO variable) \(x\) to the nodes on the chimera graph (step S102). At this time, only the information on which variables appear in the form of a product in formula (2) is required, and the specific values of \(W\) and \(C\) are not necessary. The assignment unit 102 executes the assignment as described above using the assignment formulas (formulas (6), (7), (8), (9), (10)) corresponding to the value of \(N\).
[0136] Next, the output unit 103 of the allocation device 100 outputs information indicating the correspondence between the binary variables and the nodes based on the allocation result of the allocation unit 102 (step S103). This output may be performed, for example, on an output device (not shown) such as a display, or may be output as an electronic file.
[0137] Next, a description will be given of the flow of calculation operations for the traveling salesman problem (QUBO problem) by the calculation system 10. When the problem is solved by the quantum annealing machine 200, the flow of operations is as shown in the flowchart of FIG.
[0138] First, the output of the allocation device 100 (list of allocations) and the output of the calculation device 300 (coefficients of QUBO variables) are input to the input / output device 400 (step S201). Furthermore, in step S201, the user specifies the strength of the bond between quantum bits corresponding to the edges connecting the nodes in the chain (chain strength), and inputs the value of that strength to the input / output device 400. The chain strength specified here is the same for all chains.
[0139] Next, the input / output device 400 uses the list of assignments, the coefficients of the QUBO variables, and the chain strength to determine the quantum bits to be used in the quantum annealing machine 200, and calculates the strength of the coupling between the quantum bits (step S202). This calculation can be easily performed with the above three inputs. The strength of the coupling between the quantum bits calculated here includes the strength of the coupling corresponding to the edges in the chain, and all of them are equal to the specified chain strength.
[0140] Next, the input / output device 400 inputs a list of quantum bits to be used and the strength of coupling between the quantum bits to the quantum annealing machine 200 (step S203). Next, the quantum annealing machine 200 realizes the strength of the inter-qubit coupling specified by the input for the quantum bits specified by the input (step S204).
[0141] Next, the quantum annealing machine 200 executes quantum annealing. Specifically, the state of the quantum bits in the quantum annealing machine 200 transitions from the initial state to a state that minimizes the energy of the entire quantum bits. Each quantum bit can generally take two states, but will ultimately take one of these states (step S205). Then, a list of the states of each quantum bit at this time is output from the quantum annealing machine 200 to the input / output device 400 (step S206).
[0142] Next, the input / output device 400 converts the list of quantum bit states into a list of QUBO variable values (step S207). The conversion result is, for example, x_00 = 0, x_01 = 1, ... The input / output device 400 outputs this list (step S208). This output may be performed, for example, on an output device (not shown) such as a display, or may be output as an electronic file.
[0143] [Effect description] In this embodiment, the allocation device 100 allocates variables of the QUBO problem representing the traveling salesman problem to nodes on a Chimera graph. As described above, the allocation according to this embodiment can suppress the use of nodes that do not contribute to the product of variables in the QUBO problem. That is, by devising the arrangement of chains on the Chimera graph, the number of nodes that satisfy the following condition (called node a) is reduced. The condition is that for all chains connected to node a by an edge, the QUBO variable allocated to the chain and the QUBO variable allocated to the chain to which node a belongs do not appear in the form of a product in the objective function. In this embodiment, the number of nodes that satisfy the above condition is (p-1)(N-4) or (p-1)(N-4) + p in each chain. However, the number of chains in which the number of nodes that satisfy the above condition is (p-1)(N-4) + p is ((N-1) 2-8p) chains, and there are 8p chains in which the number of nodes satisfying the above condition is (p-1)(N-4)+p. For example, when N=9, the number of nodes satisfying the above condition is 0 or 1. On the other hand, in the allocation based on Non-Patent Document 1, the number is 5 or 6. This reduces the number of nodes included in the chain. For example, when N=9, the number of nodes included in each chain is 12 in this embodiment, and 17 in the allocation based on Non-Patent Document 1. As a result, it is possible to reduce the number of nodes used to express the QUBO problem corresponding to the traveling salesman problem on the chimera graph. That is, according to the allocation device 100, a correspondence relationship can be obtained in which the number of nodes used is reduced as a correspondence relationship between the variables of the QUBO problem corresponding to the traveling salesman problem and the nodes of the graph for solving this QUBO problem. This increases the accuracy rate when solving the traveling salesman problem expressed on the chimera graph by quantum annealing.
[0144] Here, the results based on this embodiment and the results based on the method of Non-Patent Document 1 will be compared and explained. When the number of cities is less than six, the configuration of the chains on the Chimera graph and which nodes are included in the same chain are the same as the method of Non-Patent Document 1. When the number of cities is six or more, the chain configuration is different from that of the method of Non-Patent Document 1. Figure 18 is a table showing the experimental results for the traveling salesman problem with eight cities.
[0145] Here, an experiment was conducted in which QUBO variables for a traveling salesman problem with eight cities were assigned to a chimera graph of a quantum annealing machine that employs a chimera graph of K(4) using the method according to the present embodiment, and the problem was solved by the quantum annealing machine. In addition, as an experiment for a comparative example, an experiment was conducted in which the same problem was assigned using a method that utilizes the method described in Non-Patent Document 1, and the problem was solved by the quantum annealing machine. Note that in the experiment for this embodiment and the experiment for the comparative example, the settings for the quantum annealing machine were the same for both, except for the parameters related to the assignment.
[0146] The traveling salesman problem becomes a different problem even if the number of cities is the same, if the layout of the cities, that is, the distance between the cities, is different. Here, 100 problems with eight cities and different distances between the cities were randomly generated, and were solved in an experiment for this embodiment and an experiment for a comparative example. Here, solving the problem means finding a visiting order in which the total distance from visiting all the cities in a given layout to returning to the first city visited is the shortest among all the visiting orders. The correct answers for all the problems handled in the experiment had already been found by calculating the total distance of all the visiting orders in advance. The correct answer is the visiting order in which the total distance is the shortest.
[0147] The table shown in FIG. 18 shows the number of questions for which the correct answer was obtained out of 100 questions, and the number of questions for which the solution was obtained with an error from the correct answer within a predetermined range (1% and 10%). The error from the correct answer is the error of the total distance of the visiting order of the cities in the solution obtained by the quantum annealing machine from the total distance of the visiting order of the correct answer. In other words, an error of 1% means that the total distance given by the obtained solution is 101% of the total distance of the visiting order of the correct answer. As shown in FIG. 18, the allocation according to this embodiment has a higher probability of obtaining the correct answer and an approximate solution than the comparative example. The cause of this difference is thought to be the difference in the number of nodes used. In this experiment, the number of nodes used in this embodiment was 539, while in the comparative example, it was 686.
[0148] [Embodiment 2] In the first embodiment, the number of nodes of a unit of a chimera graph is determined in advance. That is, the assignment device 100 according to the first embodiment assigns binary variables on the premise that a chimera graph of K(4) is used. That is, the variable assignment is performed on the premise that r=4. In contrast, in the second embodiment, an assignment device that enables the assignment of binary variables to a chimera graph defined by an arbitrary value of r will be described. Here, the value of r is an arbitrary natural number.
[0149] FIG. 19 is a schematic diagram showing an example of a computation system 20 according to the second embodiment. This embodiment differs from the first embodiment in that the allocation device 100 accepts input of not only the number of cities N but also the value of a parameter r that defines the configuration of the unit, and assigns binary variables to nodes of a chimera graph defined by the input r. That is, in the second embodiment, the input receiving unit 101 accepts input of the number of cities N of the traveling salesman problem and the value of a parameter r that defines the configuration of a chimera graph (unit). In the second embodiment, the allocation unit 102 assigns binary variables of a QUBO problem that represents a traveling salesman problem with the number of cities N to nodes of a chimera graph that is configured by a unit K(r) that is defined by the value of r that the input receiving unit 101 accepts. Specifically, the allocation unit 102 uses the value accepted by the input receiving unit 101 as the value of r that appears in the following description. In the second embodiment, it is assumed that the graph configuration of the quantum bits of the quantum annealing machine 200 is a chimera graph configuration of K(r). To this end, for example, the user inputs a value of r corresponding to the quantum annealing machine 200 into the allocation device 100.
[0150] Except for the above-mentioned points, the second embodiment is similar to the first embodiment, and therefore the description overlapping with the first embodiment will be omitted as appropriate. Note that by setting r=4, the description including the mathematical expressions in the first embodiment and the description including the mathematical expressions in the second embodiment will be the same.
[0151] The allocation method of this embodiment will be described in detail below. To specifically explain the allocation method, first, numbers are assigned to the positions of nodes on a chimera graph composed of K(r) units. The kth node of the unit in the mth row and nth column is numbered (L×m + n)×2r + k. When m, n, and k are determined, a function f_r(m, n, k) that gives the number of the corresponding node is expressed by equation (11). In other words, when a unit, which is a unit graph that composes a chimera graph, is composed of 2r nodes, the identification number f_r of the kth node of the unit in the mth row and nth column of the chimera graph is expressed by equation (11). r (m, n, k) is expressed by equation (11).
[0152] <Formula (11)>
number
[0153] Here, m, n, and k are integers equal to or greater than 0. In this embodiment, since binary variables are assigned to a Chimera graph with K(r) units, k = 0, 1, 2, ..., 2r-1 here. The upper limit of m and n is L-1. That is, m, n = 0, 1, 2, ..., L-1. Let L be any integer greater than N × N / 4.
[0154] As in the first embodiment, in the first process, which nodes are to be included in the same chain are determined in the same manner as in the method of Non-Patent Document 1. Here, the chains are distinguished by number s (where s is an integer equal to or greater than 0). Since the structure of the chimera graph unit used is different from that in the first embodiment, the node to be included in the s-th chain is the node expressed by formula (12). That is, in the first process, the nodes that constitute the chain are determined by setting the node to be included in the s-th chain to the node expressed by formula (12).
[0155] <Formula (12)>
number
[0156] t and u are uniquely determined by the value of s. t is the largest integer less than or equal to s / r (t = floor(s / r)), and u is the remainder when s is divided by r (u = s - r × floor(s / r)). The relationship s = r × t + u also holds. From these relationships, chains are distinguished by the number s and are also represented as (t, u). For example, chain 1 is also represented as chain (0, 1). Equation (12) is written in the order in which the nodes connected by edges are arranged. Therefore, in equation (12), each node is directly connected by edges to the nodes listed next to it, but is not directly connected to nodes that are not listed next to it.
[0157] In the construction of this chain, only the unit in the mth row and nth column, where n≦m≦N-2, is used. There are 2r chains that include the node of the unit in the mth row and nth column: chains (m, 0), (m, 1), ..., (m, r-1), (n, 0), (n, 1), ..., (n, r-1). In particular, the first r chains use r vertical nodes in the unit, and the remaining r chains use r horizontal nodes in the unit.
[0158] If 4≦N≦r+1, in the second process, the variables x_i,a are assigned to the s-th chain determined by the relationship s = r×a + i. Note that the nodes of the s-th chain are determined in the first process, specifically, as given by equation (12).
[0159] As in the first embodiment, in the third step, the nodes f_r(N-1, a, i), f_r(N, a, i), f_r(N+1, a, i), ..., f_r(L-1, a, i) are removed from the chain (a, i) that corresponds to the variables x_i, a. This is because the chain to which these nodes are connected by edges does not correspond to the variables of the objective function. If 4≦N≦r+1, the fourth step is not performed.
[0160] In order to realize allocation corresponding to these processes, when 4≦N≦r+1, the allocation unit 102 of the allocation device 100 assigns the variables x_i,a of the QUBO problem in equation (2) to N nodes expressed in the following equation (13) for the input N.
[0161] <Formula (13)>
number
[0162] Equation (13) is an extension of equation (6). The units used are the same, and only the nodes used within the units have changed. Reflecting the change from K(4) to K(r) in the Chimera graph unit, i+4 in equation (6) becomes i+r in equation (13). Similar changes are made in the assignment equations shown below.
[0163] Next, consider the case of r+2≦N≦2r+1. When r+2≦N≦2r+1, in the second process, for i = 0, 1, 2, ..., r-1, the variables x_i,a are assigned to the s-th chain determined by the relationship s = r×a + i. In addition, for i = r, r+1, ..., N-2, the variables x_i,a are assigned to the s-th chain determined by the relationship s = r×(N - 1 + a) + ir. Note that the nodes of the s-th chain are determined in the first process, specifically, as given by equation (12).
[0164] Nodes that are connected by edges only to chains corresponding to QUBO variables that are not products in the objective function are gathered at the end of the chain, and in the third process, these nodes are removed from the chain. The removed nodes are in the same unit as in the first embodiment, and the position of the node in the unit is i+r if it is i+4 in the first embodiment, and ir if it is i-4. That is, when i = 0, 1, ..., r-1, remove nodes f_r(N+a+1, a, i), f_r(N+a+2, a, i), ..., f_r(L-1, a, i) from the chain corresponding to variables x_i,a. For i = r, r+1, …, N-2, remove the nodes f_r(N-1+a, 0, i), f_r(N-1+a, 1, i), ..., f_r(N-1+a, a-2, i) and f_r(2N-2, N-1+a, ir), f_r(2N-1, N-1+a, ir), ..., f_r(L-1, N-1+a, ir) from the chain corresponding to variables x_i,a.
[0165] The fourth process is performed as the movement of blocks, similar to the first embodiment. The units included in the blocks are the same as those in Embodiment 1. Note that the above-described block 800A corresponds to a node group composed of only the nodes used by the chain corresponding to \(x_{i,a}\) where \(i = 0, 1, 2,\cdots,r\). Also, the above-described block 800B corresponds to a node group composed of only the nodes used by the chain corresponding to \(x_{i,a}\) where \(i=r + 1,r + 2,\cdots,N - 2\). Further, the above-described block 800C corresponds to a node group composed of the nodes used by the chain that do not belong to either block 800A or block 800B. Among the nodes in block 800C that directly contribute to the product of the QUBO variables of the objective function, they are in the units of the \(a\)-th column of the \((N - 2 + a)\)-th row, the \((N - 1 + a)\)-th row, and the \((N + a)\)-th row for \(a = 0, 1,\cdots,N - 2\). That is, the above-described block 800E corresponds to a node group of these units. In the movement of the blocks, although the nodes used by the chain of the variable \(x_{i,a}\) (where \(i = r,r + 1,\cdots,N - 2\)) also change, the rule of this change is the same as that in Embodiment 1, except for a part. The difference lies in the movement of the position within the unit of the node. In Embodiment 2, the position within the unit of the node moves from \(k\) to \(k'\), where \(k'=k + r\) when \(k\lt r\) and \(k'=k - r\) when \(k\geq r\). That is, the node group of block 800A moves two units in the column direction in the direction where the row number increases. Then, instead of the node represented by \(f_r(m,n,k)\) belonging to block 800B, the node represented by \(f_r(n-(N - 1),m-(N - 3),k')\) (where \(k'=k + r\) when \(k\lt r\) and \(k'=k - r\) when \(k\geq r\)) is used, so the target node is changed.As a result, for variables \(x_{i,a}\), before the movement, \(f(N - 1 + a, N - 1, i), f(N - 1 + a, N, i), \cdots, f(N - 1 + a, N - 1 + a, i), f(N - 1 + a, N - 1 + a, i - r), f(N + a, N - 1 + a, i - r), f(N + a + 1, N - 1 + a, i - r), \cdots, f(2N - 3, N - 1 + a, i - r)\) were used, but after the movement, \(f(0, a + 2, i - r), f(1, a + 2, i - r), \cdots, f(a, a + 2, i - r), f(a, a + 2, i), f(a, a + 3, i), \cdots, f(a, N, i)\) are used. Also, instead of the nodes represented by \(f_r(m, n, k)\) belonging to block 800E, nodes represented by \(f_r(n + 2, m-(N - 3), k')\) (where \(k'=k + r\) when \(k\lt r\) and \(k'=k - r\) when \(k\geq r\)) are used, and thus the nodes to be used are changed. Specifically, for variable \(x_{i,a}\), before the movement, \(f(N - 2 + a, a, i), f(N - 1 + a, a, i), f(N + a, a, i)\) were used, but after the movement, \(f(a + 2, a + 1, i + r), f(a + 2, a + 2, i + r), f(a + 2, a + 3, i + r)\) are used. As a result, the assignment unit 102 connects the first partial chain and the second partial chain of the chain including the first partial chain and the second partial chain connected by unnecessary nodes without passing through the unnecessary nodes, and removes the unnecessary nodes.
[0166] Through the above four processes, the final assignment performed by the assignment device 100 is obtained. To realize the assignment corresponding to these processes, when \(r + 2\leq N\leq2r + 1\), the assignment unit 102 of the assignment device 100 assigns the variables \(x_{i,a}\) of the QUBO problem in formula (2) to nodes as follows for the input \(N\). That is, the assignment unit 102 assigns those among the variables \(x_{i,a}\) where \(i = 0, 1, \cdots, r - 1\) to the \(N + 3\) nodes represented by formula (14). Also, the assignment unit 102 assigns those among the variables \(x_{i,a}\) where \(i = r, r + 1, \cdots, N - 2\) to the \(N + 3\) nodes represented by formula (15).
[0167] <Formula (14)>
number
[0168] <Formula (15)>
number
[0169] Next, consider the case where N satisfies 2r (p - 1) + 2≦N≦2rp + 1, where p is a natural number equal to or greater than 2. In the second process, the variables x_i,a for i = 0, 1, 2, ..., rp-1 are assigned to the s-th chain determined by the relationship s = r×p×a+i. In addition, the variables x_i,a for i = rp, rp+1, ..., N-2 are assigned to the s-th chain determined by the relationship s = rp×(N - 1 + a) + i-rp. The nodes of the s-th chain are determined in the first process, specifically as given by equation (12).
[0170] As in the case of p = 1, the nodes that can be removed from the chain in the assignments made so far are concentrated at the end of the chain, and in the third step, these nodes are removed from the chain. Specifically, the following nodes are removed. The nodes that can be removed at the end of the chain corresponding to variables x_i,a are f_r(p(N+a+1), pa+i / / r, i%r), f_r(p(N+a+1)+1, pa+i / / r, i%r), ..., f_r(L-1, pa+i / / r, i%r), for i = 0, 1, 2, …, rp-1. Note that the meanings of " / / " and "%" are as described above. For i = rp, rp+1, …, N-2, the nodes at the ends of the chain that can be removed are f_r(p(N-1+a)+i / / rp, 0, i%r+r), f_r(p(N-1+a)+i / / rp, 1, i%r+r), ..., f_r(p(N-1+a)+i / / rp, p(a-1)-1, i%r+r) and f_r(p(2N-2), p(N-1+a)+i / / rp, i%r), f_r(p(2N-2)+1, p(N-1+a)+i / / rp, i%r), …, f_r(L-1, p(N-1+a)+i / / rp, i%r).
[0171] For the fourth process, the blocks are considered and processed in the same way as in the case of p = 1. Note that the above-mentioned block 800A corresponds to a node group composed of only the nodes used by the chains corresponding to x_i,a where i = 0, 1, ..., rp - 1. Also, the above-mentioned block 800B corresponds to a node group composed of only the nodes used by the chains corresponding to x_i,a where i = rp, rp + 1, ..., N - 2. Further, the above-mentioned block 800C corresponds to a node group composed of the nodes used by the chains that do not belong to either block 800A or block 800B. The nodes in block 800C that directly contribute to the product of the QUBO variables of the objective function are in the units of the qa-th column, q(N - 2 + a)-th row, q(N - 1 + a)-th row, and q(N + a)-th row for a = 0, 1, ..., N - 2 and q = 1, 2, ..., p. That is, the above-mentioned block 800E corresponds to the node group of these units. In the fourth process, the following block movement is performed. The node group of block 800A moves 2p units in the column direction in the direction where the row number increases. And instead of the nodes represented by f_r(m, n, k) belonging to block 800B, the nodes represented by f_r(n - p(N - 1), m - p(N - 3), k’) (where k’ = k + r when k < r and k’ = k - r when k ≥ r) are used, so the target nodes are changed.As a result, variables x_i,a are stored in block 800B before the move, f_r(p(N-1+a)+i / / rp, p(N-1), i%r+r), f_r(p(N-1+a)+i / / rp, N, i%r+r), ..., f_r(p(N-1+a)+i / / rp, p(N-1+a)+i / / rp, i%r+r), f_r(p(N-1+a)+i / / rp, p(N-1+a)+i / / rp, i%r), f_r(p(N-1+a)+i / / r-p+1, p(N-1+a)+i / / rp, i%r), f_r(p(N-1+a)+i / / r-p+2, p(N-1+a)+i / / rp, i%r), ..., f_r(p(2N-2)-1, Previously, f_r(0, p(a+2)+i / / rp, i%r), f_r(1, p(a+2)+i / / rp i%r), ..., f_r(pa+i / / rp, p(a+2)+i / / rp, i%r), f_r(pa+i / / rp, p(a+2)+i / / rp, i%r+r), f_r(pa+i / / rp, p(a+2)+i / / rp, i%r+r), ..., f_r(pa+i / / rp, p(a+2)+i / / r-p+1, i%r+r), Also, the nodes to be used are changed so that the nodes represented by f_r(n + 2p, m - p(N - 3), k’) (where k’ = k + r when k < r and k’ = k - r when k ≥ r) are used instead of the nodes represented by f_r(m, n, k) belonging to block 800E. As a result, for example, when variables x_i,a are for i = 0, 1, …, rp - 1, before the movement, f_r(p(N - 2 + a) + i / / r, pa + i / / r, i%r), f_r(p(N - 2 + a) + i / / r + 1, pa + i / / r, i%r), …, f_r(p(N + a + 1) - 1, pa + i / / r, i%r) were used, but after the movement, f_r(p(a + 2) + i / / r, p(a + 1) + i / / r, i%r + r), f_r(p(a + 2) + i / / r, p(a + 1) + i / / r + 1, i%r + r), f_r(p(a + 2) + i / / r, p(a + 1) + i / / r + 2, i%r + r), …, f_r(p(a + 2) + i / / r, p(a + r) - 1, i%r + r) will be used. Thereby, the assignment unit 102 connects the first partial chain and the second partial chain of the chain including the first partial chain and the second partial chain connected by unnecessary nodes without passing through the unnecessary nodes, and removes the unnecessary nodes.
[0172] Through the above four processes, the final assignment performed by the assignment device 100 is obtained. When N satisfies 2r(p - 1) + 2 ≤ N ≤ 2rp + 1 where p is a natural number of 2 or more, in order to realize the assignment corresponding to these processes, the assignment unit 102 of the assignment device 100 assigns the variables x_i,a of the QUBO problem to nodes as follows for the input N. That is, the assignment unit 102 assigns those among the variables x_i,a where i = 0, 1, …, r - 1 to the p(N + 3) nodes represented by formula (16), and assigns those among the variables x_i,a where i = rp, rp + 1, …, r(p + 1) - 1 to the p(N + 3) nodes represented by formula (17).
[0173] <Formula (16)>
number
[0174] <Formula (17)>
number
[0175] Here, we consider the case where p is an integer greater than or equal to 2. There are x_i,a for i other than i = 0, 1, …, r-1, rp, rp + 1, …, r(p+1) -1 assigned by equations (16) and (17), and they have not been assigned yet. Using an integer q such that 1≦q<p, the i of the unassigned x_i,a is represented as i = rq, rq + 1, …, r(q+1) -1, r(p + q), r(p + q) + 1, …, r(p + q + 1) -1. We assign the x_i,a for i = rq, rq + 1, …, r(q+1) -1 (1≦q<p) to nodes, and we assign them in order starting from the ones with smaller values of q. First, consider x_i,a for q = 1 (i = r, r+1, …, 2r-1). For this purpose, consider the node to which x_i-r,a has been assigned. Here, i-r = 0,1, …, r-1, and x_i-r,a has already been assigned to a node by equation (16). Move the row by +1 and the column by +1 in parallel with respect to the unit from the node to which x_i-r,a has been assigned. That is, if one of the nodes to which x_i-r,a has been assigned is f_r(m, n, k), it means moving to f_r(m+1, n+1, k). Assign x_i,a to the node at the position after such parallel movement. Since there are p(N+3) nodes to which x_i-r,a has been assigned, assign x_i,a to the nodes after the same parallel movement for them. However, if the destination node for the assignment is the node represented by f_r(p(N + 1), pa + q, i - rq), do not assign x_i,a to that node. Instead, assign x_i,a to the node represented by f_r(pa + 2p + q, pa + q, i - r(q - 1)). Perform the same assignment until q = p while increasing q by 1 each time.
[0176] Next, assign \(x_{i,a}\) to nodes for \(i = r(p + q), r(p + q)+1,\cdots,r(p + q + 1)-1\) (\(1\leq q\lt p\)). First, start with \(q = 1\). Similar to the above, starting from the position of the node assigned to \(x_{i - r,a}\), move the row and column by \(+1\) unit in parallel, and assign \(x_{i,a}\) to the node at the moved position. However, if the destination node for the assignment is the node represented by \(f_r(pa + q,p(N + 1),i - r(p + q - 1))\), do not assign \(x_{i,a}\) to that node. Instead, assign \(x_{i,a}\) to the node represented by \(f_r(pa + q,pa + 2p + q,i - r(p + q))\). Repeat the same assignment while increasing \(q\) by \(1\) until \(q = p\). Through the above process, the assignment unit 102 of the assignment device 100 assigns all variables \(x_{i,a}\) to nodes.
[0177] [Description of the operation] Next, the operation of this embodiment will be described with reference to the drawings. FIG. 20 is a flowchart showing the operation flow of the assignment device 100 according to Embodiment 2. While referring to FIG. 20, the operation flow of the assignment device 100 according to Embodiment 2 will be described.
[0178] First, the input reception unit 101 of the assignment device 100 receives, via an input device (not shown), the input of the number of cities \(N\) of the traveling salesman problem and the input of the value of \(r\) characterizing the structure of the unit of the chimera graph (step S301).
[0179] Next, the allocation unit 102 expresses the traveling salesman problem for the input number of cities as a QUBO problem in the form of formula (2) stored in advance, and allocates the binary variable (QUBO variable) x to a node on the Chimera graph defined by the input r (step S302). At this time, the unit used for allocation does not depend on r, and is the same as in the first embodiment. Here, the unit does not depend on r means that when the unit used for allocation is specified by row number m and column number n, the values of m and n do not depend on the value of r. Only the position of the node used within the unit depends on r. The allocation unit 102 executes the allocation as described above using the allocation formula (formula (13), formula (14), formula (15), formula (16), formula (17)) according to the value of N.
[0180] Next, the output unit 103 of the allocation device 100 outputs information indicating the correspondence between the binary variables and the nodes based on the allocation result of the allocation unit 102 (step S303). This output may be performed, for example, on an output device not shown, such as a display, or may be output as an electronic file. When the QUBO problem is solved by the quantum annealing machine 200, the same operation as that described with reference to FIG. 17 in the first embodiment is performed.
[0181] The above describes the second embodiment. According to the second embodiment, it is possible to assign variables of a QUBO problem corresponding to a traveling salesman problem to nodes of a chimera graph having a unit defined by an arbitrary r while suppressing the number of nodes to be used.
[0182] The present invention is not limited to the above-described embodiment, and can be modified as appropriate without departing from the spirit and scope of the present invention. [Explanation of symbols]
[0183] 100 Allocation Equipment 101 Input reception section 102 Allocation Section 103 Output section 150 Network Interface 151 Memory 152 processors 200 Quantum Annealing Machine 300 Computing equipment 400 I / O devices
Claims
1. an input receiving unit that receives an input of the number of cities in the traveling salesman problem; an assignment unit that assigns a binary variable according to the number of cities in the traveling salesman problem expressed as a QUBO (Quadratic Unconstrained Binary Optimization) problem to a node on a Chimera graph; an output unit that outputs information indicating a correspondence relationship between the binary variables and the nodes based on a result of the assignment of the binary variables to the nodes; having The assignment unit assigns the pair of binary variables that are products in the objective function of the QUBO problem to the nodes that are connected to each other by edges in the Chimera graph with priority over the pair of binary variables that are not products in the objective function of the QUBO problem. Allocation device.
2. The allocation unit: determining nodes constituting each chain such that all the nodes in the chain share the same units as the nodes in a predetermined number of other chains, the chain being a series of nodes connected by edges, the units being unit graphs constituting the Chimera graph; The binary variables are assigned to the chain so that at least one of the specific nodes is placed at the end of the chain, the specific node being the node that is not connected by an edge to a chain to which the binary variables that are a product in an objective function of the QUBO problem are assigned; removing the particular node from the end of the chain; The nodes constituting the chain in the chimera graph are changed so as to connect the first partial chain and the second partial chain, which are connected by the particular node that has not been removed, without passing through the particular node, and the particular node is removed from the chain, thereby determining the final assignment of the binary variables to the nodes. The allocation device according to claim 1 .
3. The assignment device according to claim 1 or 2, wherein the objective function is expressed by H in the following first equation, and the binary variable of the QUBO problem is x, which is distinguished by a subscript in the first equation. (First formula) [0018] where N is the number of cities in the traveling salesman problem, and x i,a is a variable that indicates whether to visit city i ath, and W ij is an integer representing the distance between city i and city j, and C is a positive predetermined value.
4. When a unit, which is a unit graph constituting the chimera graph, is composed of 2r nodes (where r is a natural number), the identification number f of the k-th node of the unit in the m-th row and n-th column of the chimera graph is r If (m,n,k) is expressed by the second equation below, The assigning unit assigns a binary variable x i,a to the N+3 nodes represented by the third formula below, and a binary variable x i,a to the N+3 nodes represented by the fourth formula below. The allocation device according to claim 3 . (Second Equation) [0019] Here, m, n, and k are integers of 0 or more, L is an integer, and the upper limit of m and n is L-1. (Third Equation) [0020] (Fourth Equation) ##EQU00021##
5. When a unit, which is a unit graph constituting the chimera graph, is composed of 2r nodes (where r is a natural number), the identification number f of the k-th node of the unit in the m-th row and n-th column of the chimera graph is r If (m,n,k) is expressed by the second equation below, The allocating unit, when 2r(p-1)+2≦N≦2rp+1 (where p is a natural number equal to or greater than 2), A binary variable x with i values 0, 1, …, r-1 i,a to the p(N+3) nodes represented by the following fifth formula: A binary variable x with i values rp, rp + 1, … , r(p+1) -1 i,a to the p(N+3) nodes represented by the sixth formula; A binary variable x whose i is one of rq, rq + 1, … , r(q+1) -1 (where q is an integer such that 1≦q<p). i,a Let x be the binary variable i-r,a The node is assigned to the unit by shifting the row by +1 and the column by +1 from the position of the node to which the unit is assigned, provided that the node to which the unit is assigned is f r If the node is represented by (p(N + 1), pa + q, i - rq), then use f instead of the node. r assigning to said node represented by (p + 2p + q, p + q, i - r(q - 1)); A binary variable x with i value r(p + q), r(p + q) + 1, … , r(p + q + 1) -1 (where q is an integer such that 1 ≤ q < p). i,a Let x be the binary variable i-r,a The node is assigned to the unit by shifting the row by +1 and the column by +1 from the position of the node to which the unit is assigned, provided that the node to which the unit is assigned is f r If the node is represented by (pa + q, p(N + 1), i - r(p + q-1)), then use f instead of the node. r Assign to the node represented by (pa + q, pa + 2p + q, i - r(p + q)) The allocation device according to claim 3 . (Second Equation) [0022] Here, m, n, and k are integers of 0 or more, L is an integer, and the upper limit of m and n is L-1. (Equation 5) [0023] (6th formula) [0024]
6. The assigning unit assigns a binary variable x i,a to the N nodes represented by the seventh formula below. An allocation device according to claim 4 or 5. (Seventh Equation) [0025]
7. The input receiving unit further receives an input of the value of r, The allocation unit uses the input value as the value of r. Allocation device according to any one of claims 4 to 6.
8. Accepts input of the number of cities in the traveling salesman problem, A binary variable corresponding to the number of cities in the traveling salesman problem expressed as a QUBO problem is assigned to a node on a Chimera graph; outputting information indicating a correspondence relationship between the binary variables and the nodes based on a result of the assignment of the binary variables to the nodes; In assigning the binary variables to the nodes, the set of binary variables that are products in the objective function of the QUBO problem is preferentially assigned to the nodes that are mutually connected by edges in the Chimera graph, over the set of binary variables that are not products in the objective function of the QUBO problem. Allocation method.
9. an input receiving step of receiving an input of the number of cities in the traveling salesman problem; An assignment step of assigning a binary variable according to the number of cities in the traveling salesman problem expressed as a QUBO problem to a node on a Chimera graph; an output step of outputting information indicating a correspondence relationship between the binary variables and the nodes based on a result of the assignment of the binary variables to the nodes; on the computer, In the assignment step, the set of binary variables that are products in the objective function of the QUBO problem is preferentially assigned to the nodes that are connected to each other by edges in the Chimera graph, over the set of binary variables that are not products in the objective function of the QUBO problem. program.
Citation Information
Patent Citations
Systems and Methods for Quantum Processing of Data
JP2016531343A
System and method to hardcode interger linear optimization problems on physical implementations of the ising model
US20190087388A1
