Simulated annealing apparatus and simulated annealing method

The simulated annealing apparatus and method efficiently parallelize repetitive processing by utilizing vector arithmetic units to minimize synchronization overhead and reduce unnecessary operations, addressing the inefficiencies in existing methods.

JP7559937B2Active Publication Date: 2024-10-02NEC CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2023516961
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2021-04-28
Publication Date
2024-10-02
Estimated Expiration
2041-04-28

AI Technical Summary

Technical Problem

Existing simulated annealing methods face difficulties in efficiently parallelizing repetitive processing due to the dependency relationships between spins, leading to inefficient parallelization and significant synchronization overhead.

Method used

A simulated annealing apparatus and method that utilizes an Ising model to parallelize the process of checking spin flips and updating energy changes across multiple spins, employing vector arithmetic units to minimize synchronization overhead and reduce unnecessary processing.

Benefits of technology

This approach enables efficient parallelization of repetitive processing, reducing wasted computations and synchronization overhead, thereby accelerating the solution of combinatorial optimization problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007559937000002
    Figure 0007559937000002
  • Figure 0007559937000003
    Figure 0007559937000003
  • Figure 0007559937000004
    Figure 0007559937000004
Patent Text Reader

Abstract

A simulated annealing device 20 is for solving a combinatorial optimization problem by a simulated annealing method. Said simulated annealing device is provided with: a confirmation means 21 for executing, in parallel by a parallel number n, a confirmation process concerning whether or not flips are to be allowed respectively for a total of n-number of spins in the order from {(k-1)•n+1} to k•n (k is an integer of at least 1, n is an integer of at least 2) constituting an energy function in an Ising model representing a combinatorial optimization problem; an update means 22 for updating, upon confirmation that a flip has been first allowed for an m-ordered (m is an integer not less than {(k-1)•n+1} but less than k•n) spin, a changed amount of energy of the spin concerning the m-ordered spin in a state where the m-ordered spin is flipped; and a change means 23 for changing spins, on which the next confirmation process is to be executed, to spins in the order from (m+1) to k•n, and the parallel number to (n-m).
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a simulated annealing device, a simulated annealing method, and a simulated annealing program. [Background technology]

[0002] With the practical application of quantum annealing machines, research on combinatorial optimization problems has been attracting attention again. Combinatorial optimization problems are problems that involve finding optimal combinations. Examples of combinatorial optimization problems that represent issues in the real world include the traveling salesman problem, the knapsack problem, the shift optimization problem, and the delivery planning problem.

[0003] The above combinatorial optimization problems are described, for example, in the form of an Ising model. The Ising model is a statistical mechanics model that describes the behavior of magnetic materials by individual spins. In the Ising model, the orientation of each spin is represented as "1" or "-1". The Ising model can formulate many combinatorial optimization problems.

[0004] When a combinatorial optimization problem is described in the Ising model format, first, an equation expressing the energy in the combinatorial optimization problem is created. Next, the equation expressing the energy in the combinatorial optimization problem is converted into an energy function in the Ising model. Note that the method of converting into an energy function in the Ising model is publicly known. The energy function in the Ising model is expressed as the following equation (1).

[0005]

number

[0006] In addition, i and j in formula (1) are variables that represent spin. i is the variable that represents the orientation of spin i, and s j is the variable that represents the direction of spin j. That is, s i,s j is a variable that can be either "1" or "-1".

[0007] In addition, h in formula (1) i is a constant corresponding to spin i. For each possible value of i, h i is defined as a constant. In addition, J in Eq. (1) ij is a constant corresponding to the combination of spin i and spin j. For each combination of possible values ​​of i and j, J ij is defined as a constant.

[0008] In addition, instead of the energy function in the Ising model, a quadratic unconstrained binary optimization (QUBO) energy function may be used. QUBO is a model in which the orientation of each spin is represented by "1" or "0."

[0009] That is, the formula expressing the energy in a combinatorial optimization problem can be converted into an energy function in QUBO. This conversion method is well known. In addition, the energy function in the Ising model and the energy function in QUBO can be converted into each other.

[0010] Given the energy function shown in equation (1), when the combinatorial optimization problem is solved, the optimal individual spin orientations (1 or -1) are found. The optimal individual spin orientations thus found represent the solution to the combinatorial optimization problem.

[0011] Many combinatorial optimization problems can be reduced to minimization problems, which are problems that seek combinations that minimize an arbitrary objective function (object to be minimized) under given constraints. When a combinatorial optimization problem is a minimization problem, the optimal individual spin orientations are those that minimize the energy E indicated by the energy function.

[0012] A combinatorial optimization problem described in the Ising model format is solved, for example, by a simulated annealing method (hereinafter also referred to as the SA method). Non-Patent Document 1 describes parallelization of the simulated annealing algorithm when applied to the placement of modules in a VLSI (Very Large Scale Integration) circuit. [Prior art documents] [Non-patent literature]

[0013] [Non-Patent Document 1] Jonas Knopman and Julio S. Aude, ``Parallel simulated annealing: An adaptive approach,'' In Proceedings 11th International Parallel Processing Symposium, 1997. Summary of the Invention [Problem to be solved by the invention]

[0014] When solving a combinatorial optimization problem, the SA method accepts a spin flip if the energy of flipping the spin decreases, and does not accept a spin flip if the energy of flipping the spin increases.

[0015] The SA method repeats the above process thousands, tens of thousands, or even more than tens of thousands of times with different spins. By repeating the process, the SA method finds an optimal solution to a combinatorial optimization problem.

[0016] However, since each spin has a dependency, it is difficult to simultaneously calculate whether or not flips of multiple spins are accepted. In other words, it is difficult to efficiently parallelize the iterative process by the SA method. In addition, Non-Patent Document 1 does not describe how to efficiently parallelize the iterative process by the SA method.

