This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2021-101881, filed on Jun. 18, 2021, the entire contents of which are incorporated herein by reference.
The embodiments discussed herein are related to a storage medium, an optimization method, and an information processing apparatus.
An optimization process is known in one field of information processes. For example, there are an optimization problem and the like of obtaining a solution (optimum solution) by minimizing or maximizing resources and costs desirable in a case of performing a certain process, in the optimization process.
As a representative example of the optimization problem, a linear programming problem is known. The linear programming problem obtains a value of a variable that maximizes or minimizes an evaluation function represented by a linear sum of a plurality of continuous variables under a constraint condition represented by the linear sum, and is used in various fields such as a production plan of a product.
Many optimization problems are known in which variables are not continuous values but are discrete values. For example, a knapsack problem is known as a problem that takes a discrete value of an optimization problem.
The knapsack problem is a problem in which a knapsack having a certain capacity and a plurality of loads having values and capacities different from each other are given, some loads are packed in the knapsack within a range not exceeding the capacity of the knapsack, and a combination having a maximum total value is obtained as an optimum solution.
Japanese Laid-open Patent Publication No. 2016-103282 and Japanese Laid-open Patent Publication No. 2019-016077 are disclosed as related art.
According to an aspect of the embodiments, a non-transitory computer-readable storage medium storing an optimization program that causes at least one computer to execute a process, the process includes selecting a plurality of bits based on a constraint condition of an optimization problem for each of a plurality of first elements that are search targets of a solution for the optimization problem, from bit group information indicating whether each of a plurality of second elements included in each of the plurality of first elements are selected to be used for searching for the solution of the optimization problem; determining whether to accept the selected plurality of bits based on a certain condition; when the selected plurality of bits are accepted, inverting the plurality of bits in the bit group information; when the selected plurality of bits are not accepted, inverting the plurality of bits to return to a state before the determining in the bit group information; and searching for the solution of the optimization problem based on a selection status of each of the plurality of bits in the bit group information.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention.
In the knapsack problem, in a case where the loads having different values are put in and taken out the knapsack so as to obtain the optimum solution, when a new load is put in instead of the high-value load put in the knapsack first, the value significantly deteriorates. As a result, in a case where the optimum solution is searched in a state in which the high-value load put in the knapsack is left as it is, it may be difficult to reach the optimum solution, due to a local solution.
By contrast, in a case where a criterion for determining whether to newly accept a load is made stricter, it takes time to reach the optimum solution while being captured in the local solution, and the time to reach the optimum solution becomes longer. On the other hand, in a case where the criterion for determining whether to accept a load to be put in a knapsack is set to be low, the solution largely deviates from the original solution and diverges.
According to an aspect, there is provided an optimization program, an optimization method, and an information processing apparatus capable of reducing a time taken to reach an optimum solution.
According to an embodiment, it is possible to reduce a time taken to reach an optimum solution.
Hereinafter, embodiments of an optimization program, an optimization method, and an information processing apparatus disclosed herein will be described in detail based on the drawings. The embodiments are not intended to limit the scope of the present disclosure. Each embodiment may be combined as appropriate within a scope without contradiction.
[Overview of 0-1 Knapsack Problem of Reference Technique 1]
First, a 0-1 knapsack problem according to Reference Technique 1 will be described.
In the knapsack problem, a knapsack F1 having a certain capacity and n types of loads are given. The knapsack problem is a problem in which some loads are packed in the knapsack F1 within a range not exceeding the capacity of the knapsack F1, and a combination that maximizes a total value of the loads is obtained as an optimum solution. For example, the knapsack problem is classified into a problem of a 0-1 integer programming problem among integer programming problems, and a solution is either 0 or 1 as follows.
When a plurality of loads are packed in the knapsack F1, a case where each of the plurality of loads has a capacity and the knapsack F1 has a limit on a capacity (b) will be described. At this time, when the number of loads is n, the capacity of the load is ai, a value is ci yen, and the capacity of the knapsack is b cm3, the knapsack problem may be formulated (2) as follows.
objective function: Σi=1ncixi→max
constraint condition: Σi=1naixi≤b capacity constraint
x
1
,x
2
. . . x
n∈≤{0,1} Formula (2)
For example, in the knapsack problem, a combination in which some loads (aixi) are packed in the knapsack F1 and a total value (cixi) of the loads is maximized is obtained as an optimum solution so as to satisfy Formula (2).
For example, as illustrated in
Next, a method of searching for an optimum solution for the 0-1 knapsack problem according to Reference Technique 1 will be described.
As illustrated in
Subsequently, in Reference Technique 1, an optimum solution is obtained by repeating putting in and taking out the load B1 to the load B5 to and from the knapsack F1. As illustrated in
Next, a flow of processes in the 0-1 knapsack problem according to Reference Technique 1 will be described.
As illustrated in
Subsequently, in Reference Technique 1, acceptance determination of the bit freely selected is performed (step S2). For example, in Reference Technique 1, the acceptance determination is performed whether or not to accept inversion of the bit selected in step S1 from a current state. Details of the acceptance determination will be described below. In a case where the acceptance determination of the freely selected bit is permitted (Yes in step S2), the process proceeds to step S3, in Reference Technique 1. By contrast, in a case where the acceptance determination of the freely selected bit is rejected (No in step S2), the process returns to step S1, in Reference Technique 1.
At step S3, the selected bit is inverted, in Reference Technique 1. For example, as illustrated in
Subsequently, in Reference Technique 1, end determination is performed (step S4), the present process is ended in a case where a result of the end determination is permitted (Yes in step S4), and the process returns to step S1 in a case where the result of the end determination is rejected (No in step S4). The end determination is any one or more of determination of whether or not an optimum solution (for example, a best solution) is obtained among a plurality of solutions obtained in a plurality of processes in the past, determination of whether or not the number of preset processes is reached, and determination of whether or not a preset time period set elapses.
Next, a task of the 0-1 knapsack problem according to Reference Technique 1 will be described.
As indicated by the polygonal line L1 in
For this reason, in Reference Technique 1, it is difficult to exceed a deep valley of energy of the maximization problem, and the optimum solution is not reached. For example, in Reference Technique 1, in a case where a criterion for the acceptance determination described above is set to be low, the solution largely deviates from the solution of the main body and diverges. Meanwhile, in a case where the criterion for the acceptance determination is set to be high, it is not possible to reach the optimum solution while being captured by a local solution (for example, the value of the load B1). The criterion is a current value (current solution) or the like. For example, in Reference Technique 1, in a case where the criterion for the acceptance determination is set to be high, the current value (current solution) is accepted when the current value (current solution) is higher than the criterion for the acceptance determination. According to Reference Technique 1, in a case where the criterion for acceptance determination is set to be low, the current value (current solution) is accepted even when the value is equal to or more than a predetermined range from the criterion (for example, equal to or more than 10% from the criterion).
[Knapsack Derivation Problem of Reference Technique 2]
Next, a knapsack derivation problem will be described.
As illustrated in
According to Reference Technique 2, a description will be given of a case where each load of the group A (lunchbox), the group B (beverage), and the group C (dessert) has a capacity, and the knapsack F2 has a limit on the capacity (b). At this time, when one load is selected from each of the group A (lunchbox), the group B (beverage), and the group C (dessert), the capacity of the load is set to ai, a value of the load is set to ci yen, and the capacity of the knapsack F1 is set to b cm3, the knapsack derivation problem may be formulated (3) as follows.
objective function: Σi=1ncixi→max
constraint condition I: Σi=1naixi≤b capacity constraint
constraint condition II: Σi=1n
constraint condition III: Σn
constraint condition IV: Σn
x
1
,x
2
. . . x
n∈≤{0,1} Formula (3)
For example, in Reference Technique 2, loads are selected one by one from each of the group A (lunchbox), the group B (beverage), and the group C (dessert) so as to satisfy Formula (3), and a combination in which a total value of the loads selected from each of the group A (lunchbox), the group B (beverage), and the group C (dessert) is maximized is obtained as an optimum solution.
For example, as illustrated in
Next, a method of searching for the optimum solution for the knapsack derivation problem according to Reference Technique 2 will be described.
As illustrated in
Subsequently, with Reference Technique 2, an optimum solution is obtained by repeatedly putting in and taking out the loads of each of the group A (lunchbox), the group B (beverage), and the group C (dessert) to and from the knapsack F2. As illustrated in
Next, a task of the knapsack derivation problem according to Reference Technique 2 will be described.
As indicated by the polygonal line L2 in
For this reason, in Reference Technique 2, it is difficult to exceed a deep valley of energy of the maximization problem, and the optimum solution is not reached.
[Integer Carry Problem of Reference Technique 3]
Next, Reference technique 3 will be described.
As illustrated in
objective function: |Σi=1ncixi−16|→min
constraint condition:x1,x2. . . xn∈≤{0,1} Formula (4)
Next, a method of searching for an optimum solution in a three-integer carry problem according to Reference Technique will be described.
As illustrated in
Next, a flow of processes in the integer carry problem according to Reference Technique 3 will be described.
As illustrated in
At step S13, the selected bit is inverted, in Reference Technique 3. For example, in Reference Technique 3, one selected bit freely selected in step S11 is inverted. For example, in Reference Technique 3, in a case where a bit state of the bit freely selected in step S11 is “0”, the bit state is inverted to “1”.
Subsequently, in Reference Technique 3, end determination is performed (step S14), the present process is ended in a case where a result of the end determination is permitted (Yes in step S14), and the process returns to step S11 in a case where the result of the end determination is rejected (No in step S14).
Next, a task of the integer carry problem according to Reference Technique 3 will be described.
As indicated by the polygonal line L3 in
[Method for Solving Each Task of Reference Technique 1 to Reference Technique 3]
Next, a method for solving each task of Reference Techniques 1 to 3 described above, which is executed by the information processing apparatus 10 according to the present embodiment, will be described. First, a method for solving a task of the 0-1 knapsack problem according to Reference Technique 1 will be described.
As illustrated in
At step S23, the information processing apparatus 10 collectively inverts the plurality of bits selected based on the certain rule (step S23). In this case, the information processing apparatus 10 updates a value obtained by collectively inverting the plurality of bits selected based on the certain rule as a solution for one process (one set) of a flow of a series of processes in steps S21 to S23.
Subsequently, the information processing apparatus 10 performs end determination (step S24), and ends the present process in a case where a result of the end determination is permitted (Yes in step S24), and returns to step S21 in a case where the result of the end determination is rejected (No in step S24).
[Method for Task of Reference Technique 1]
Next, an overview for solving a task of the 0-1 knapsack problem according to Reference Technique 1 described in the flow in
As indicated by the polygonal line L11 and the polygonal line L12 in
As indicated by the polygonal line L11 and the polygonal line L13 in
In this manner, the information processing apparatus 10 may make the valley of energy (value) of the maximization problem shallow, by collectively evaluating the plurality of bits selected based on the certain rule.
[Method for Task of Reference Technique 2]
Next, a method for solving a task of the knapsack derivation problem according to Reference Technique 2, which is executed by the information processing apparatus 10, will be described.
As illustrated in
Subsequently, the information processing apparatus 10 selects a plurality of bits, based on a constraint condition of the optimization problem, from the bit group information related to bit information indicating whether or not the lunchbox B11 to the lunchbox B15 of each second element included in the group A of the first element are selected. For example, the information processing apparatus 10 performs the multi-bit inversion on the lunchbox B11 to the lunchbox B15 of each second element included in the group A of the first element by taking out the lunchbox B12 (from “1” to “0”) and putting in the lunchbox B11 (from “0” to “1”). Details of the constraint condition for the optimization problem will be described below.
As indicated by the polygonal line L21 and the polygonal line L22 in
As indicated by the polygonal line L21 and the polygonal line L23 in
In this manner, the information processing apparatus 10 selects a group (three groups of the group A, the group B, and the group C) as a certain rule, and selects 6 bits in total since only one bit of each load, which is a second element, is set to “1” in each group. According to Reference Technique 2, by collectively evaluating 6 bits, it is possible to remove a valley of energy (value) of the maximization problem.
[Method for Task of Reference Technique 3]
Next, a method for solving a task of the integer carry problem of Reference Technique 3, which is executed by the information processing apparatus 10, will be described.
The information processing apparatus 10 selects a group as a certain rule. Subsequently, the information processing apparatus 10 sets a bit having the current bit in a state of “0” in the selected group to “1”, and sets all bits corresponding to digits lower than the current bit to “0”. For example, as illustrated in
In this manner, in a case where the information processing apparatus 10 selects a group as a certain rule, sets a bit in a state in which the current bit is “0” in the selected group to “1”, and sets all bits corresponding to digits lower than the current bit to “0”, it is possible to make the valley of the energy (value) of the minimization problem shallow.
[Functional Configuration of Information Processing Apparatus]
Next, the information processing apparatus that solves each task of Reference Techniques 1 to 3 described above will be described.
As illustrated in
Under control of the control unit 20, the communication unit 11 communicates with another device (for example, a display apparatus, a server apparatus, or the like) via a communication cable or the like. For example, the communication unit 11 is realized by a communication interface coupled to a display apparatus, a network interface card (NIC) coupled to a communication network such as local area network (LAN), or the like.
For example, the storage unit 12 corresponds to a semiconductor memory element such as a random-access memory (RAM) or a flash memory, or a storage apparatus such as a hard disk drive (HDD). The storage unit 12 includes a solution non-update count 13, an each bit cumulative inversion count 14, constraint satisfaction rate information 15, bit group information 16, and a selection status 17.
The solution non-update count 13 stores the number of times a solution is not updated when an optimum solution for a combination is searched while a plurality of bits are inverted.
The each bit cumulative inversion count 14 stores a cumulative count of the number of times of selection of each bit in the plurality of bits which are second elements. For example, the each bit cumulative inversion count 14 stores an inversion frequency of the number of times of selection of each bit in the plurality of bits as the cumulative count.
The constraint satisfaction rate information 15 stores a constraint satisfaction rate of a bit selected among the plurality of bits.
For each first element that is a search target for an optimum solution in an optimization problem, the bit group information 16 stores information on bit information indicating whether or not each second element included in each first element is selected. For example, the bit group information 16 stores information on a plurality of groups into which a plurality of bits are divided for each predetermined bit.
The selection status 17 stores each bit information in the bit group information 16. For example, the selection status 17 stores a status of “1” or “0” of each bit of each of the group A to the group C.
The control unit 20 is a processing unit that controls the entire information processing apparatus 10, and may be realized by a central processing unit (CPU), a microprocessor unit (MPU), or the like, for example. The control unit 20 may be realized by a hard wired logic such as an application-specific integrated circuit (ASIC) or a field-programmable gate array (FPGA). The control unit 20 includes an acquisition unit 21, a selection unit 22, a determination unit 23, an inversion unit 24, a storage unit 25, a selection unit 26, a search unit 27, and an output unit 28. The acquisition unit 21, the selection unit 22, the determination unit 23, the inversion unit 24, the storage unit 25, the selection unit 26, the search unit 27, and the output unit 28 may be realized by an electronic circuit such as a processor, or may be realized as an example of a process executed by the processor.
The acquisition unit 21 acquires the solution non-update count 13 in a case where a solution is not updated when searching for an optimum solution of a combination while inverting a plurality of bits stored in a storage unit 12, and the each bit cumulative inversion count 14. The acquisition unit 21 acquires the constraint satisfaction rate information 15 of the bit when the plurality of bits stored in the storage unit 12 are preferentially selected, the bit group information 16 related to a plurality of groups into which the plurality of bits are divided for each predetermined bit, and current bit information of each bit.
For each first element that is a search target for the optimum solution in the optimization problem, the selection unit 22 selects a plurality of bits based on the constraint condition of the optimization problem, from the bit group information 16 related to the bit information indicating whether or not each second element included in each first element is selected. For example, the selection unit 22 selects, based on the solution non-update count 13 acquired by the acquisition unit 21, the bit group information 16, the current bit information of each bit, and at least one of the constraint satisfaction rate information 15 indicating a constraint satisfaction rate of the second element and the each bit cumulative inversion count 14, a plurality of bits in which a bit captured in a local solution is incorporated as a priority bit at least when searching for the optimum solution. The selection unit 22 freely selects one bit among the plurality of bits. For example, the selection unit 22 freely selects one bit for predetermined bits among the plurality of bits. The selection unit 22 selects an additional bit based on the bit group information 16 acquired by the acquisition unit 21.
The determination unit 23 executes acceptance determination for determining whether or not to accept the selection of the plurality of bits selected by the selection unit 22. For example, the determination unit 23 determines whether or not a value of the bit freely selected by the selection unit 22 is higher than a predetermined criterion value, and permits the acceptance determination to accept the bit freely selected by the selection unit 22 in a case where it is determined that the value of the bit is higher than the predetermined criterion value. The determination unit 23 performs selection determination of a plurality of bits based on a predetermined rule selected by the selection unit 22. The determination unit 23 performs collective acceptance determination of the plurality of bits. The determination unit 23 performs provisional acceptance determination of the priority bit. The determination unit 23 performs the provisional acceptance determination of the additional selected bit selected by the selection unit 22.
The inversion unit 24 inverts the bit freely selected by the selection unit 22. For example, the inversion unit 24 inverts the bit freely selected by the selection unit 22, for example, inverts “0” to “1”. In a case where the determination unit 23 accepts the selection of the plurality of bits, the inversion unit 24 inverts the plurality of bits in the bit group information 16. By contrast, in a case where the determination unit 23 does not accept the selection of the plurality of bits, the inversion unit 24 returns the plurality of bits to a state before the acceptance determination in the bit group information 16.
The storage unit 25 resets the state of the solution non-update count 13 stored in the storage unit 12 to 0 times, and increments (+1) the number of times of inversion of the selected bit inverted by the inversion unit 24 from the current count of the each bit cumulative inversion count 14 stored in the storage unit 12. The storage unit 25 updates the solution non-update count 13 stored in the storage unit 12 by incrementing (+1) the current count.
The selection unit 26 selects any one of a one-step determination method and a two-step determination method.
Based on the selection status 17 of each bit information in the bit group information 16 stored in the storage unit 12, the search unit 27 searches for an optimum solution of the optimization problem. For example, each time the search unit 27 executes a series of processes including each process of a process of selecting a plurality of bits, a process of executing acceptance determination, and a process of inverting or returning the plurality of bits, the search unit 27 determines whether or not the bits satisfy a condition of the optimum solution of the optimization problem. For example, based on the selection status 17 stored in the storage unit 12, the search unit 27 determines whether or not an optimum solution may be obtained among a plurality of solutions (best solutions) obtained by performing the process in a plurality of times. In a case where the optimum solution may be obtained among the plurality of solutions (best solutions) obtained by performing the process in the plurality of times, based on the selection status 17 stored in the storage unit 12, the search unit 27 determines that the condition of the optimum solution of the optimization problem is satisfied.
As a search result, the output unit 28 outputs each second element specified by the selection status 17 of each bit specified by the search unit 27 to an external display monitor or the like via the communication unit 11.
[Flow of Processes]
A flow of processes executed by the information processing apparatus 10 will be described.
As illustrated in
Subsequently, based on the solution non-update count 13 acquired by the acquisition unit 21, the selection unit 22 selects any one of a single bit inversion method and a plurality of bits inversion method (step S102). For example, the selection unit 22 determines whether or not the solution non-update count 13 acquired by the acquisition unit 21 exceeds a predetermined count, and selects the plurality of bits inversion method in a case where the solution non-update count 13 exceeds the predetermined count, and selects the single bit inversion method in a case where the solution non-update count 13 does not exceed the predetermined count. In a case where the selection unit 22 selects the single bit inversion method (single bit in step S102), the information processing apparatus 10 proceeds to step S103 to be described below. By contrast, in a case where the selection unit 22 selects the plurality of bits inversion method (plurality of bits in step S102), the information processing apparatus 10 proceeds to step S110 to be described below.
[General Single Bit Inversion Procedure]
At step S103, the selection unit 22 freely selects one bit among the plurality of bits. For example, the selection unit 22 freely selects one bit for predetermined bits among the plurality of bits.
Subsequently, the determination unit 23 performs acceptance determination of the bit freely selected by the selection unit 22 (step S104). For example, the determination unit 23 determines whether or not a value of the bit freely selected by the selection unit 22 is higher than a predetermined criterion value, and permits the acceptance determination to accept the bit freely selected by the selection unit 22 in a case where it is determined that the value of the bit is higher than the predetermined criterion value. By contrast, in a case where the determination unit 23 determines that the value of the bit is not higher than the predetermined criterion value, the determination unit 23 does not accept the acceptance determination to accept the bit freely selected by the selection unit 22. In a case where the determination unit 23 permits the acceptance determination of the bit freely selected by the selection unit 22 (Yes in step S104), the information processing apparatus 10 proceeds to step S105 to be described below. By contrast, in a case where the determination unit 23 rejects the acceptance determination of the bit freely selected by the selection unit 22 (No in step S104), the information processing apparatus 10 proceeds to step S107 to be described below.
At step S105, the inversion unit 24 inverts the bit freely selected by the selection unit 22. For example, the inversion unit 24 inverts the bit freely selected by the selection unit 22, for example, inverts “0” to “1”.
Subsequently, the storage unit 25 resets a state of the solution non-update count 13 stored in the storage unit 12 to 0 times, and increments (+1) the number of times of inversion of the selected bit inverted by the inversion unit 24 from the current count of the each bit cumulative inversion count 14 stored in the storage unit 12 (step S106). After step S106, the information processing apparatus 10 proceeds to step S108 to be described below.
At step S107, the storage unit 25 updates the solution non-update count 13 stored in the storage unit 12 by incrementing (+1) the current count. After step S107, the information processing apparatus 10 proceeds to step S108 to be described below.
Subsequently, based on the selection status 17 of each bit information stored in the storage unit 12, the search unit 27 performs end determination (step S108). For example, based on the selection status 17 stored in the storage unit 12, the search unit 27 executes, as the end determination, determination of whether or not an optimum solution may be obtained among a plurality of solutions (best solutions) obtained by performing the process in a plurality of times. In this case, based on the selection status 17 stored in the storage unit 12, in a case where the optimum solution may be obtained among the plurality of solutions (best solutions) obtained by performing the process in the plurality of times, the search unit 27 performs the end determination for ending a target search of the optimum solution in the optimization problem by the information processing apparatus 10. Besides obtaining the optimum solution among the plurality of solutions (best solutions) obtained by performing the process in the plurality of times, the search unit 27 may perform end determination of performing any one or more of determination of whether or not the number of preset processes is reached and determination of whether or not a preset time period elapses. In a case where the search unit 27 permits the end determination (Yes in step S108), the information processing apparatus 10 proceeds to step S109 to be described below. By contrast, in a case where the search unit 27 rejects the end determination (No in step S108), the information processing apparatus 10 returns to step S101 to be described above.
At step S109, as a search result, the output unit 28 outputs each second element specified by the selection status 17 of each bit specified by the search unit 27 to an external display monitor or the like via the communication unit 11. After step S109, the information processing apparatus 10 ends the present process.
[Plurality of Bits Inversion Procedure]
At step S110, the acquisition unit 21 acquires the each bit cumulative inversion count 14 from the storage unit 12.
Subsequently, the acquisition unit 21 acquires the constraint satisfaction rate information 15 from the storage unit 12 (step S111).
After that, the selection unit 22 selects a priority bit among a plurality of bits from bit group information based on at least one of the each bit cumulative inversion count 14 and the constraint satisfaction rate information 15 (step S112). For example, based on at least one of the each bit cumulative inversion count 14 and the constraint satisfaction rate information 15, the selection unit 22 selects, as the priority bit, a bit captured in a local solution at least when searching for an optimum solution. For example, when selecting the plurality of bits from among the predetermined bits, the selection unit 22 selects the priority bit for preferentially incorporating a bit captured in the local solution as compared with other bits when searching for the optimum solution. For example, the selection unit 22 selects, as the priority bit, a bit that is difficult to be inverted as the bit captured in the local solution at least when searching for the optimum solution. For example, in a case of using the each bit cumulative inversion count 14 as a base, the selection unit 22 selects, as the priority bit, a bit corresponding to a bit having the small each bit cumulative inversion count 14. By contrast, in a case of using the constraint satisfaction rate information 15 as the base, the selection unit 22 selects, as the priority bit, a bit corresponding to a bit having a high constraint satisfaction rate for a capacity.
After that, the selection unit 26 selects any one of the one-step determination method and the two-step determination method (step S113). In this case, the selection unit 26 freely selects any one of the one-step determination method and the two-step determination method. With the one-step determination method, it is easier to get out of the local solution, and a probability of acceptance determination by the determination unit 23 decreases. With the two-step determination method, the probability of acceptance determination by the determination unit 23 is high, and it is difficult to get out of the local solution. For this reason, the selection unit 26 selects any one of the one-step determination method and the two-step determination method. For example, the selection unit 26 freely performs the selection such that the one-step determination method is selected once and the two-step determination method is selected twice, among three times, and is not limited thereto. In a case where the one-step determination is selected by the selection unit 26 (one-step determination method in step S113), the information processing apparatus 10 proceeds to step S114 to be described below. By contrast, in a case where the two-step determination is selected by the selection unit 26 (two-step determination method in step S113), the information processing apparatus 10 proceeds to step S122.
[One-Step Determination Method]
At step S114, the acquisition unit 21 acquires the bit group information 16 stored in the storage unit 12. For example, the acquisition unit 21 acquires a bit range of each of the group A, the group B, and the group C, which are first elements of the bit group information 16 stored in the storage unit 12, and the same bit total number of each of the group A, the group B, and the group C.
Subsequently, the selection unit 22 selects an additional bit based on the bit group information 16 acquired by the acquisition unit 21 (step S115). For example, based on the bit group information 16 acquired by the acquisition unit 21, the selection unit 22 selects the additional bit for each first element different from the priority bit to be incorporated into a plurality of bits, together with the priority bit selected in step S111 described above. For example, as illustrated in
After that, the determination unit 23 performs selection determination of the plurality of bits based on a predetermined rule selected by the selection unit 22 (step S116). For example, the determination unit 23 determines whether or not the plurality of bits selected by the selection unit 22 are selected so as to satisfy 6 bits in total including one bit from each of the group A to the group C. In a case where the determination unit 23 permits the selection determination of the plurality of bits based on the predetermined rule selected by the selection unit 22 (Yes in step S116), the information processing apparatus 10 proceeds to step S117 to be described below. By contrast, in a case where the determination unit 23 rejects the selection determination of the plurality of bits based on the predetermined rule selected by the selection unit 22 (No in step S116), the information processing apparatus 10 returns to step S115 described above. In this case, the inversion unit 24 executes inversion control of returning the additional bit to a state before the selection determination of accepting a selection state of the additional bit while maintaining a selection state of the priority bit in the plurality of bits. For example, the inversion unit 24 executes inversion control of resetting the selection states of the group B and the group C which are the additional bits while maintaining the selection state of the bit of the group A that is the priority bit, among the group A to the group C selected by the selection unit 22.
At step S117, the determination unit 23 performs collective acceptance determination for the plurality of bits. In a case where the determination unit 23 permits the collective acceptance determination of the plurality of bits (Yes in step S117), the inversion unit 24 inverts all the bits for the plurality of bits selected by the selection unit 22 (step S118). For example, as illustrated in
At step S119, the storage unit 25 resets a state of the solution non-update count 13 stored in the storage unit 12 to 0 times, and increments (+1) the number of times of inversion of the selected bit inverted by the inversion unit 24 from the current count of the each bit cumulative inversion count 14 stored in the storage unit 12.
Subsequently, based on the selection status 17 of each bit information in the bit group information 16 stored in the storage unit 12, the search unit 27 performs end determination of ending the search for the optimum solution of the optimization problem (step S120). For example, based on the selection status 17 stored in the storage unit 12, the search unit 27 executes, as the end determination, determination of whether or not an optimum solution may be obtained among a plurality of solutions (best solutions) obtained by performing the process in a plurality of times. In this case, based on the selection status 17 stored in the storage unit 12, in a case where the optimum solution may be obtained among the plurality of solutions (best solutions) obtained by performing the process in the plurality of times, the search unit 27 permits the end determination for ending a target search of the optimum solution in the optimization problem by the information processing apparatus 10. In a case where the end determination for searching for the optimum solution of the optimization problem by the search unit 27 is permitted (Yes in step S120), the information processing apparatus 10 proceeds to step S121 to be described below. By contrast, in a case where the search unit 27 rejects the end determination (No in step S120), the information processing apparatus 10 returns to step S101 described above. In this case, the information processing apparatus 10 may execute the end determination by the search unit 27 after executing a series of processes including each process in steps S110 to S119 described above a plurality of times.
At step S121, as a search result, the output unit 28 outputs each second element specified by the selection status 17 of each bit specified by the search unit 27 to an external display monitor or the like via the communication unit 11. After step S121, the information processing apparatus 10 ends the present process.
[Two-Step Determination Method]
At step S122, the acquisition unit 21 acquires the bit group information 16 from the storage unit 12. For example, the acquisition unit 21 acquires a bit range of each of the group A, the group B, and the group C of the bit group information 16 stored in the storage unit 12, and the same bit total number of each of the group A, the group B, and the group C.
Subsequently, the determination unit 23 performs provisional acceptance determination on the priority bit selected by the selection unit 22 (step S123). For example, the determination unit 23 performs the provisional acceptance determination of determining whether or not a value of the priority bit selected by the selection unit 22 is equal to or more than a predetermined criterion. In a case where the value of the priority bit selected by the selection unit 22 is equal to or more than the predetermined criterion, the determination unit 23 permits the provisional acceptance determination of the priority bit selected by the selection unit 22. By contrast, in a case where the value of the priority bit selected by the selection unit 22 is not equal to or more than the predetermined criterion, the determination unit 23 rejects the provisional acceptance determination of the priority bit selected by the selection unit 22. In a case where the provisional acceptance determination of the priority bit is permitted by the determination unit 23 (Yes in step S123), the information processing apparatus 10 proceeds to step S124 to be described below. By contrast, in a case where the determination unit 23 rejects the provisional acceptance determination of the priority bit (No in step S123), the inversion unit 24 adds the priority bit of the selected bit to an exclusion bit group (step S125). After step S125, the information processing apparatus 10 returns to step S110 described above. In this case, the inversion unit 24 executes inversion control of returning a selection state of the priority bit to a state before the provisional acceptance determination. For example, the inversion unit 24 resets a selection state of the bit of the group A, which is the priority bit selected by the selection unit 22, to a state before the selection state.
At step S124, the selection unit 22 performs additional bit selection based on the bit group information 16. For example, by performing a process in the same manner as step S115 described above, the selection unit 22 provisionally selects an additional bit for each first element different from the priority bit to be incorporated into the plurality of bits together with the priority bit selected in step S112 described above, based on the bit group information 16 acquired by the acquisition unit 21. After step S124, the information processing apparatus 10 proceeds to step S126 to be described below.
At step S126, the determination unit 23 performs provisional acceptance determination of the additional selected bit (additional bit) for each first element selected by the selection unit 22. In a case where the determination unit 23 permits the provisional acceptance determination of the additional selected bit selected by the selection unit 22 (Yes in step S126), the information processing apparatus 10 proceeds to step S127 to be described below. By contrast, in a case where the determination unit 23 rejects the provisional acceptance determination for the additional selected bit selected by the selection unit 22 (No in step S126), the information processing apparatus 10 returns to step S124 described above. In this case, the inversion unit 24 executes inversion control of returning the additional bit to a state before the selection determination of provisionally accepting a selection state of the additional bit for each first element while maintaining a selection state of the priority bit in the plurality of bits. For example, the inversion unit 24 maintains the selection state of the bit of the group A, which is the priority bit, among the groups A to C selected by the selection unit 22, and resets the selection state of the additional bit to a state before the selection state before the provisional acceptance determination of the additional selected bit for each group B or each group C. For example, the information processing apparatus 10 resets the selection state of the additional bit to the state before the selection state before the provisional acceptance determination of the additional selected bit, for each first element for which the provisional acceptance determination is rejected, for example, for each group C, and repeats the provisional acceptance determination of the additional selected bit until selection of the additional bit for each of all the first elements is provisionally accepted.
At step S127, the determination unit 23 performs selection determination of the plurality of bits based on a predetermined rule selected by the selection unit 22. For example, the determination unit 23 determines whether or not the total number of bits is 6 bits in total including 2 bits associated with putting-in and taking-out of lunchbox in the group A of the priority bit, 2 bits associated with putting-in and taking-out of beverage in the group B of the additional bit, and 2 bits associated with putting-in and taking-out of dessert in the group C of the additional bit. For example, the determination unit 23 determines whether or not the total number of bits of the priority bit and the additional bit is 6 bits by repeating the provisional acceptance determination in steps S123 to S126 described above, for each first element. For example, the determination unit 23 gathers the priority bit of the group A, the additional bit of the group B, and the additional bit of the group C for every 2 bits, and performs the selection determination until the total number of bits becomes 6 bits. In a case where the determination unit 23 permits the selection determination of the plurality of bits based on the predetermined rule selected by the selection unit 22 (Yes in step S127), the information processing apparatus 10 proceeds to step S128 to be described below. By contrast, in a case where the determination unit 23 rejects the selection determination for the plurality of bits based on the predetermined rule selected by the selection unit 22 (No in step S127), the information processing apparatus 10 returns to step S124 described above.
At step S128, the determination unit 23 performs collective acceptance determination for the plurality of bits. In a case where the determination unit 23 permits the collective acceptance determination for the plurality of bits (Yes in step S128), the information processing apparatus 10 proceeds to step S129 to be described below. By contrast, in a case where the determination unit 23 rejects the collective acceptance determination for the plurality of bits (No in step S128), the information processing apparatus 10 returns to step S110 described above.
At step S129, the inversion unit 24 inverts all the bits, among the plurality of bits selected by the selection unit 22.
Subsequently, the storage unit 25 resets a state of the solution non-update count 13 stored in the storage unit 12 to 0 times, and increments (+1) the number of times of inversion of the selected bit inverted by the inversion unit 24 from the current count of the each bit cumulative inversion count 14 stored in the storage unit 12 (step S130).
After that, based on the selection status 17 of each bit information in the bit group information 16 stored in the storage unit 12, the search unit 27 performs end determination of ending the search for the optimum solution of the optimization problem (step S131). In a case where the search unit 27 permits the end determination (Yes in step S131), the information processing apparatus 10 proceeds to step S132 to be described below. By contrast, in a case where the search unit 27 rejects the end determination (No in step S131), the information processing apparatus 10 returns to step S101 described above.
At step S132, as a search result, the output unit 28 outputs each second element specified by the selection status 17 of each bit specified by the search unit 27 to an external display monitor or the like via the communication unit 11.
According to the embodiment described above, the information processing apparatus 10 selects a plurality of bits based on a constraint condition of an optimization problem, from bit group information related to bit information indicating whether or not each second element included in each first element is selected, for each first element which is a search target of an optimum solution in the optimization problem. After that, the information processing apparatus 10 executes acceptance determination of the selection of the plurality of bits, and executes, for the plurality of bits, inversion control of inverting the plurality of bits in the bit group information in a case where the selection of the plurality of bits is accepted, and returning the plurality of bits in the bit group information to a state before the acceptance determination in a case where the selection of the plurality of bits is not accepted. Subsequently, based on a selection status of each bit information in the bit group information, the information processing apparatus 10 searches for the optimum solution of the optimization problem. Accordingly, it is possible to make an energy mountain of the minimization problem low or make an energy valley of the maximization problem shallow, and it is possible to suppress a situation in which the optimum solution is not reached while being captured by a local solution. Since it is not desirable to exceed a large mountain of energy, it is possible to make a criterion for acceptance determination strict, and it is possible to suppress divergence greatly deviating from an original solution. As a result, it is possible to reduce a time until the optimum solution is reached.
It is noted that each component of each apparatus illustrated in the drawings may not be physically configured as illustrated in the drawings. For example, specific forms of the separation and integration of each apparatus are not limited to those illustrated in the drawings. The entirety or part of the apparatus may be configured by functionally or physically separating into arbitrary units or integrating into an arbitrary unit in accordance with various loads, usage situations, and the like.
All or certain some of the various processing functions to be executed by the information processing apparatus 10 may be executed by a CPU (or a microcomputer such as an MPU or a micro controller unit (MCU)). Of course, all or arbitrary subset of the various processing functions may be executed in programs analyzed and executed by the CPU (or a microcomputer such as the MPU or MCU) or in hardware using wired logic. The various processing functions performed in the information processing apparatus 10 may be executed in such a way that a plurality of computers cooperate with each other via cloud computing.
[Hardware]
The various processes described according to the above-described embodiment may be realized when the computer executes a program prepared in advance. Hereinafter, an example of the configuration of the computer (hardware) that executes the program having functions in the same manner as those of the above-described embodiment will be described.
As illustrated in
A program 111 for executing various types of processes in the acquisition unit 21, the selection unit 22, the determination unit 23, the inversion unit 24, the storage unit 25, the selection unit 26, and the like described in the above embodiment is stored in a hard disk apparatus 109. Various types of data 112 to be referenced by the program 111 are stored in the hard disk apparatus 109. The input apparatus 102 accepts operation information input from an operator, for example. The monitor 103 displays various screens to be operated by the operator, for example. The interface apparatus 106 is coupled to a printing apparatus or the like, for example. The communication apparatus 107 is coupled to a communication network, such as a local area network (LAN), and communicates various information with an external device via the communication network.
The CPU 101 reads the program 111 stored in the hard disk apparatus 109, develops the program 111 into the RAM 108, and executes the program 111 so as to perform various types of processes related to the acquisition unit 21, the selection unit 22, the determination unit 23, the inversion unit 24, the storage unit 25, the selection unit 26, and the like. The program 111 may not be stored in the hard disk apparatus 109. For example, the information processing apparatus 10 may read and execute the program 111 stored in a readable storage medium. The storage medium readable by the information processing apparatus 10 corresponds to, for example, a portable recording medium such as a compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), or Universal Serial Bus (USB) memory, a semiconductor memory such as flash memory, a hard disk drive, or the like. The program 111 may be stored in an apparatus coupled to a public line, the Internet, a LAN, or the like, and the information processing apparatus 10 may read the program 111 from the apparatus and execute the program 111.
All examples and conditional language provided herein are intended for the pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventor to further the art, and are not to be construed as limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although one or more embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2021-101881 | Jun 2021 | JP | national |