[0017] Therefore, an object of the present invention is to provide a simulated annealing device, a simulated annealing method, and a simulated annealing program that can efficiently parallelize iterative processing using the simulated annealing method. [Means for solving the problem]

[0018] A simulated annealing apparatus according to the present invention is a simulated annealing apparatus that solves a combinatorial optimization problem by a simulated annealing method, and is characterized by comprising: a confirmation means that executes in parallel with a parallel number n a confirmation process of whether or not a flip is accepted for each of n spins, {(k-1)·n+1}th to k·nth (k is an integer equal to or greater than 1, and n is an integer equal to or greater than 2), that constitute an energy function in an Ising model that represents the combinatorial optimization problem; an update means that, when acceptance of a flip is first confirmed for an mth spin (m is an integer equal to or greater than {(k-1)·n+1} and less than k·n), updates the amount of change in energy of a spin related to the mth spin in a state in which the mth spin has been flipped; and a change means that changes the spin for which the next confirmation process is executed to the (m+1)th to k·nth spins and the parallel number to (nm).

[0019] The simulated annealing method according to the present invention is a simulated annealing method for solving a combinatorial optimization problem by a simulated annealing method, comprising the steps of: The computer For each of the n spins {(k-1)·n+1}th to k·nth (k is an integer equal to or greater than 1, n is an integer equal to or greater than 2) that constitute the energy function in the Ising model that represents the combinatorial optimization problem, a process of confirming whether or not the flip is accepted is executed in parallel with a parallel number n; The computer When the mth spin (m is an integer greater than or equal to {(k-1)·n+1} and less than k·n) is first confirmed to have flipped, the spin energy change associated with the mth spin is updated to the state in which the mth spin has flipped, The computerThe spin where the next confirmation process is executed is changed to the (m+1)th to k·nth spins, and the number of parallel spins is changed to (nm).

[0020] A simulated annealing program according to the present invention is a simulated annealing program executed on a computer that solves a combinatorial optimization problem by a simulated annealing method, and is characterized in that it causes the computer to execute a parallel process of executing in parallel, with a parallel number n, a confirmation process of whether or not a flip is accepted for each of n spins, {(k-1)·n+1}th to k·nth (k is an integer equal to or greater than 1, and n is an integer equal to or greater than 2), that constitute an energy function in an Ising model that represents the combinatorial optimization problem; an update process of updating the amount of change in energy of the spin related to the mth spin in a state in which the mth spin has been flipped, when acceptance of a flip is first confirmed for the mth spin (m is an integer equal to or greater than {(k-1)·n+1} and less than k·n); and a change process of changing the spins for which the next confirmation process is executed to the (m+1)th to k·nth spins and the parallel number to (nm). Effect of the Invention

[0021] According to the present invention, iterative processing using the simulated annealing method can be efficiently parallelized. [Brief description of the drawings]

[0022] [Figure 1] 1 is a flowchart showing the operation of a general process for solving a combinatorial optimization problem using the SA method. [Diagram 2] FIG. 1 is an explanatory diagram showing an example of parallelization of a process for solving a combinatorial optimization problem using a general SA method. [Diagram 3] 1 is a block diagram showing an example of the configuration of a simulated annealing apparatus according to an embodiment of the present invention; [Figure 4] FIG. 1 is an explanatory diagram showing an example of parallelization of a combinatorial optimization problem solving process by a simulated annealing apparatus 100. [Diagram 5]FIG. 1 is an explanatory diagram showing an example of parallel processing by a general SA method and parallel processing by a simulated annealing apparatus 100. [Figure 6] FIG. 11 is an explanatory diagram showing another example of parallel processing by a general SA method and parallel processing by the simulated annealing apparatus 100. [Figure 7] FIG. 11 is an explanatory diagram showing another example of parallel processing by a general SA method and parallel processing by the simulated annealing apparatus 100. [Figure 8] 4 is a flowchart showing an operation of a process for solving a combinatorial optimization problem by the simulated annealing apparatus 100 of the present embodiment. [Figure 9] FIG. 1 is an explanatory diagram showing an example of a hardware configuration of a simulated annealing apparatus according to the present invention. [Figure 10] 1 is a block diagram showing an overview of a simulated annealing apparatus according to the present invention; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0023] First, we will explain the details of the above-mentioned problem. The SA method is a general-purpose method for approximately solving combinatorial optimization problems. The SA method solves combinatorial optimization problems by performing the following four processes as one cycle.

[0024] 1. Select one spin 2. Calculate the energy change Δ when the selected spin is flipped 3. Accept the spin flip with probability min(exp(-Δ / T),1) 4. If the flip is accepted, flip the selected spin.

[0025] Specifically, the SA method inverts the direction of the spin selected in step 2 above from -1 to 1 or from 1 to -1, and calculates the amount of change in energy Δ when the spin is flipped.

[0026] The SA scheme then accepts the flip of the spin in step 3 above if the calculated Δ is negative, and accepts the flip of the spin with the probability calculated above if the calculated Δ is positive.

[0027] The SA method then flips the spin chosen in step 4 above, if the flip is accepted.

[0028] That is, the SA method does not accept the flip of the spin depending on the calculation result in step 3. If the flip of the spin is not accepted, the selected spin is not flipped and remains in the original state.

[0029] The SA method finds a combination of spin orientations that minimizes the energy E by repeatedly executing the above steps 1 to 4 (hereinafter also referred to as the iterative process).

[0030] FIG. 1 is a flowchart showing the operation of a general process for solving a combinatorial optimization problem using the SA method.

[0031] First, the SA method selects spin 1 (step S001). Next, the SA method calculates the amount of change in energy Δ when spin 1 is flipped (step S002). Next, the SA method executes a flip check calculation (for example, a calculation of the probability min(exp(-Δ / T),1)) required to determine whether or not the flip of spin 1 is accepted (step S003).

[0032] Next, the SA method determines whether or not to accept the flip of spin 1 according to the calculation result in step S003 (step S004). If it is determined that the flip is to be accepted (Yes in step S004), the SA method flips spin 1 (step S005). If it is determined that the flip is not to be accepted (No in step S004), the SA method proceeds to step S006.

[0033] That is, whatever the result, the SA method determines whether or not to accept the flip of spin 1, and then selects the next spin 2 (step S006). After step S006, the SA method repeatedly executes the same processes as steps S001 to S005.

[0034] As shown in Fig. 1, the SA method selects one spin and determines whether or not to accept the flip of the selected spin. In other words, whether or not to accept the flip of the next spin to be selected depends on whether or not to accept the flip of the previously selected spin. Therefore, it is difficult to parallelize the repetitive processing by the SA method.

[0035] Fig. 2 is an explanatory diagram showing an example of parallelization of a combinatorial optimization problem solving process using a general SA method. The example shown in Fig. 2 is an example of speeding up the combinatorial optimization problem solving process by parallelizing with spins, since the process load of calculating the energy change amount Δ is high.

[0036] Each rectangle in Fig. 2 represents one of the above repeated processes. In addition, "p" in the rectangle in Fig. 2 represents the process number, and "s" represents the spin number. In addition, the black rectangle in Fig. 2 represents a process in which a spin flip is accepted. In addition, the rectangle surrounded by a dashed line in Fig. 2 represents a process that is wasted.

[0037] For example, the four rectangles shown at the top of Figure 2 represent parallel processes executed in parallel with a parallel count of 4: process number 0 for a spin with spin number 0, process number 1 for a spin with spin number 1, process number 2 for a spin with spin number 2, and process number 3 for a spin with spin number 3.

[0038] In addition, the four rectangles shown at the top of Figure 2 represent that a flip of a spin with spin number 1 is accepted in a process with process number 1, and that a flip of a spin with spin number 3 is accepted in a process with process number 3.

[0039] In other words, since the flip of the spin with spin number 1 is accepted in the process with process number 1, the repeated process for spins with spin numbers 2 and above must be repeated again with the spin with spin number 1 flipped.

[0040] Therefore, as shown in the top row of Figure 2, both the process with process number 2 and the process with process number 3 are wasted. The spin with spin number 3 also remains in its original state. In other words, in parallelizing the process of solving combinatorial optimization problems using the SA method, even if a spin flip is accepted, the state of the spin may not change.

[0041] After the spin is flipped, the SA method repeats the process from the spin next to the flipped spin. As shown in the second row of Figure 2, the SA method sets the process with the process number 0 as the process for the spin with the spin number 2.

[0042] The SA method executes the following in parallel with a parallel count of 4: process number 0 for a spin with spin number 2, process number 1 for a spin with spin number 3, process number 2 for a spin with spin number 4, and process number 3 for a spin with spin number 5.

[0043] The contents shown in the second and subsequent rows in Fig. 2 are the same as those shown in the top row. As shown in Fig. 2, when flips are frequently accepted, a lot of processing is wasted.

[0044] To shorten the processing time as much as possible, the SA method may first calculate in parallel for all spins only the process "2. Calculate the amount of energy change Δ when the selected spin is flipped" in the iterative process. If the process of step 2 is executed first, the SA method solves the combinatorial optimization problem by iterating the following four processes.

[0045] 11. Select one spin 12. Accept a spin flip with probability min(exp(-Δ / T),1). 13. If the flip is accepted, flip the selected spin. 14. Update the energy change Δ of the associated spins

[0046] That is, the above-described repetitive process is a process in which the amount of change in energy is calculated first, and only when a spin is flipped, the amount of change in energy of the spin associated with the flipped spin is updated.

[0047] However, the amount of calculation per process in steps 11 to 14 is not large. Therefore, even if multiple repetitive processes are executed in parallel using a multi-process or multi-thread method in which memory is shared and each process or thread executes a repetitive process in parallel and then synchronizes, the overhead due to synchronization becomes dominant in the overall processing. In other words, the effect of parallelization using the multi-process or multi-thread method is small.

[0048] Hereinafter, an embodiment of the present invention that can reduce unnecessary processing when flips are frequently accepted and can reduce the impact of overhead due to synchronization in the entire process of solving a combinatorial optimization problem will be described with reference to the drawings.

[0049] [Configuration Description] FIG. 3 is a block diagram showing an example of the configuration of a simulated annealing apparatus according to an embodiment of the present invention.

[0050] As shown in FIG. 3, the simulated annealing apparatus 100 of this embodiment includes an energy calculation unit 110, a flip confirmation unit 120, a start position / parallel number calculation unit 130, and an energy update unit 140.

[0051] The simulated annealing apparatus 100 of this embodiment employs a method of first calculating the energy change amount Δ due to spin flips in parallel for all spins, and then solving the combinatorial optimization problem by treating the four processes of steps 11 to 14 as one cycle.

[0052] The energy calculation unit 110 has a function of calculating in parallel the amount of change Δ in energy due to spin flip across all spins.

[0053] The flip confirmation unit 120 has a function of executing the processes of steps 11 to 13 in parallel. That is, the flip confirmation unit 120 selects a spin and accepts the flip of the spin with a probability min(exp(-Δ / T),1). If the flip is accepted, the flip confirmation unit 120 flips the selected spin.

[0054] The start position / parallel number calculation unit 130 has a function of calculating the position of the spin at which the next parallel processing starts and the parallel number of the parallel processing, based on the results of the processing in steps 11 to 13.

[0055] The energy updating section 140 has a function of performing in parallel the processing of step 14. That is, only when a spin is flipped, the energy updating section 140 updates in parallel the change amount of the energy of the spin associated with the flipped spin.

[0056] The simulated annealing apparatus 100 of this embodiment is characterized in that it realizes parallelization using a vector calculator. For example, the flip checking unit 120 and the energy updating unit 140 are realized by a vector calculator.

[0057] Unlike multi-processing or multi-threading, the vector calculator is a device that is specialized for parallel processing from the beginning. Parallelization using the vector calculator does not have the effect of overhead due to synchronization. In addition, since the vector calculator can change the target of parallelization, both the processing by the flip check unit 120 and the processing by the energy update unit 140 can be parallelized.

[0058] Moreover, the simulated annealing apparatus 100 of this embodiment has a feature of reducing the wasteful processing shown in Fig. 2 by fixing the iteration width. When the number of parallel processes is reduced by reducing the wasteful processing, the flip confirmation unit 120 and the energy update unit 140, which are realized by a vector calculator, can execute parallel processing at higher speed.

[0059] The advantages of reducing the number of parallel processes are explained below. When parallel processing is performed using multiple processes or multiple threads, the processing speed generally does not change significantly even if the number of parallel processes is changed. For example, there are cases where the time it takes to execute process X using one process is almost equal to the time it takes to split process X into four and execute it in parallel using four processes.

[0060] In addition, even when the process is executed by a vector calculator or when the time required for each divided process is short, the processing speed differs depending on the number of parallel processes. For example, depending on the conditions, the time required for process X to be divided into four and executed in parallel by four processes may be longer than the time required for process X to be executed by one process.

[0061] Therefore, reducing the number of parallel processes without performing unnecessary calculations may shorten the processing time of parallel processing. In addition, the parallel processing itself is executed more efficiently. In the parallel processing shown in the top row of Figure 2, the processing with processing number 2 and the processing with processing number 3 are both unnecessary processing. Since the processing time of a parallel processing with a parallel processing number of 2 is more likely to be shorter than that of a parallel processing with a parallel processing number of 4, it is preferable to reduce the number of parallel processes from 4 to 2.

[0062] FIG. 4 is an explanatory diagram showing an example of parallelization of the process of solving a combinatorial optimization problem by the simulated annealing apparatus 100.

[0063] The contents represented by the four rectangles shown in the top row of Fig. 4 are the same as those represented by the four rectangles shown in the top row of Fig. 2. As shown in the top row of Fig. 4, the process with process number 2 and the process with process number 3 are both wasted.

[0064] As shown in the second row of FIG. 4, the simulated annealing apparatus 100 of this embodiment executes in parallel only the remaining two processes that need to be redone among the processes represented by the four rectangles shown in the top row by reducing the parallel number from four to two.

[0065] In this embodiment, "fixing the repetition width" indicates that the repetition width is not executed for the next spin until the orientations of all spins targeted for parallel processing are determined. In the example shown in Fig. 4, the fixed width is set to 4. The start position / parallel number calculation unit 130 calculates the position of the spin at which parallel processing is to be resumed and updates the parallel number.

[0066] Therefore, as shown in the second row of Fig. 4, the simulated annealing apparatus 100 executes in parallel, with a parallel count of 2, the process with process number 0 for the spin with spin number 2, and the process with process number 1 for the spin with spin number 3. Note that, as shown in the second row of Fig. 4, even if a spin flip is accepted in the last process of the parallel processes, it does not affect the next parallel process.

[0067] When the parallel processing shown in the second row of Figure 4 is completed, the orientations of all four spins with spin numbers 0 to 3 that were initially targeted for parallel processing have been determined, so simulated annealing apparatus 100 performs parallel processing on the next four spins with spin numbers 4 to 7.

[0068] As shown in the third row of Fig. 4, the flip of the spin with spin number 6 has been accepted for the process with process number 2. Therefore, as shown in the fourth row of Fig. 4, the simulated annealing apparatus 100 reduces the number of parallel processes from 4 to 1 and executes in parallel the process with process number 0 for the spin with spin number 7, which corresponds to the remaining process that needs to be redone among the processes represented by the four rectangles shown in the third row.

[0069] When the parallel processing shown in the fourth row of Figure 4 is completed, the orientations of all four spins, spin numbers 4 to 7, that were the subject of the second parallel processing have been determined, so simulated annealing apparatus 100 performs parallel processing on the next four spins, spin numbers 8 to 11.

[0070] The following describes the effects achieved by the simulated annealing apparatus 100 of this embodiment. Fig. 5 is an explanatory diagram showing an example of parallel processing by a general SA method and parallel processing by the simulated annealing apparatus 100.

[0071] The elongated rectangles shown in the upper part of FIG. 5 represent spins to be processed, arranged in order. The black rectangles represent flip spins, which are spins for which flips are accepted. The length between vertical lines represents a fixed width. That is, the example shown in FIG. 5 is an example in which there is one flip spin within a fixed width. The meanings of the notations shown in FIG. 5 are the same in FIGS. 6 to 7.

[0072] The long and thin rectangles shown in the middle of Fig. 5 represent parallel processing by the general SA method. As shown in the middle of Fig. 5, in the general SA method, the start position of parallel processing differs depending on the position of the spin that was flipped last time.

[0073] The shaded rectangles in Figure 5 represent wasted operations. If the starting position of the parallel processing is different, the amount of wasted operations also changes. For example, in process A shown in Figure 5, after the first parallel processing is completed, the front spin of the target of the second parallel processing is flipped. In other words, the amount of wasted operations becomes relatively large.

[0074] Also, for example, in process B shown in Figure 5, the spin at the rear of the target of the first parallel process is flipped. In other words, the amount of wasted calculations is relatively small.

[0075] 5 represent parallel processing by the simulated annealing apparatus 100. In parallel processing by the simulated annealing apparatus 100, the starting position of the parallel processing does not differ regardless of the position of the previously flipped spin.

[0076] Since the start positions of the parallel processes do not change, the amount of wasted calculations does not change either. For example, in the process shown in the lower part of FIG. 5, after the first parallel process ends, the central spin (flip spin) of the target of the second parallel process flips. The simulated annealing apparatus 100 executes the remaining parallel processes, using the spin after the flip spin as the start position. In other words, the amount of wasted calculations is determined only by the position of the flip spin.

[0077] When the start position of parallel processing by the general SA method is between the first vertical line and the flip spin (for example, in the case of processing A), the simulated annealing apparatus 100 can reduce the amount of wasted calculations. In other words, when there is one flip spin within a fixed width, there is a 50% probability that the simulated annealing apparatus 100 can reduce the amount of wasted calculations compared to the general SA method.

[0078] 6 is an explanatory diagram showing another example of parallel processing by the general SA method and parallel processing by the simulated annealing apparatus 100. As shown in the upper part of FIG. 6, the spins to be processed in this example include two flip spins.

[0079] The long and thin rectangle in the middle of Fig. 6 represents parallel processing by a general SA method. The rectangle with an upward slanting line in Fig. 6 represents calculations that are wasted due to the first flip spin. As shown in the middle of Fig. 6, similar to the example shown in Fig. 5, if the start position of the parallel processing is different, the amount of calculations that are wasted due to the first flip spin also changes.

[0080] Moreover, the rectangle with diagonal lines downward to the right in Fig. 6 represents the computation wasted due to the second flip spin. In each of processes C to E in Fig. 6, the parallel processing is resumed from the spin next to the first flip spin, so the amount of computation wasted due to the second flip spin is the same. In other words, the amount of computation wasted due to the second flip spin is determined by the positions of the two flip spins.

[0081] The elongated rectangles shown in the lower part of Fig. 6 represent parallel processing by the simulated annealing apparatus 100. In the processing shown in the lower part of Fig. 6, after the first parallel processing is completed, the central spin (first flip spin) of the target of the second parallel processing is flipped. The simulated annealing apparatus 100 executes the remaining parallel processing, using the spin next to the first flip spin as the starting position.

[0082] In addition, the central spin (second flip spin) of the target of the third parallel processing is flipped. The simulated annealing apparatus 100 executes the remaining parallel processing, with the spin next to the second flip spin as the starting position.

[0083] When there are two flip spins within a fixed width, the simulated annealing apparatus 100 can always reduce the amount of calculations wasted due to the second flip spin by the length of the double-ended arrow, compared to the general SA method, as shown in Fig. 6. The length of the double-ended arrow corresponds to the length from the first vertical line to the position of the first flip spin.

[0084] As described above, unlike the example shown in FIG. 5, in the example shown in FIG. 6 where there are two flip spins within a fixed width, the simulated annealing apparatus 100 can always reduce the amount of calculations wasted due to flip spins compared to the general SA method.

[0085] 7 is an explanatory diagram showing another example of parallel processing by the general SA method and parallel processing by the simulated annealing apparatus 100. As shown in the upper part of FIG 7, the spins to be processed in this example include three flip spins.

[0086] The long and thin rectangles shown in the middle of Fig. 7 represent parallel processing by a general SA method. The rectangles with diagonal lines rising to the right in Fig. 7 represent calculations that are wasted due to the first flip spin. As in the example shown in Fig. 5, the amount of calculations that are wasted due to the first flip spin differs depending on the starting position of the first parallel processing.

[0087] Moreover, the rectangle with the downward diagonal line in Fig. 7 represents the calculations wasted due to the second flip spin. Since the second parallel process resumes from the next spin after the first flip spin, the amount of calculations wasted due to the second flip spin remains unchanged.

[0088] Also, the rectangle with vertical lines in Figure 7 represents the calculations wasted due to the third flip spin. Since the third parallel process resumes from the spin next to the second flip spin, the amount of calculations wasted due to the third flip spin remains unchanged. The amount of calculations wasted due to the third flip spin is determined by the positions of the second and third flip spins.

[0089] The elongated rectangles shown in the lower part of Fig. 7 represent parallel processing by the simulated annealing apparatus 100. In the processing shown in the lower part of Fig. 7, after the first parallel processing is completed, the central spin (first flip spin) of the target of the second parallel processing is flipped. The simulated annealing apparatus 100 executes the remaining parallel processing, using the spin next to the first flip spin as the starting position.

[0090] In addition, the central spin (second flip spin) of the target of the third parallel processing is flipped. The simulated annealing apparatus 100 executes the remaining parallel processing, with the spin next to the second flip spin as the starting position.

[0091] In addition, the central spin (third flip spin) of the target of the fourth parallel processing has flipped. The simulated annealing apparatus 100 executes the remaining parallel processing, with the spin next to the third flip spin as the starting position.

[0092] When there are three flip spins within a fixed width, the simulated annealing apparatus 100 can always reduce the amount of calculations wasted due to the second flip spin by the length of the double-ended dashed arrow compared to the general SA method, as shown in Fig. 7. The length of the double-ended dashed arrow corresponds to the length from the first vertical line to the position of the first flip spin.

[0093] Similarly, the simulated annealing apparatus 100 can always reduce the amount of calculations wasted due to the third flip spin by the length of the double-sided arrow, as compared to the general SA method, as shown in Fig. 7. The length of the double-sided arrow corresponds to the length from the first vertical line to the position of the second flip spin.

[0094] As described above, unlike the example shown in Fig. 5, in the example shown in Fig. 7 where there are three flip spins within the fixed width, the simulated annealing apparatus 100 can always reduce the amount of calculation wasted due to flip spins compared to the general SA method. Moreover, the more flip spins there are within the fixed width, the more the simulated annealing apparatus 100 can reduce the amount of calculation wasted.

[0095] As described above, the simulated annealing apparatus 100 of this embodiment is a simulated annealing apparatus that solves a combinatorial optimization problem by a simulated annealing method. The simulated annealing apparatus 100 includes an energy calculation unit 110, a flip confirmation unit 120, a start position / parallel number calculation unit 130, and an energy update unit 140.

[0096] The flip confirmation unit 120 executes in parallel, with a parallel count n, a confirmation process of whether or not a flip is accepted for each of n spins, {(k-1)·n+1}th to k·nth (k is an integer equal to or greater than 1, and n is an integer equal to or greater than 2), that constitute an energy function in an Ising model that represents a combinatorial optimization problem.

[0097] In addition, when acceptance of a flip is first confirmed for the mth spin (m is an integer equal to or greater than {(k-1)·n+1} and less than k·n), the energy updating unit 140 updates the amount of change in the energy of the spin related to the mth spin in the state in which the mth spin has flipped.

[0098] Furthermore, the start position / parallel number calculation unit 130 changes the spin for which the next confirmation process is executed to the (m+1)th to k·nth spins, and changes the parallel number to (nm).

[0099] After it is determined whether the k·nth spin will flip or not, the flip confirmation unit 120 executes confirmation processing in parallel with a parallel number n for each of the n spins from (k·n+1)th to (k+1)·nth.

[0100] In addition, the energy calculation unit 110 calculates the amount of change in energy due to the flip of the spins across all the spins that make up the energy function. The flip confirmation unit 120 executes the first confirmation process after the amount of change in energy is calculated.

[0101] As described above, the flip checking unit 120 and the energy updating unit 140 may be realized by a vector calculator. The combinatorial optimization problem may be a traveling salesman problem.

[0102] [Explanation of operation] Hereinafter, the operation of the simulated annealing apparatus 100 of this embodiment will be described with reference to Fig. 8. Fig. 8 is a flowchart showing the operation of the simulated annealing apparatus 100 of this embodiment for solving a combinatorial optimization problem.

[0103] First, a combinatorial optimization problem described in the Ising model format is input to the simulated annealing apparatus 100.

[0104] The starting position / parallel number calculation unit 130 determines the initial parallel number K (K is an integer equal to or greater than 2) of parallel processing when solving an input combinatorial optimization problem by the SA method (step S101).

[0105] Next, the energy calculation unit 110 calculates in parallel the amount of change in energy due to spin flips across all spins that configure the energy function in the Ising model (step S102). Next, the simulated annealing apparatus 100 enters an iteration (step S103).

[0106] Next, the simulated annealing apparatus 100 enters a spin loop (step S104). Next, the start position / parallel number calculation unit 130 changes the start position of the parallel processing and the parallel number N (N is an integer equal to or greater than 2) (step S105).

[0107] In the first spin loop, the start position / parallel number calculation unit 130 sets the start position of the parallel processing to the first spin. Also, the start position / parallel number calculation unit 130 sets the parallel number N to the initial parallel number K.

[0108] Next, the flip check unit 120 performs flip check calculations in parallel for each of the first to K-th spins (steps S1061 to S106 N ).

[0109] Next, the flip confirmation unit 120 determines in parallel whether or not to accept a flip for each of the first to Kth spins (steps S1071 to S107 N ).

[0110] Next, flip confirmation unit 120 confirms whether or not there is at least one spin for which a flip is accepted other than the last spin (the Kth spin) (step S108).

[0111] If there is at least one spin for which a flip is accepted other than the last one (Yes in step S108), the flip confirmation unit 120 flips the first spin among the spins for which a flip is accepted (step S109).

[0112] Next, the energy updating section 140 updates in parallel the change amounts of the spin energies associated with the flipped spins (step S110).

[0113] Next, the start position / parallel number calculation unit 130 changes the start position of the parallel processing and the parallel number N (step S111). For example, when the first spin among the spins for which a flip is accepted is the M-th spin (M is an integer equal to or greater than 1 and less than K), the start position / parallel number calculation unit 130 changes the start position of the parallel processing to the (M+1)-th spin.

[0114] In addition, the start position / parallel number calculation unit 130 changes the parallel number N to (KM). After changing the start position and the parallel number N, the flip confirmation unit 120 performs steps S1061 to S106 N The above process is executed again in parallel.

[0115] For example, the flip check unit 120 performs flip check calculations in parallel for each of the (M+1)th to Kth (KM) spins (steps S1061 to S106 N ).

[0116] Furthermore, the flip confirmation unit 120 determines in parallel whether or not to accept a flip for each of the (M+1)th to Kth (KM) spins (steps S1071 to S107 N ).

[0117] If there is no spin other than the last one for which a flip is accepted (No in step S108), the start position / parallel number calculation unit 130 executes the process of step S105 again.

[0118] When starting the second spin loop, the start position / parallel number calculation unit 130 changes the start position of the parallel processing to the (K+1)th spin, and also changes the parallel number N to the initial parallel number K (step S105).

[0119] The simulated annealing apparatus 100 repeatedly executes the processes of steps S105 to S111 while there are spins whose directions have not yet been determined among the spins that constitute the energy function in the Ising model. When the directions of all spins have been determined, the simulated annealing apparatus 100 exits the spin loop (step S112).

[0120] The simulated annealing apparatus 100 repeatedly executes the processes of steps S104 to S112 until the number of iterations reaches a predetermined number (several thousand times, tens of thousands of times, etc.), for example. When the number of iterations reaches the predetermined number, the simulated annealing apparatus 100 ends the iteration (step S113) and ends the process of solving the combinatorial optimization problem.

[0121] [Effect description] In the simulated annealing apparatus 100 of this embodiment, when a spin to be processed in parallel flips, the start position / parallel number calculation unit 130 changes the start position and parallel number of the parallel processing. After the start position and the parallel number are changed, the remaining parallel processing is executed.

[0122] By executing parallel processing while changing the number of parallel processes as described above, the simulated annealing apparatus 100 can reduce the amount of wasted calculations compared to the general SA method as the number of spins in which flips are accepted increases. Therefore, the simulated annealing apparatus 100 can efficiently parallelize the iterative processing by the simulated annealing method.

[0123] Furthermore, the flip confirmation unit 120 and the energy update unit 140 of the simulated annealing apparatus 100 of this embodiment may be realized by a vector calculator. By realizing them by a vector calculator, the influence of overhead due to synchronization that occurs in parallelization by multi-processing or multi-threading is eliminated.

[0124] A specific example of the hardware configuration of the simulated annealing apparatus 100 of this embodiment will be described below. Fig. 9 is an explanatory diagram showing an example of the hardware configuration of the simulated annealing apparatus according to the present invention.

[0125] 9 includes a CPU (Central Processing Unit) 11, a main memory unit 12, a communication unit 13, and an auxiliary memory unit 14. It also includes an input unit 15 for user operation and an output unit 16 for presenting the processing results or the progress of the processing contents to the user.

[0126] The simulated annealing apparatus 100 is realized by software, in which the CPU 11 shown in FIG. 9 executes a program that provides the functions of each component.

[0127] That is, the CPU 11 loads a program stored in the auxiliary storage unit 14 into the main storage unit 12, executes it, and controls the operation of the simulated annealing apparatus 100, whereby each function is realized by software.

[0128] 9 may include a DSP (Digital Signal Processor) instead of the CPU 11. Alternatively, the simulated annealing apparatus 100 shown in FIG 9 may include both the CPU 11 and a DSP.

[0129] The main memory unit 12 is used as a working area for data and a temporary storage area for data. The main memory unit 12 is, for example, a RAM (Random Access Memory).

[0130] The communication unit 13 has a function of inputting and outputting data to and from peripheral devices via a wired network or a wireless network (information and communication network).

[0131] The auxiliary storage unit 14 is a non-transitory tangible storage medium. Examples of non-transitory tangible storage media include a magnetic disk, a magneto-optical disk, a CD-ROM (Compact Disk Read Only Memory), a DVD-ROM (Digital Versatile Disk Read Only Memory), and a semiconductor memory.

[0132] The input unit 15 has a function of inputting data and processing commands, and is, for example, an input device such as a keyboard or a mouse.

[0133] The output unit 16 has a function of outputting data, and is, for example, a display device such as a liquid crystal display device, or a printing device such as a printer.

[0134] As shown in FIG. 9, in the simulated annealing apparatus 100 , each component is connected to a system bus 17 .

[0135] In the simulated annealing apparatus 100 , the auxiliary storage unit 14 stores programs for implementing an energy calculation unit 110 , a flip confirmation unit 120 , a start position / parallel number calculation unit 130 , and an energy update unit 140 .

[0136] The simulated annealing apparatus 100 may be implemented with a circuit including hardware components such as an LSI (Large Scale Integration) that realizes the functions shown in FIG.

[0137] The simulated annealing apparatus 100 may also be realized by hardware that does not include a computer function using an element such as a CPU. For example, some or all of the components may be realized by a general-purpose circuit, a dedicated circuit, a processor, or a combination of these. These may be configured by a single chip (for example, the above-mentioned LSI), or may be configured by multiple chips connected via a bus. Some or all of the components may be realized by a combination of the above-mentioned circuits, etc. and a program.

[0138] Furthermore, some or all of the components of the simulated annealing apparatus 100 may be configured with one or more information processing devices each including a calculation unit and a storage unit.

[0139] When some or all of the components are realized by a plurality of information processing devices, circuits, etc., the plurality of information processing devices, circuits, etc. may be centrally or distributed. For example, the information processing devices, circuits, etc. may be realized as a client-server system, a cloud computing system, etc., in a form in which each is connected via a communication network.

[0140] Next, an overview of the present invention will be described below. Fig. 10 is a block diagram showing an overview of a simulated annealing apparatus according to the present invention. A simulated annealing apparatus 20 according to the present invention is a simulated annealing apparatus that solves a combinatorial optimization problem by a simulated annealing method, and includes: confirmation means 21 (e.g., flip confirmation unit 120) that executes in parallel with a parallel number n a confirmation process of whether or not a flip is accepted for each of n spins from {(k-1)·n+1}th to k·nth (k is an integer equal to or greater than 1, and n is an integer equal to or greater than 2) that constitute an energy function in an Ising model that represents the combinatorial optimization problem; update means 22 (e.g., energy update unit 140) that updates the amount of change in energy of the spin related to the mth spin in a state in which the mth spin has been flipped when acceptance of a flip is first confirmed for the mth spin (m is an integer equal to or greater than {(k-1)·n+1} and less than k·n); and change means 23 (e.g., start position / parallel number calculation unit 130) that changes the spin for which the next confirmation process is executed to the (m+1)th to k·nth spins and the parallel number to (nm), respectively.

[0141] With such a configuration, the simulated annealing apparatus can efficiently parallelize repetitive processing using the simulated annealing method.

[0142] In addition, after it is determined whether the k·nth spin will flip or not, the confirmation means 21 may execute confirmation processing in parallel with a parallel number n for each of the n spins, from (k·n+1)th to (k+1)·nth.

[0143] With such a configuration, the simulated annealing apparatus can efficiently parallelize repetitive processing using the simulated annealing method.

[0144] The simulated annealing apparatus 20 may also include a calculation means (e.g., a flip confirmation unit 120) that calculates the amount of energy change due to a spin flip across all spins that make up the energy function, and the confirmation means 21 may perform a first confirmation process after the amount of energy change has been calculated.

[0145] With such a configuration, the simulated annealing apparatus can solve combinatorial optimization problems more quickly.

[0146] Also, the confirmation means 21 and the update means 22 may be realized by a vector calculator.

[0147] With such a configuration, the simulated annealing apparatus can reduce the effect of synchronization overhead in parallelization using multiple processes or multiple threads.

[0148] The combinatorial optimization problem may also be the traveling salesman problem.

[0149] With such a configuration, the simulated annealing apparatus can solve the traveling salesman problem more quickly.

[0150] Although the present invention has been described above with reference to the embodiments and examples, the present invention is not limited to the above-mentioned embodiments and examples. Various modifications that can be understood by those skilled in the art can be made to the configuration and details of the present invention within the scope of the present invention. [Explanation of symbols]

[0151] 11 CPU 12 Main memory 13. Communications Department 14 Auxiliary storage 15 Input section 16 Output section 17 System Bus 20, 100 Simulated annealing device 21 Verification Method 22 Update method 23 Means of change 110 Energy Calculation Department 120 Flip confirmation section 130 Start position / parallel number calculation section 140 Energy Renewal Department

Claims

1. A simulated annealing device that solves a combinatorial optimization problem by a simulated annealing method, comprising: a confirmation means for executing in parallel, with a parallel number n, a confirmation process of whether or not a flip is accepted for each of n spins from {(k-1)·n+1}th to k·nth (k is an integer of 1 or more, n is an integer of 2 or more) constituting an energy function in an Ising model that represents the combinatorial optimization problem; updating means for updating an amount of change in spin energy associated with an m-th spin when acceptance of a flip is first confirmed for an m-th spin (m is an integer equal to or greater than {(k-1)·n+1} and less than k·n) in a state in which the m-th spin has been flipped; and a change means for changing the number of parallel spins for which the next confirmation process is executed to (m+1)-th to k / n-th spins and (n-m), respectively. A simulated annealing apparatus comprising:

2. The confirmation means executes confirmation processing in parallel with a parallel number n for each of the n spins from the (k·n+1)th to the (k+1)·nth spins after it is determined whether the k·nth spin will flip or not.

2. The simulated annealing apparatus according to claim 1.

3. A calculation means is provided for calculating an amount of change in energy due to a spin flip across all spins constituting an energy function, The confirmation means executes a first confirmation process after each of the energy changes is calculated.

3. The simulated annealing apparatus according to claim 1 or 2.

4. The checking means and the updating means are realized by a vector calculator. The simulated annealing apparatus according to any one of claims 1 to 3.

5. Combinatorial optimization problems are traveling salesman problems The simulated annealing apparatus according to any one of claims 1 to 4.

6. A simulated annealing method for solving a combinatorial optimization problem using a simulated annealing method, comprising: The computer executes in parallel, with a parallel number n, a process of confirming whether or not a flip is accepted for each of n spins, {(k-1)·n+1}th to k·nth (k is an integer of 1 or more, n is an integer of 2 or more), that configure an energy function in an Ising model that represents the combinatorial optimization problem; When the computer first confirms acceptance of a flip for an m-th spin (m is an integer equal to or greater than {(k-1)·n+1} and less than k·n), it updates the amount of change in spin energy associated with the m-th spin with the m-th spin flipped; The computer changes the spin for which the next confirmation process is executed to the (m+1)th to k·nth spins and changes the number of parallel spins to (n−m). A simulated annealing method comprising:

7. After it is determined whether the k.times.n-th spin will flip or not, the computer executes confirmation processing in parallel for each of the (k.times.n+1)-th to (k+1).times.n-th spins with a parallel number of n.

7. The simulated annealing method of claim 6.

8. A simulated annealing program executed on a computer that solves a combinatorial optimization problem using a simulated annealing method, comprising: The computer includes: a parallel process of executing in parallel, with a parallel number n, a process of confirming whether or not a flip is accepted for each of n spins from {(k-1)·n+1}th to k·nth (k is an integer of 1 or more, n is an integer of 2 or more) that constitute an energy function in an Ising model that represents the combinatorial optimization problem; an update process for updating the amount of change in the spin energy associated with the mth spin when the flip acceptance is first confirmed for the mth spin (m is an integer equal to or greater than {(k-1)·n+1} and less than k·n) with the mth spin flipped; A process of changing the spin for which the next confirmation process is executed to the (m+1)th to k / nth spins, and the number of parallel spins to (n-m) A simulated annealing program for executing the above.

9. On the computer, In parallel processing, after it is determined whether the k.times.n-th spin will flip or not, confirmation processing is executed in parallel for each of the n spins from (k.times.n+1)-th to (k+1).times.n-th with a parallel number of n.

9. The simulated annealing program according to claim 8.

Citation Information

Patent Citations

  • Optimization problem arithmetic program, optimization problem arithmetic method, and optimization problem arithmetic device

    JP2020046997A

  • Information processing device and information processing method

    JP2021043508A

  • Optimization device and control method for optimization device

    WO2020054062A1