JP7169494B1 - program - Google Patents

program Download PDF

Info

Publication number
JP7169494B1
JP7169494B1 JP2022075531A JP2022075531A JP7169494B1 JP 7169494 B1 JP7169494 B1 JP 7169494B1 JP 2022075531 A JP2022075531 A JP 2022075531A JP 2022075531 A JP2022075531 A JP 2022075531A JP 7169494 B1 JP7169494 B1 JP 7169494B1
Authority
JP
Japan
Prior art keywords
constraints
zdd
solution
computer
constraint
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2022075531A
Other languages
Japanese (ja)
Other versions
JP2023164173A (en
Inventor
孝幸 菅原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to JP2022075531A priority Critical patent/JP7169494B1/en
Application granted granted Critical
Publication of JP7169494B1 publication Critical patent/JP7169494B1/en
Publication of JP2023164173A publication Critical patent/JP2023164173A/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Complex Calculations (AREA)

Abstract

【課題】最適解保証付きの解を高速に出力できるようにする。【解決手段】列生成法において、符号1の線形主問題ソルバーは、符号11のプライサーブロックに双対を出力する。符号2の各スタッフ毎のプライサーは、各スタッフ毎に関わるハード制約とソフト制約について、シフトをワンホットコードでエンコードしたZDDグラフを作る。ZDDグラフの始点と終点間のZDDノードのコストの最小値を得て、符号10の列追加するかどうかを判断する。【選択図】図6An object of the present invention is to output a solution with an optimum solution guarantee at high speed. Kind Code: A1 In a sequence generation method, a linear primal problem solver at code 1 outputs a dual to a pricer block at code 11 . The per-staff pricer at 2 creates a ZDD graph encoding the shifts in one-hot code for the hard and soft constraints associated with each staff. Obtain the minimum cost of the ZDD nodes between the start and end points of the ZDD graph and determine whether to add the column with code 10. [Selection drawing] Fig. 6

Description

本発明は、ナーススケジューリング問題等に関して最適化を行うプログラム等に関する。 TECHNICAL FIELD The present invention relates to programs and the like that optimize nurse scheduling problems and the like.

従来より、例えば、所定の集団に属するスタッフのスケジュールを最適化するナーススケジューリング問題が知られている。ナーススケジューリング問題は、制約充足最適化問題システムでもNP困難な例として知られている。この種のスケジューリング問題に対する解法として、非特許文献1や非特許文献2等で示されているように、分枝価格法(Branch and Price)で解く方法がある。 Conventionally, for example, the nurse scheduling problem of optimizing the schedule of staff belonging to a given group is known. The nurse scheduling problem is known as an NP-hard example of constraint satisfaction optimization problem systems. As a solution to this type of scheduling problem, there is a branch and price method, as disclosed in Non-Patent Document 1, Non-Patent Document 2, and the like.

Strandmark, P., Qu, Y. and Curtois, T. First-order linear programming in a column generation-based heuristic approach to the nurse rostering problem. Computers & Operations Research, 2020. 120, p. 104945. (pdf)Strandmark, P., Qu, Y. and Curtois, T. First-order linear programming in a column generation-based heuristic approach to the nurse rostering problem. Computers & Operations Research, 2020. 120, p. 104945. (pdf) Antoine Legrain, J.Omer, Samuel Rosat. A rotation-based branch-and-price approach for the nurse scheduling problem. Mathematical Programming Computation, Springer, 2020, 12 (3), pp.417- 450. ff10.1007/s12532-019-00172-4ff. ffhal-01545421v2Antoine Legrain, J.Omer, Samuel Rosat. A rotation-based branch-and-price approach for the nurse scheduling problem. Mathematical Programming Computation, Springer, 2020, 12 (3), pp.417- 450. ff10.1007/s12532 -019-00172-4ff.ffhal-01545421v2 Minato, S. 1993. Zero-suppressed BDDs for set manipulation in combinatorial problems. 30thConference on Design Automation. 272-277.Minato, S. 1993. Zero-suppressed BDDs for set manipulation in combinatorial problems. 30th Conference on Design Automation. 272-277. J. Kawahara, T. Inoue, H. Iwashita, and S. Minato,“Frontier-based search for enumerating all constrained subgraphs with compressed representation”,IEICE Transactions on Fundamentals of Electronics, Communications and Computer Sciences, vol.E100.A, no.9, pp.1773-1784, 2017.J. Kawahara, T.; Inoue, H.; Iwashita, and S.; Minato, "Frontier-based search for enumerating all constrained subgraphs with compressed representations", IEICE Transactions on Fundamentals of Electronics, Communications, Communications Corporation. E100. A, no. 9, pp. 1773-1784, 2017. Modeling and solving staff scheduling with partial weighted maxSATEmir Demirovic, Nysret Musliu & Felix Winter Annals of Operations Research volume 275, pages79-99 (2019)Modeling and solving staff scheduling with partial weighted maxSATEmir Demirovic, Nysret Musliu & Felix Winter Annals of Operations Research volume 275, pages79-99 (2019)

非特許文献1で示されているように、ナーススケジューリング問題において、求解速度を上げようとする設計アプローチは、最適解に対する精度の低下をもたらす。反対に、高精度を狙う設計では、求解速度が低下する傾向にある。高精度化と高速化を両立させることは、難しいという問題がある。
本発明は、かかる問題に鑑み、例えば、最適解保証付きの解を高速に出力できるようにすることを目的とする。
As shown in Non-Patent Document 1, in the nurse scheduling problem, a design approach that attempts to increase the speed of finding a solution results in a decrease in accuracy with respect to the optimal solution. Conversely, in a design aimed at high precision, the solution-finding speed tends to decrease. There is a problem that it is difficult to achieve both high precision and high speed.
SUMMARY OF THE INVENTION In view of such problems, it is an object of the present invention to enable, for example, a solution with an optimum solution guarantee to be output at high speed.

本発明の第1の態様によると、所定の集団に属するスタッフのスケジュールを構成するシフトとスケジュールに関する制約とに基づきスケジュールの最適化に関する処理をコンピュータに実行させるためのプログラムは、制約は、必ず守るべき制約であるハード制約と、必ずしも満たす必要はないが出来れば満たしたい制約であるソフト制約とを含み、各スタッフ毎に、各スタッフに関わるハード制約およびソフト制約について、シフトをワンホットコードでZDD(ゼロサプレス型二分決定グラフ)にエンコードしたZDDグラフの始点と終点間のZDDノードのコスト総和を最小化する経路を求めることによって、ハード制約を充足させ、かつ、ソフト制約の違反する制約の重みの総和を最小化する、各スタッフの最適化問題の解を得る第1手段、各スタッフの最適化問題の解を列とする列生成法と、分枝限定法とに基づいて、整数解を得る第2手段、としてコンピュータを機能させるためのプログラムである。 According to a first aspect of the present invention, a program for causing a computer to execute a process related to schedule optimization based on shifts constituting a schedule of staff members belonging to a predetermined group and constraints on the schedule is provided so that the constraints must be observed. It includes hard constraints that should be constrained and soft constraints that do not necessarily need to be met but are desired to be met if possible. By finding the path that minimizes the total cost of the ZDD nodes between the start and end points of the ZDD graph encoded in (zero-suppressed binary decision graph), the hard constraints are satisfied and the weights of the constraints violating the soft constraints are calculated. A first means for obtaining the solution of the optimization problem of each stuff that minimizes the sum, obtains the integer solution based on the sequence generation method in which the solution of the optimization problem of each staff is the sequence, and the branch-and-bound method. It is a program for making a computer function as the second means.

本発明によれば、最適解保証付きの解を、高速に得られる割合が格段に向上する効果が見込める。最適解が得られれば、それ以上良い解はないと考えられるため、探索を止めることができ、ユーザが無駄に待たされることを防ぐ効果も見込める。 According to the present invention, it can be expected that the ratio of obtaining a solution with the optimum solution guarantee at a high speed will be significantly improved. If the optimum solution is obtained, it is considered that there is no better solution, so the search can be stopped, and the effect of preventing the user from waiting unnecessarily can be expected.

図1は、ナーススケジューリング問題を列生成法で解く方法のブロック図であるFIG. 1 is a block diagram of a method for solving the nurse scheduling problem with a sequence generation method. 図2は、ハード制約とソフト制約の具体例であるFigure 2 is a concrete example of hard and soft constraints 図3は、列生成法のアルゴリズムであるFigure 3 is the algorithm for the column generation method. 図4は、従来方法による構成図であるFIG. 4 is a configuration diagram according to the conventional method. 図5は、分枝限定法の説明図であるFIG. 5 is an explanatory diagram of the branch-and-bound method. 図6は、本発明の構成図であるFIG. 6 is a configuration diagram of the present invention. 図7は、1日分、シフトをワンホットコードでZDDにエンコードした図であるFigure 7 shows a day's worth of shifts encoded into ZDD with one-hot code. 図8は、5日分、シフトをワンホットコードでZDDにエンコードした図であるFigure 8 is a diagram of 5 days worth of shifts encoded into ZDD with one-hot code. 図9は、図8に、日勤(D)→早番(E)の禁止を追加した図であるFIG. 9 is a diagram in which prohibition of day shift (D)→early shift (E) is added to FIG. 図10は、図2の、基数制約を除く全ての行制約を実装したZDDグラフであるFigure 10 is the ZDD graph of Figure 2 implementing all row constraints except the cardinality constraint 図11は、図10に、基数制約を追加したZDDグラフであるFIG. 11 is a ZDD graph obtained by adding a cardinality constraint to FIG. 図12は、図11に、予定制約を追加したZDDグラフであるFIG. 12 is a ZDD graph with schedule constraints added to FIG. 図13は、2進加算器による基数制約の実装例であるFIG. 13 is an implementation example of the radix constraint by a binary adder. 図14は、ZDD集合による基数制約の実装例であるFigure 14 is an implementation example of cardinality constraint by ZDD set 図15は、予定制約の重みをZDDノードに持たせた例であるFig. 15 is an example in which the weight of the schedule constraint is given to the ZDD node 図16は、図9をソフト制約化したZDDグラフであるFig. 16 is a ZDD graph obtained by soft-constraining Fig. 9 図17は、図10をソフト制約化したZDDグラフであるFIG. 17 is a ZDD graph in which FIG. 10 is soft-constrained. 図18は、ソフト基数制約を持たない場合のZDDの1ノードに注目したZDDのコスト計算の説明図であるFIG. 18 is an explanatory diagram of ZDD cost calculation focusing on one node of ZDD when there is no soft cardinality constraint. 図19は、ソフト基数制約を持つ場合のZDDの1ノードに注目したZDDのコスト計算の説明図であるFIG. 19 is an explanatory diagram of ZDD cost calculation focusing on one node of ZDD with soft cardinality constraints. 図20は、プライサーを列生成で解くための方法のブロック図であるFIG. 20 is a block diagram of a method for solving the pricer with sequence generation. 図21は、図6 主問題ソルバーから、MaxSATソルバーへの入力の仕方の説明図であるFIG. 21 is an explanatory diagram of how to input from the main problem solver of FIG. 6 to the MaxSAT solver. 図22は、MaxSATソルバーの解を利用して、行制約のソフト制約をハード制約化する説明図であるFIG. 22 is an explanatory diagram of converting the soft constraint of the row constraint into a hard constraint using the solution of the MaxSAT solver. 図23は、本発明と数理ソルバーとの速度比較であるFIG. 23 is a speed comparison between the present invention and a mathematical solver 図24は、時間の経過に対する最適解の得られたインスタンス数の比率を示す本発明と他の方式との比較グラフであるFIG. 24 is a comparison graph between the present invention and other methods showing the ratio of the number of instances for which the optimal solution was obtained over time.

以下、図面を参照して、本発明を適用した実施形態の一例について説明する。
なお、本発明を適用可能な実施形態が以下説明する実施形態に限定されるわけでないことは勿論である。
An example of an embodiment to which the present invention is applied will be described below with reference to the drawings.
It goes without saying that the embodiments to which the present invention can be applied are not limited to the embodiments described below.

[1. 分枝価格法]
図1は、分枝価格法を用いて勤務の解を得るためのシステムの全体ブロック図の一例を示す図である。このブロック図は、従来方式も本発明も変わらない枠組みとしてもよい。以下このブロック図について説明する。
[1. Branch pricing method]
FIG. 1 shows an example of an overall block diagram of a system for obtaining work solutions using the branch pricing method. This block diagram may be a framework that does not change between the conventional method and the present invention. This block diagram will be described below.

[1.1 ハード・ソフト制約]
制約は、2種類に分けられる。「ハード制約」と「ソフト制約」である。
ハード制約とは、必ず守るべき制約である。
ソフト制約とは、必ずしも守る必要はないが、出来れば守りたい制約である。
制約の具体例を、図2に示す。
[1.1 Hardware/Software Constraints]
Constraints are divided into two types. "Hard Constraints" and "Soft Constraints".
A hard constraint is a constraint that must be observed.
A soft constraint is a constraint that you do not necessarily have to observe, but you want to observe if possible.
A specific example of constraints is shown in FIG.

制約には、主に各スタッフに関する制約である行制約、組織全体の制約であるカバー制約、各スタッフの決まっている予定などの予定制約等を含めることができる。いずれをハード制約とするかソフト制約とするかは、自由度がある。ソフト制約にした場合は、それを破った場合、各ソフト制約毎に定められてコストが発生する。システム全体としては、ハード制約は全て守った上で、ソフト制約を破ったコストの総和を目的関数値と呼ぶが、目的関数値を最小にすることが、最適解を出力するための要件である。 Constraints can include row constraints, which are constraints mainly related to each staff member, cover constraints, which are constraints for the entire organization, schedule constraints, such as fixed schedules for each staff member, and the like. There is a degree of freedom in deciding which one to use as a hard constraint or a soft constraint. In the case of soft constraints, if they are broken, a cost is generated, which is determined for each soft constraint. For the system as a whole, the total cost of violating the soft constraints while observing all the hard constraints is called the objective function value. Minimizing the objective function value is a requirement for outputting the optimal solution. .

上記のように、いずれの制約をハード制約・ソフト制約にするかは、自由度がある。1つの手法として、例えば、ユーザが決める(設定する)ようにしてもよい。
また、コンピュータがプログラムによって自動的に決める(設定する)ようにしてもよい。
As described above, there is a degree of freedom in deciding which constraint to use as a hard constraint or a soft constraint. As one method, for example, the user may decide (set).
Alternatively, the computer may automatically determine (set) by a program.

[1.2 分枝価格法のアルゴリズム]
図3に、分枝価格法のフローチャートの一例を示す。分枝価格法は、シンプレックス法の一変形形態である列生成(列生成ブロック)と、分枝限定法(分枝限定ブロック)とから成る。
[1.2 Branch pricing algorithm]
FIG. 3 shows an example of a flow chart of the branch pricing method. The branch-price method consists of a string generation (string generation block), which is a variant of the simplex method, and a branch-and-bound method (branch-and-bound block).

[1.3 従来システム]
図4は、従来システムの列生成ブロックのブロック図の一例を示す図である。
列生成ブロックは、各スタッフ毎に、各スタッフの制約に係わるサブプログラム(以下、「プライサ-(Pricer)」と呼称する。)群と、線形緩和主問題ソルバーとから成る。
線形緩和主問題ソルバーは、離散系から連続系に緩和した問題を解くソルバーであり、例えば、オープンソースのCOIN-OR projectがある。線形緩和主問題ソルバーは、主解(Primal)と双対解(Dual)との二つを出力する。プライサーは、自身のスケジュールに関する離散解(以降、「ロースター」と呼称する。)を出力する。それが、主問題の系の改善に寄与するものであるならば、ロースターは、“列”として主問題ソルバーに変数として取り込まれる。
[1.3 Conventional system]
FIG. 4 is a diagram showing an example of a block diagram of a column generation block of a conventional system.
The column generation block consists of a group of subprograms (hereafter referred to as "Pricer") related to the constraint of each stuff and a linear relaxation primal problem solver for each stuff.
A linear relaxed primal problem solver is a solver that solves a problem that is relaxed from a discrete system to a continuous system. For example, there is an open source COIN-OR project. A linear relaxation primal problem solver outputs two solutions, a primal solution and a dual solution. Pricer outputs a discrete solution (hereinafter referred to as a "roster") for its own schedule. A roaster is introduced as a variable into the primal problem solver as a "string" if it contributes to the improvement of the primal problem system.

一方、寄与しないと判断されれば、取り込まれない。主問題の目的関数値の改善が続く限り列は追加される。最終的に列が追加されなくなったときが、そのシステムの下界を示すことになる。ここでいう下界は、連続系における最小値である。ナーススケジューリングの問題の実システムの目的関数値は、離散系であり一般的には整数値となり下界値に等しいかまたは常に、下界よりは大きいという性質がある。 On the other hand, if it is determined that it does not contribute, it is not taken in. Columns are added as long as the objective function value of the primal problem continues to improve. The bottom bound of the system is when no more columns are finally added. The lower bound here is the minimum value in a continuous system. The objective function value of the real system of the nurse scheduling problem is a discrete system and generally has the property of being an integer value equal to or always larger than the lower bound.

[1.3.1 プライサー]
プライサーは、リソース制約付き最短距離問題に一般化することができる。プライサーは、NP-困難な問題であることが分かっている。プライサーの出力するロースターがシステム全体の精度と求解速度の鍵となる。これまで、これを解く様々な提案がなされている。その一つとして、非特許文献1には、ヒューリスティクス的に解を得る方法が記載されている。
[1.3.1 Pricer]
Pricer can be generalized to the resource constrained shortest distance problem. Pricer is known to be an NP-hard problem. Pricer's output roster is the key to the accuracy and speed of the overall system. To date, various proposals have been made to solve this problem. As one of them, Non-Patent Document 1 describes a method of obtaining a solution by heuristics.

[1.3.2 列生成ブロック 線形緩和主問題ソルバー]
列が追加されるごとに変数は多くなるが、変数増加は、高々、列に関する分だけで済む。他に、線形緩和主問題ソルバーが扱うのは、スタッフ間に関わるカバー制約を扱うだけであり、ナーススケジューリング問題全体の変数を扱うのに比べれば、遥かに少ない変数で全体の最適化を達成することができる。これにより、線形緩和主問題を「限定主問題(Restricted Master Problem)」と呼称することがある。線形緩和主問題ソルバーは、双対解(DUAL)を各プライサーに出力し、各プライサーは、それを受けて最適ロースターを返す、というループにより主問題の目的関数値の改善を行う。
線形緩和主問題の目的関数は、数1のように定式化できる。

Figure 0007169494000002

Figure 0007169494000003
Figure 0007169494000004
Figure 0007169494000005
Figure 0007169494000006
各シンボルの意味を数6に示す。
Figure 0007169494000007
[1.3.2 Sequence Generation Block Linear Relaxed Primal Problem Solver]
Each additional column increases the number of variables, but at most the variable increase is only for the columns. Besides, the linear relaxed primal problem solver only deals with the cover constraints between staffs, and achieves the overall optimization with far fewer variables than the entire nurse scheduling problem. be able to. For this reason, the linear relaxation master problem is sometimes called the "restricted master problem". The linear relaxation primal problem solver outputs a dual solution (DUAL) to each pricer, and each pricer receives it and returns the optimal roaster, thereby improving the objective function value of the primal problem.
The objective function of the linear relaxation primal problem can be formulated as Equation 1.
Figure 0007169494000002

Figure 0007169494000003
Figure 0007169494000004
Figure 0007169494000005
Figure 0007169494000006
Expression 6 shows the meaning of each symbol.
Figure 0007169494000007

数5は、プライサーの目的関数であり、「Reduced Cost」とも呼ばれる。Reduced Costが負のときに、数1の目的関数値は、改善の可能性があるので、そのロースターは列として線形緩和主問題ソルバーに追加される。数5の目的関数値が負になるロースターがないときは、改善の終点となる。このとき、数1の最適値は、下界を示すことが知られている。逆に、ナーススケジューリング問題の系の下界を正しく知るためには、プライサーも最適解である値を出力することが要件となる。 Equation 5 is Pricer's objective function, also called "Reduced Cost". When the Reduced Cost is negative, the objective function value in Equation 1 has the potential for improvement, so its roaster is added as a column to the linear relaxation primal problem solver. When there is no roaster for which the objective function value of Equation 5 becomes negative, the improvement ends. At this time, it is known that the optimal value of Equation 1 indicates a lower bound. Conversely, in order to correctly know the lower bound of the system of the nurse scheduling problem, it is necessary for the pricer to output a value that is the optimal solution.

[1.4 分枝限定法]
線形緩和主問題ソルバーの主解出力は、連続系であり浮動小数点による出力となる。しかし、システムが欲しいのは整数解であって、浮動小数点のデータは(例えば、0.3や0.5)解には成り得ないため整数化を行う必要がある。そのために必要なブロックが分枝限定法ブロックである。列生成で下界を得つつ、分枝限定操作で整数化を行うことで、システムの最適値を得る。分枝が発生する毎に、ノードを生成させ、全データの整数化を行えた時点で、整数解(以下、「実行可能解」と呼称する。)が得られる。全てのノードの探索が終了するか、実行可能解の最小値=UBが、下界値(=LB)と等しくなった時点で、最適値が確定する。分枝操作は、フラクショナルな値(例えば0.5)の箇所を選び、0/1にそれぞれ固定分枝するのが一般的である。図5は、この様子を示したものである。
[1.4 Branch-and-bound method]
The primal solution output of the linear relaxation primal problem solver is a continuous system and is output in floating point. However, what the system wants is an integer solution, and floating-point data (for example, 0.3 or 0.5) cannot be a solution, so integerization must be performed. The block needed for this is the Branch and Bound Block. The optimal value of the system is obtained by integerization by the branch-and-bound operation while obtaining the lower bound by sequence generation. A node is generated each time a branch occurs, and an integer solution (hereinafter referred to as a "feasible solution") is obtained at the time when all data can be converted to integers. The optimal value is determined when the search for all nodes is completed or when the minimum value of feasible solutions=UB becomes equal to the lower bound value (=LB). For the branching operation, it is common to select a fractional value (for example, 0.5) and branch each fixedly to 0/1. FIG. 5 shows this situation.

[1.5 ヒューリスティクス]
早期に、実行可能解を得る方法として、ヒューリスティクスを使うこともある。一般的なヒューリスティクスは、非特許文献1にあるように、浮動小数点データの丸めを繰り返し行うことで整数化を行っている。
[1.5 Heuristics]
Heuristics are sometimes used as a way of finding feasible solutions early on. General heuristics, as described in Non-Patent Document 1, perform integerization by repeatedly rounding floating-point data.

[2. 本発明の要点]
図6は、本発明による解を得るためのシステム構成の一例を示す図である。
図4に示したシステム構成と比して、まず、符号2の構成に特徴がある。
符号2はプライサーである。具体的には、スタッフに関わるハード制約とソフト制約について、シフトをワンホットコードでエンコードしたゼロサプレス型2分決定グラフ(ZDD)を用いて各スタッフの最適化を行うロースターを出力するのが特徴である。
ここで、プライサー2が扱うハード制約とソフト制約は、例えば、前述した行制約や予定制約とすることができる。
[2. Key points of the present invention]
FIG. 6 is a diagram showing an example of system configuration for obtaining a solution according to the present invention.
Compared with the system configuration shown in FIG. 4, the configuration of reference numeral 2 is characteristic.
Reference numeral 2 is a pricer. Specifically, for hard and soft constraints related to staff, it is characterized by outputting a roaster that optimizes each staff using a zero-suppressed binary decision diagram (ZDD) that encodes shifts with one-hot code. be.
Here, the hard constraint and soft constraint handled by the pricer 2 can be, for example, the row constraint and schedule constraint described above.

ワンホットコードとは、例えば、早番:(1, 0, 0, 0)、日勤:(0, 1, 0, 0)、遅番:(0, 0, 1, 0)、公休:(0, 0, 0, 1)のように、「1」となる部分が1個であり、かつ、互いにその位置が異なるエンコードの仕方である。これをZDDグラフで表したのが図7である。コンパクトにスタッフのシフトのありえる状態の全てを表現できることがポイントとなっている。
このエンコード条件下で、そのスタッフに関わるハード制約とソフト制約をZDD上にエンコードしたグラフが一度でき上がれば、それを用いてプライサーの最適解を高速に計算できる。列生成法においては、プライサーの計算が系のネックになっており、プライサーが高速に計算されれば、系の最適値も高速に求まる。
One hot code is, for example, early shift: (1, 0, 0, 0), day shift: (0, 1, 0, 0), late shift: (0, 0, 1, 0), public holiday: (0, 0 , 0, 1), there is only one part that is "1", and the positions of the parts are different from each other. FIG. 7 shows this as a ZDD graph. The point is that it can compactly express all possible states of staff shifts.
Under this encoding condition, once we have a graph that encodes the hard and soft constraints on the stuff on the ZDD, we can use it to quickly compute the optimal solution of Pricer. In the sequence generation method, pricer calculation is a bottleneck of the system.

[3. ナーススケジューリング問題による実施の形態]
本実施形態では、プライサーの目的関数、例えば前述した数6を、各スタッフ毎の詳細な制約を入れて展開する。これにより、例えば数7を得ることができる。

Figure 0007169494000008
Figure 0007169494000009
Figure 0007169494000010
Figure 0007169494000011
Figure 0007169494000012
[3. Embodiment Based on Nurse Scheduling Problem]
In this embodiment, Pricer's objective function, for example, Equation 6 described above, is expanded with detailed constraints for each staff. Thus, for example, Equation 7 can be obtained.
Figure 0007169494000008
Figure 0007169494000009
Figure 0007169494000010
Figure 0007169494000011
Figure 0007169494000012

[3.1 ワンホットコードの実装]
例として、図2の行制約を実装する。ここでは、「早番=E」,「遅番=L」、「日勤=D」とする。陽のシフトは以上だが、それ以外の状態、つまり勤務していない日もシフトとみなし、これを「公休=Y」として、ワンホットコードを構成する。例えばDateが「1」(Date1)から「5」(Date5)まであるとして、Date1の早番をE1と表記する。また、あるスタッフの制約論理関数をRとする。
[3.1 Implementation of one-hot code]
As an example, we implement the row constraint of FIG. Here, it is assumed that "early shift = E", "late shift = L", and "day shift = D". That's all for the yang shift, but other states, that is, non-working days, are also considered shifts, and this is set as "Public holiday = Y" and constitutes a one-hot code. For example, assuming that Date ranges from "1" (Date1) to "5" (Date5), the earliest date of Date1 is written as E1. Let R be the constraint logic function of a staff.

ワンホットコードは、Least One なおかつ Most Oneであるので、全シフトのOR,と、二つのシフトが同時に2個アクティブにならないという制約を実装すればよい。
論理演算子&(AND)、|(OR)、NOT(~)を使用して、制約論理関数Rは、
R=E1 | D1 | L1 | Y1
R &=~(E1 &D1 )
R &=~(E1&L1 )
R &=~(E1& Y1)
R &=~(D1&L1)
R &=~(D1&Y1)
R&=~(L1&Y1)
と記述することができる。
上はDate1についてだけ実装したが、その他のDateについても同様に構築することができる。
Since the one-hot code is Least One and Most One, we can implement the OR of all shifts and the constraint that no two shifts are active at the same time.
Using the logical operators & (AND), | (OR), NOT (~), the constraint logic function R is
R=E1 | D1 | L1 | Y1
R &=~ (E1 & D1 )
R &=~ (E1 & L1)
R &=~ (E1 & Y1)
R &=~ (D1 & L1)
R &=~ (D1&Y1)
R&=~(L1&Y1)
can be described as
The above was implemented only for Date1, but other Dates can be constructed in the same way.

この論理関数をグラフ化するには、LSIの論理合成ツールとして広く用いられているBDDパッケージを用いるのが簡単である。BDDとは、2分決定グラフ(Binary Decision Diagram)であり、論理関数をコンパクトに表現することができる。既約化したBDDは、その表現が一意になることが知られている。 To graph this logic function, it is easy to use the BDD package, which is widely used as an LSI logic synthesis tool. A BDD is a Binary Decision Diagram, which can express logic functions compactly. It is known that an irreducible BDD has a unique representation.

BDDパッケージとしては、オープンソースであるCUDD(Colorado University Decision Diagram Package)を使ってもよい。BDDは、論理関数の表現に適する。一方、ZDDは、BDDを集合表現にしたとも言えるもので、データ構造を集合表現にするときに役立つ。BDD上のANDは、ZDD上では、集合の∩ である。CUDDには、BDD表現から、ZDD表現に変換するコンバータが付属しており、上記論理関数もZDD表現に変換することができる。ZDDもその既約表現は、一意になる。 As a BDD package, you can use the open source CUDD (Colorado University Decision Diagram Package). BDDs are suitable for representing logical functions. On the other hand, ZDD can be said to be a set representation of BDD, and it is useful when making a data structure a set representation. AND on BDD is ∩ of sets on ZDD. CUDD comes with a converter that converts from BDD representation to ZDD representation, and the above logic function can also be converted to ZDD representation. ZDD and its irreducible representation are unique.

図8は、制約論理関数RをZDD化したものである。上の煩雑な論理関数がZDDグラフにすると、非常にコンパクトに表現できていることが分かる。図8において、D1がZDDグラフの始点であり、Tが終点である。 FIG. 8 is a ZDD representation of the constraint logic function R. As shown in FIG. When the complicated logic function above is made into a ZDD graph, it can be seen that it can be expressed very compactly. In FIG. 8, D1 is the starting point of the ZDD graph and T is the ending point.

[3.2. ハード行制約の実装]
次に、図2の行制約の符号20で示した「日勤後に早番禁止」を実装してみる。前のワンホットコード論理関数にAND操作を行うと、制約論理関数Rは、以下のようになる。
R&=~(D1 & E2)
R &=~(D2 & E3)
R &=~(D3 & E4)
R &=~(D4 & E5)
この時点の制約論理関数RをZDDに変換したものが図9である。
[3.2. Implementation of Hard Row Constraints]
Next, try to implement the line restriction 20 "prohibit early shift after day shift" in FIG. Performing an AND operation on the previous one-hot code logic function, the constraint logic function R becomes:
R & = ~ (D1 & E2)
R &=~ (D2 & E3)
R &=~ (D3 & E4)
R &=~ (D4 & E5)
FIG. 9 shows the ZDD converted from the constraint logic function R at this point.

同様にして、基数制約以外の全ての行制約を実装したものが、図10となる。 Similarly, FIG. 10 shows the implementation of all row constraints other than the cardinality constraint.

[3.2.1. 基数制約の実装例]
シフト集合の要素を数えて、その総和に対して不等式で制約することを基数制約という。例えば図2の行制約中、基数制約は、符号21で示した「公休数は、1日から2日の間」という制約のみである。
基数制約を実装するアプローチには、例えば2つの方法がある。
[3.2.1. Implementation example of cardinality constraint]
Counting the elements of the shift set and constraining the sum with an inequality is called a cardinality constraint. For example, among the row constraints in FIG. 2, the cardinal number constraint is only the constraint 21 stating that the number of public holidays is between 1 and 2 days.
There are, for example, two approaches to implementing cardinality constraints.

1つ目の方法は、BDD上で2進加算器を用いる方法であり、回路合成手法がそのまま適用可能である。図13がその構成例である。対象となるシフト集合を2進加算器に入力する。2進加算器の出力を不等式で制約することになる。具体的には、やはり回路合成手法であるコンパレータを使用して制約すればよい。いずれも、回路のプリミティブ要素であるAND,OR,NOTの基本演算だけで、上述の全ては記述可能であり、BDDパッケージCUDDで記述できる。 The first method is a method using a binary adder on the BDD, and the circuit synthesis method can be applied as it is. FIG. 13 shows an example of the configuration. A shift set of interest is input to a binary adder. An inequality will constrain the output of the binary adder. Concretely, it is sufficient to constrain using a comparator, which is also a circuit synthesis method. All of the above can be described using only the basic operations of AND, OR, and NOT, which are the primitive elements of the circuit, and can be described using the BDD package CUDD.

2つ目の方法は、集合演算による方法である。例えば、「1<=X<=2」という集合は、n入力集合から、1個取る全ての組み合わせ「nC1」と、2個取る全て「nC2」の組み合わせの和集合(union)と考えることができる。あるいは「1<=X」という集合と、「X<=2」という集合の共通集合(intersection) とも考えることができる。後者の様子を図14に示す。基数制約に関しては、例えば、仕様から直接ZDDに落とし込むZDDパッケージTdZdd(URL: https://github.com/kunisura/TdZdd)があり、それを利用するのが簡単である。この場合、基数制約以外は、BDD上で構築してきたので、BDDからZDDにコンバートを行う。基数制約以外のZDD Z1と基数制約のZ2の∩演算を行えば、全体のZDDが得られることになる。ZDD集合演算もCUDD上で可能である。
基数制約を加えてコンパイルしたのが、図11になる。図8から、新たな変数増加はないことが分かる。
The second method is a method based on set operations. For example, the set ``1<=X<=2'' can be considered as the union of all combinations ``nC1'' that take 1 and ``nC2'' that take 2 from the n input set. can. Alternatively, it can be considered as the intersection of the set "1<=X" and the set "X<=2". FIG. 14 shows the latter situation. Regarding cardinality constraints, for example, there is a ZDD package TdZdd (URL: https://github.com/kunisura/TdZdd) that directly drops ZDD from the specification, and it is easy to use. In this case, except for the cardinality constraint, since it was built on BDD, convert from BDD to ZDD. The whole ZDD can be obtained by performing the ∩ operation on the non-radix-constrained ZDD Z1 and the cardinal-constrained Z2. ZDD set operations are also possible on CUDD.
FIG. 11 is the result of compiling with cardinality constraints added. It can be seen from FIG. 8 that there is no new variable increase.

[3.3. ハード予定制約の実装]
図2における1月7日の勤務を日勤(D2)とするには、
R &=D2
とすればよい。
同様に、図2における1月8日の勤務は遅番(L3)以外とするには、
R &=~L3
とすればよい。この時点の制約論理関数Rをグラフ化したのが、図12である。このようにして、任意の予定、任意のハード制約のコンパイルがシフトをワンホットコードでZDDにエンコードすることによって可能になる。
以上で、ハード制約の全ての実装が完了した。
[3.3. Implementation of Hard Scheduling Constraints]
To set the work on January 7 in Figure 2 as a day shift (D2),
R&=D2
And it is sufficient.
Similarly, to set the work on January 8 in Figure 2 as other than the late shift (L3),
R &= ~ L3
And it is sufficient. FIG. 12 is a graph of the constraint logic function R at this point. In this way, compilation of arbitrary schedules, arbitrary hard constraints is possible by encoding shifts into ZDDs in one-hot code.
All of the hard constraints have now been implemented.

[3.4. ハード制約のコンパイル順]
どのような順序でZDDをコンパイルしても、最終的には、図12になる。既約したZDDは、その表現が一意に定まるからである。一般にZDDの構築時間は、ZDDグラフが含むノード数に比例する。図8~図12で、一番ノード数が多いのは図11であるが、最終的には、図12が図8に次ぐ小さいグラフとなっている。このことからも分かるように、ワンホット制約と、ハード予定制約は、最初にコンパイルし、その後にその他の制約を実装するのが、構築時間上もメモリ所要上も有利となる。特に大きなインスタンスほど、その効果は大きい。
[3.4. Compilation Order of Hard Constraints]
No matter what order you compile the ZDD, you will end up with Figure 12. This is because the representation of an irreducible ZDD is uniquely determined. In general, ZDD construction time is proportional to the number of nodes contained in the ZDD graph. Among FIGS. 8 to 12, FIG. 11 has the largest number of nodes, but finally, FIG. 12 is the second smallest graph after FIG. As can be seen from this, it is advantageous in terms of build time and memory requirements to compile the one-hot constraint and the hard schedule constraint first, and then implement the other constraints. Especially, the larger the instance, the greater the effect.

[3.5. ソフト予定制約の実装]
ここからは、[3.1 ワンホットコードのコンパイル]が終了したあとの状態を前提として説明を続ける。
ソフト制約の場合は、図2の制約を次のように、「出来れば」を追加するとソフト制約となる。例えば、以下のような例である。
・1月7日の勤務は、出来れば、日勤(D2)
・1月8日の勤務は、出来れば、遅番(L3)以外
ただし、「出来れば」は、願望であって、出来ないことも許容しなければならない。予定制約の場合、制約適用前後で、グラフの形に変化はない。
実際、ソフト予定制約を適用した、図15は、ワンホットコードを適用後の図8と同じである。異なるのは、重みである。
ZDDの1枝ノードに予定制約重みが付加されるところが異なる。予定制約重みは、例えば、1月7日の重みをw2、1月8日の重みをw3とすると、図15において、符号80の予定制約重みは「0」、符号81-83の予定制約重みはw2,符号84の予定制約重みはw3、符号85-87の予定制約重みは「0」とすればよい。
[3.5. Implementation of Soft Scheduling Constraints]
From here on, the description will be continued on the assumption that [3.1 Compilation of one-hot code] is completed.
In the case of soft constraints, adding "if possible" to the constraints in FIG. 2 results in soft constraints. For example:
・Working on January 7th, if possible, day shift (D2)
・Working on January 8th, if possible, other than the late shift (L3) However, "if possible" is a wish, and you have to accept what you can't do. In the case of scheduled constraints, there is no change in the shape of the graph before and after applying the constraints.
In fact, Figure 15, with the soft scheduling constraint applied, is the same as Figure 8 after the one-hot code has been applied. The difference is the weight.
The difference is that a predetermined constraint weight is added to one branch node of ZDD. Assuming that the weight of January 7 is w2 and the weight of January 8 is w3, for example, the scheduled constraint weight of reference numeral 80 in FIG. is w2, the predetermined constraint weight of reference numeral 84 is w3, and the predetermined constraint weight of reference numerals 85-87 is "0".

[3.6. ソフト行制約の実装]
次に、日勤後に早番を出来れば禁止を実装する。新しい変数をXとして禁止状態を表現し、Xに重みpを付加すればよい。以下で、==は、同値を表す。
R&=X1==(D1 & E2)
R&=X2==(D2 & E3)
R&=X3==(D3 & E4)
R&=X4==(D4 & E5)
図16は、制約論理関数RをZDD化したグラフである。符号90-93の枝を重みpとすればよい。
[3.6. Implementation of Soft Row Constraints]
Next, if possible, implement a ban on the early shift after the day shift. A new variable X is used to represent the prohibited state, and X is weighted with p. In the following, == denotes equivalence.
R & = X1 == (D1 & E2)
R & = X2 == (D2 & E3)
R & = X3 == (D3 & E4)
R & = X4 == (D4 & E5)
FIG. 16 is a ZDD graph of the constraint logic function R. FIG. The branch of code 90-93 may be set as the weight p.

同様にして、基数制約以外の全ての行制約をソフト制約化して実装したものが、図17となる。 Similarly, FIG. 17 shows the implementation of soft constraints for all row constraints other than cardinality constraints.

[3.7. ソフト基数制約を含まない場合の最短経路の計算方法]
数7におけるソフト制約重みgkが0となる場合の計算方法について述べる。
図17のZDDノードを一般化して、図18を得る。符号100に示すZDDノードのブール変数をres、値をvalとするとき、resとvalは、符号103で示すアルゴリズムのように、子ノード101のTVal1と、子ノード102のEval1と、1枝の重みw(符号104)とだけで計算できる。重みwは、数7の図2ソフト予定シフトの重みとソフト行制約重みと双対値(図6の符号12)により定まる。ハード基数制約については、ハード基数制約は、[3.2.1. 基数制約の実装例]で示したように変数増加も重みの発生はない。従って符号103で計算可能である。
[3.7. Shortest path calculation method when soft cardinality constraints are not included]
A calculation method when the soft constraint weight gk in Expression 7 is 0 will be described.
Generalizing the ZDD node of FIG. 17, we obtain FIG. When res is the Boolean variable of the ZDD node indicated by reference numeral 100 and val is the value, res and val are TVal1 of the child node 101, Eval1 of the child node 102, and It can be calculated only with the weight w (symbol 104). The weight w is determined by the weight of the soft scheduled shift in FIG. As for the hard cardinality constraint, as shown in [3.2.1. Implementation example of cardinality constraint], neither variable increase nor weight generation occurs. Therefore, it can be calculated at reference numeral 103.

[3.8. ソフト基数制約を含む場合の最短経路の計算方法]
ソフト基数制約を1項でも含む場合の最短経路の計算例を図19に示す。符号116で示すZDDノードは、子ノードとして、符号114と符号115を持つ。符号115は1枝で結ばれている。1枝の場合は、重みと、基数制約に関するデルタ項を持つ。ここでは、重みwとして「-1」、基数制約デルタ項「1」を例として設定している。それまでの各ZDDノードでの1枝の基数制約デルタ項の総和を符号117で示すCountsとしてメモリに保持する。Countsは、それまでのシフトの総計値となる。各ZDDノードでは、Countsとそれに対応する重みの総計を表として持っている。親ノード符号116のテーブル符号112は、1枝ノード符号115に符号113を足したものと、0枝ノード符号114から求められる。符号112は、同じCOUNTS値を持つものに対しては、小さい方を採用するマージ操作を行って、符号111で示すテーブルを得る。最終ノード(符号110)では、さらに基数制約の重みを加算して、COUNTSに対応する値を得る。最終的に一番小さな値が数7の目的関数値となり求める経路となる。
[3.8. Shortest path calculation method when including soft cardinality constraints]
FIG. 19 shows a calculation example of the shortest path when even one soft cardinality constraint is included. A ZDD node denoted by reference numeral 116 has reference numerals 114 and 115 as child nodes. Reference numeral 115 is connected by one branch. The one-edge case has a weight and a delta term for the cardinality constraint. Here, as an example, the weight w is set to "-1" and the cardinality constraint delta term is set to "1". The total sum of radix constraint delta terms of one branch at each ZDD node up to that point is held in memory as Counts denoted by reference numeral 117 . Counts is the total number of shifts so far. Each ZDD node has a table of Counts and their corresponding weights. The table code 112 of the parent node code 116 is obtained from the 1 branch node code 115 plus the code 113 and the 0 branch node code 114 . A reference numeral 112 performs a merge operation to adopt a smaller COUNTS value for those having the same COUNTS value to obtain a table indicated by reference numeral 111 . At the final node (reference numeral 110), the cardinality constraint weight is further added to obtain the value corresponding to COUNTS. Finally, the smallest value becomes the objective function value of Expression 7, which is the desired path.

図19で、終点ノードから始点ノードへスキャンすることで、数7式の目的関数値を計算できることになる。主問題の双対解は、毎回変わる可能性があり、数7はその度に再計算が必要になる。一方、ZDDノードの構造は、一度コンパイルすれば不変である。
数7は、列生成中多数回、計算することになるが、Countsの計算は、ZDD構造が決まってしまえば、一度計算し結果をテーブルの形で保存できる。これにより、より高速化が可能となる。また、符号117は、データ圧縮して保存してもよい。また、逆に始点ノードから終点ノードへスキャンしてもよい。これらの手順により、始点と終点間でZDDノードの重みを総計して最小となる経路が判明する。以上述べた方法により、高速にプライサーの厳密解を得ることが可能になる。数7を用いて計算を行い、負であれば、列として 列追加(図6 符号10)を行う。
In FIG. 19, by scanning from the end node to the start node, the objective function value of Expression 7 can be calculated. The dual solution of the primal problem may change each time, and Equation 7 needs to be recalculated each time. On the other hand, the structure of ZDD nodes is immutable once compiled.
Number 7 will be calculated many times during column generation, but once the ZDD structure is determined, Counts can be calculated once and saved in the form of a table. This makes it possible to increase the speed. Moreover, the code|symbol 117 may be data-compressed and preserve|saved. Conversely, scanning may be performed from the start node to the end node. These procedures find the path that minimizes the sum of the weights of the ZDD nodes between the start and end points. By the method described above, it is possible to obtain an exact solution of Pricer at high speed. Calculation is performed using Equation 7, and if the result is negative, a column is added (reference numeral 10 in FIG. 6) as a column.

[3.9. 基数制約を含む場合の最短経路の別解]
別解法として、基数制約を、列生成法の主問題、基数制約以外をZDDでグラフ化し列生成子問題とする列生成法と分枝限定法で解くことも可能である。[3.8. ソフト基数制約を含む場合の最短経路の計算方法]で数7の厳密解は得られるが、インスタンス規模が大きな場合は、搭載メモリの制約を受ける場合がある。その場合、ZDDのコンパイルを基数制約以外に限定することでメモリ所要量を抑えることができる。図20がその構成図となる。
図20は、図6に示した各々のプライサー2に適用可能な構成を示しており、基数制約を主問題とする線形緩和ソルバ140と、その双対解に基づき、基数制約以外のハード制約とソフト制約についてシフトをワンホットコードでエンコードしたZDDグラフの始点‐終点間のノードコスト総和が最小となる経路を得るブロック141と、列追加142と、基数制約を主問題とする線形緩和ソルバ140の主解143に基づき分枝限定法によって整数解145を得るブロック144とを含む。
[3.9. Another shortest path solution when cardinality constraints are included]
As another solution, it is also possible to solve the cardinality constraint by the sequence generation method and the branch-and-bound method, in which the main problem of the sequence generation method and the sequence generation method that graphs the other than the cardinality constraint with ZDD and makes it a sequence generator problem. [3.8. Shortest Path Calculation Method with Soft Radix Constraints] gives the exact solution of Expression 7, but if the instance size is large, it may be constrained by the installed memory. In that case, memory requirements can be reduced by restricting ZDD compilation to non-cardinality constraints. FIG. 20 is a configuration diagram thereof.
FIG. 20 shows a configuration applicable to each pricer 2 shown in FIG. A block 141 for obtaining the path with the minimum sum of node costs between the start and end points of the ZDD graph whose shift is encoded with a one-hot code for the constraint; and a block 144 for obtaining an integer solution 145 based on the solution 143 by a branch and bound method.

[3.10. プライサーの並列化]
図6の符号11内で、各スタッフに対応するプライサー同士は、完全に独立しており、マルチプロセッサによる並列化が容易に構成できる。特にZDD構造は、シーケンシャルアクセス構造をしており、ZDDグラフが、CPUのキャッシュサイズに収まらなくとも、優れたアクセス特性を提供できる。その効果は、マルチプロセッサ構成にしても高い性能を維持できる。マルチプロセッサ構成は、CPU数に余裕がある場合は、各スタッフ毎にCPUを一つ割り当ててもよいし、GPUを利用してもよい。余裕がなければ、物理CPUをOPEN-MPなどでスケジューリングして割り当てればよい。また、複数のスタッフのグループ毎にCPUを一つ割り当ててもよい。
[3.10. Parallelization of Pricer]
In reference numeral 11 in FIG. 6, the pricers corresponding to each stuff are completely independent, and parallelization by a multiprocessor can be easily configured. In particular, the ZDD structure has a sequential access structure, and even if the ZDD graph does not fit in the cache size of the CPU, it can provide excellent access characteristics. As a result, high performance can be maintained even in a multiprocessor configuration. In the multi-processor configuration, if there is room in the number of CPUs, one CPU may be assigned to each staff, or a GPU may be used. If there is no room, physical CPUs can be allocated by scheduling with OPEN-MP or the like. Also, one CPU may be assigned to each group of staff.

MaxSAT(最大充足割当問題)とは,連言標準形(Conjunctive Normal Form, CNF)で書かれた論理式内の論理変数に対して,満たす節(clause)の数が最も多くなるような真偽値を求める問題である。Weighted MaxSATとは,CNFで書かれた論理式内の節に重みが与えられている場合に,論理式内の変数に対して,満たす節の重みの和が最も大きくなるような真理値割り当てを求める問題である。Weighted Partial MaxSATとは,前述のWeighted MaxSATに対し,必ず満たさなければいけない節(ハード)と満たさなくても構わない節(ソフト)を考えた最適化問題である。非特許文献5には、スケジューリング問題をWeighted Partial MaxSATに変換して解く方法が述べられている。ここでは、Weighted Partial MaxSATソルバーのことを単にMaxSATソルバーと呼称する。 MaxSAT (Maximum Satisfaction Assignment Problem) is a truth-or-false problem that maximizes the number of clauses that satisfy a logical variable in a logical expression written in Conjunctive Normal Form (CNF). It is a question of finding a value. Weighted MaxSAT is a truth value assignment that maximizes the sum of the weights of satisfying clauses for variables in a logical formula written in CNF when weights are assigned to the clauses. It is a question to ask. Weighted Partial MaxSAT is an optimization problem considering a clause that must be satisfied (hardware) and a clause that does not have to be satisfied (software) for Weighted MaxSAT described above. Non-Patent Document 5 describes a method of converting a scheduling problem into Weighted Partial MaxSAT and solving it. Here, the Weighted Partial MaxSAT solver is simply referred to as the MaxSAT solver.

[3.11.MaxSATソルバーによる整数化]
さらに高速に解を得る方法として、図6 符号4 MaxSATソルバーについて説明する。MaxSATソルバーに入力されるのは、図6 符号5は、図1 符号5でもあり、その具体的内容は図2の通りである。つまり、システム全体の制約をCNF化してMaxSATソルバーに入力されている。MaxSATソルバーは、符号9 整数解を出力する。これによりMaxSATソルバー単体で、システム全体の解を得る能力を有している。
[3.11. Integer conversion by MaxSAT solver]
As a method of obtaining a solution at a higher speed, the MaxSAT solver shown in FIG. 6 will be described. The input to the MaxSAT solver is the code 5 in FIG. 6 and the code 5 in FIG. 1, and the specific contents are as shown in FIG. In other words, the constraints of the entire system are converted into CNF and input to the MaxSAT solver. The MaxSAT solver outputs code 9 integer solutions. As a result, the MaxSAT solver alone has the ability to obtain solutions for the entire system.

このMaxSATソルバーの入力として、さらに、符号1 線形緩和主問題のソルバーの出力 符号6 浮動小数点データのうち、符号7 整数データを入力して取り込むことが特徴である。この例を図21に示す。符号6のデータは、一般的には、浮動小数である。旧来のヒューリスティクスによる方法では、浮動小数点データ、例えば、0.9→1、 0.1→0 とすることによって整数化を行っている。このうち最も信頼度が高いデータは、整数値であり、もっとも信頼度が低いデータは0.5である。そこで、MaxSATソルバーに入力するデータは、整数となるデータを補助データとして入力する。MaxSATソルバー内の制約伝播機構が、入力された補助データと、システムの全体制約から、まだ決定されていない2値データを推定する機構として働く。これにより、高精度な実行可能解を早く出力する。この機構は、分枝限定中も動作させることができる。 As the input of this MaxSAT solver, it is characterized in that code 7 integer data among code 1 output of the solver of the linear relaxation main problem, code 6 floating point data is input and taken in. An example of this is shown in FIG. The data of code 6 are generally floating point numbers. The conventional heuristic method performs integer conversion by setting floating point data, for example, 0.9→1, 0.1→0. The data with the highest reliability among them is an integer value, and the data with the lowest reliability is 0.5. Therefore, as the data to be input to the MaxSAT solver, integer data is input as auxiliary data. A constraint propagation mechanism within the MaxSAT solver serves as a mechanism for estimating the as yet undetermined binary data from the input ancillary data and the global constraints of the system. As a result, a high-precision feasible solution is quickly output. This mechanism can also operate during branch-and-bound.

[3.12.MaxSATソルバーによる初期解生成]
MaxSATソルバーは、ハード制約を満たした解(以下、実行可能解と呼ぶ)の導出が速い。図6 符号4のMaxSATソルバーを最初に動作させ、その解 符号9を 図3 符号30 線形主問題の初期解 としてもよい。こうすると、主問題の改善開始点は、MaxSATソルバーの出力する目的関数値とすることができ、収束の高速化に寄与する。また、MaxSATソルバーの目的関数値が、ZDDを構成するソフト制約の重みを下回る場合は、ソフト制約をハード制約としてコンパイルできる。例を、図21に示す。これによりZDDの構造はさらにコンパクトになり、さらなる高速化が達成される。
[3.12. Initial solution generation by MaxSAT solver]
The MaxSAT solver is fast in deriving a solution that satisfies the hard constraints (hereinafter called a feasible solution). The MaxSAT solver of FIG. 6 code 4 may be run first and its solution code 9 may be taken as FIG. 3 code 30 initial solution of linear primal problem. In this way, the starting point for improving the main problem can be the objective function value output by the MaxSAT solver, which contributes to speeding up convergence. Also, if the MaxSAT solver's objective function value is below the weight of the soft constraints that make up the ZDD, then the soft constraints can be compiled as hard constraints. An example is shown in FIG. This makes the ZDD structure more compact and achieves even higher speeds.

[4.本発明による効果]
大きなインスタンスでも、最適解保証つきの解が高速に得られる。図23、図24は、非特許文献1および2と同じインスタンスによる、最新性能の数理ソルバーとの比較である。
ScheduleNurse3が本発明を適用したソルバーである。明らかに、本発明による方法が優位であることが分かる。
また、アカデミックなベンチマークサイト(http://www.schedulingbenchmarks.org/changes.html)には、ナーススケジューリング問題に対して国際記録更新情報が載っている。本発明者(Tak.Sugawara)による更新は、全て本発明による結果であり、長年未解決だった問題を解決する貢献も果たしている。
[4. Effects of the present invention]
A solution with optimal solution guarantee can be obtained at high speed even for large instances. 23 and 24 are comparisons with the state-of-the-art mathematical solvers according to the same instances as in Non-Patent Documents 1 and 2. FIG.
ScheduleNurse3 is the solver to which the present invention is applied. Clearly, it can be seen that the method according to the invention is superior.
Also, the academic benchmarking site (http://www.schedulingbenchmarks.org/changes.html) has international record updates for nurse scheduling problems. The updates by the inventor (Tak. Sugawara) are all the result of this invention and also contribute to solving a long standing problem.

1 線形緩和主問題ソルバー
2 プライサー
3 分枝限定法ブロック
4 MaxSATソルバー
5 ハード制約と制約とソフト制約
6 符号1の主解(浮動小数点出力)
7 符号1の整数データ出力
8 分枝限定法による整数解
9 MaxSATソルバーによる整数解
10 主問題へ列追加
11 プライサーブロック
12 主問題ソルバーの双対解出力
13 ロースター
20 行制約の例
21 基数制約の例
30 列生成法における初期解
80 日勤D2の重み
81 早番E2の重み
82 遅番L2の重み
83 休みY2の重み
84 遅番L3の重み
85 早番E3の重み
86 日勤D3の重み
87 休みY3の重み
90 日勤(D1)→早番(E2)の重み
91 日勤(D2)→早番(E3)の重み
92 日勤(D3)→早番(E4)の重み
93 日勤(D4)→早番(E5)の重み
100 ZDDノード
101 符号100の子ノード
102 符号100の子ノード
103 値、ブール値決定のアルゴリズム
104 符号100の重み
110 最終ノードでソフト基数制約の重みをマージした結果
111 子ノードの結果をマージした結果
112 子ノードの結果をマージ途中経過
113 符号116ノードの重みと、デルタカウント分
114 子ノード
115 子ノード
116 ZDDノード
117 シフトの和
140 プライサー中の主問題ソルバー
141 プライサー中の基数制約以外のZDD
142 符号140への列追加
143 符号140の主解
144 分岐限定法ブロック
145 符号140の整数解
146 符号140の双対解

1 linear relaxed primal problem solver 2 pricer 3 branch and bound block 4 MaxSAT solver 5 hard and soft constraints 6 primal solution of sign 1 (floating point output)
7 Integer data output with code 1 8 Integer solution by branch and bound method 9 Integer solution by MaxSAT solver 10 Column addition to primal problem 11 Pricer block 12 Dual solution output of primal problem solver 13 Roaster 20 Row constraint example 21 Cardinality constraint Example 30 Initial solution in sequence generation method 80 Weight of day shift D2 81 Weight of early shift E2 82 Weight of late shift L2 83 Weight of holiday Y2 84 Weight of late shift L3
85 Weight of early shift E3 86 Weight of day shift D3 87 Weight of holiday Y3 90 Weight of day shift (D1) → early shift (E2) 91 Weight of day shift (D2) → early shift (E3) 92 Weight of day shift (D3) → early shift (E4) weight 93 day shift (D4) → early shift (E5) weight 100 ZDD node 101 child node of code 102 child node of code 102 child node of code 103 algorithm for value, boolean determination 104 weight of code 100 110 weight of soft cardinality constraint at final node Result of merging 111 Result of merging child node result 112 Intermediate progress of merging child node result 113 Code 116 Node weight and delta count 114 Child node 115 Child node 116 ZDD node 117 Shift sum 140 Pricer Prime problem solver 141 ZDD other than cardinality constraints in pricer
142 column addition to code 140 143 principal solution of code 140 144 branch and bound block 145 integer solution of code 140 146 dual solution of code 140

Claims (5)

所定の集団に属するスタッフのスケジュールを構成するシフトとスケジュールに関する制約とに基づきスケジュールの最適化に関する処理をコンピュータに実行させるためのプログラムであって、
前記制約は、必ず守るべき制約であるハード制約と、必ずしも満たす必要はないが出来れば満たしたい制約であるソフト制約とを含み、
各スタッフ毎に、前記各スタッフに関わるハード制約およびソフト制約について、シフトをワンホットコードでZDD(ゼロサプレス型二分決定グラフ)にエンコードしたZDDグラフの始点と終点間のZDDノードのコスト総和を最小化する経路を求めることによって、前記ハード制約を充足させ、かつ、前記ソフト制約の違反する制約の重みの総和を最小化する、各スタッフの最適化問題の解を得る第1手段、
前記各スタッフの最適化問題の解を列とする列生成法と、分枝限定法とに基づいて、整数解を得る第2手段、
として前記コンピュータを機能させるためのプログラム。
A program for causing a computer to execute processing related to schedule optimization based on shifts constituting a schedule of staff members belonging to a predetermined group and constraints related to the schedule,
The constraints include hard constraints, which are constraints that must always be observed, and soft constraints, which are constraints that do not necessarily need to be satisfied but are desired to be satisfied if possible,
For each staff, for the hard and soft constraints associated with each staff, minimize the sum of the costs of the ZDD nodes between the start and end points of the ZDD graph that encodes the shifts into a ZDD (Zero Suppressed Binary Decision Diagram) with one-hot code. a first means for solving an optimization problem for each staff that satisfies the hard constraint and minimizes the sum of the weights of the violated constraints of the soft constraint by finding a path that
Second means for obtaining an integer solution based on a sequence generation method in which the solution of the optimization problem of each stuff is a sequence and a branch and bound method;
A program for causing the computer to function as a computer.
請求項1に記載のプログラムであって、
前記第1手段が、各スタッフ毎に基数制約以外のハード制約およびソフト制約についてシフトをワンホットコードでZDDにエンコードして得られる解を列とする列生成法と、分枝限定法とに基づき、各スタッフの最適化問題の解を整数化するように前記コンピュータを機能させるためのプログラム。
The program according to claim 1,
The first means is based on a sequence generation method that uses a sequence of solutions obtained by encoding a shift into a ZDD with a one-hot code for hard constraints and soft constraints other than cardinality constraints for each stuff, and a branch and bound method. , a program for causing the computer to function to integerize the solution of the optimization problem for each staff.
請求項1に記載のプログラムであって、
前記第1手段が、前記コンピュータの複数のプロセッサによって各スタッフの最適化問題の解を得るように前記コンピュータを機能させるためのプログラム。
The program according to claim 1,
A program for causing said first means to function said computer to solve each staff optimization problem by a plurality of processors of said computer.
請求項1に記載のプログラムであって、
前記ハード制約と前記ソフト制約とを各々CNFにエンコードする第3手段、
前記列に対する線形緩和主問題の主解の整数データをCNFにエンコードする第4手段、
前記第3手段と前記第4手段とによって得られたCNFをMaxSATソルバーに入力することで整数解を得る第5手段、
として前記コンピュータを機能させるためのプログラム。
The program according to claim 1,
third means for encoding each of said hard constraints and said soft constraints into a CNF;
fourth means for encoding into CNF integer data of a primal solution of a linear relaxation primal problem for said sequence;
A fifth means for obtaining an integer solution by inputting the CNF obtained by the third means and the fourth means into a MaxSAT solver;
A program for causing the computer to function as a computer.
請求項1に記載のプログラムであって、
前記ハード制約と前記ソフト制約とを各々CNFにエンコードする第3手段、
得られたCNFをMaxSATソルバーに入力することで整数解を得る第5手段、
前記第5手段によって得られた整数解を前記列生成法の初期解として設定する第6手段、
として前記コンピュータを機能させるためのプログラム。

The program according to claim 1,
third means for encoding each of said hard constraints and said soft constraints into a CNF;
Fifth means for obtaining an integer solution by inputting the obtained CNF into a MaxSAT solver;
A sixth means for setting the integer solution obtained by the fifth means as an initial solution of the sequence generation method;
A program for causing the computer to function as a computer.

JP2022075531A 2022-04-29 2022-04-29 program Active JP7169494B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2022075531A JP7169494B1 (en) 2022-04-29 2022-04-29 program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2022075531A JP7169494B1 (en) 2022-04-29 2022-04-29 program

Publications (2)

Publication Number Publication Date
JP7169494B1 true JP7169494B1 (en) 2022-11-11
JP2023164173A JP2023164173A (en) 2023-11-10

Family

ID=83996924

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2022075531A Active JP7169494B1 (en) 2022-04-29 2022-04-29 program

Country Status (1)

Country Link
JP (1) JP7169494B1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120278675A1 (en) * 2011-04-29 2012-11-01 Synopsys, Inc. Method and apparatus for performing implication and decision making using multiple value systems during constraint solving
JP2015172794A (en) * 2014-03-11 2015-10-01 孝幸 菅原 Program, scheduling method, and scheduling device
JP2015222464A (en) * 2014-05-22 2015-12-10 孝幸 菅原 Scheduling device
JP2019028576A (en) * 2017-07-27 2019-02-21 孝幸 菅原 Program, constraint satisfaction problem solving device and constraint satisfaction problem solving method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120278675A1 (en) * 2011-04-29 2012-11-01 Synopsys, Inc. Method and apparatus for performing implication and decision making using multiple value systems during constraint solving
JP2015172794A (en) * 2014-03-11 2015-10-01 孝幸 菅原 Program, scheduling method, and scheduling device
JP2015222464A (en) * 2014-05-22 2015-12-10 孝幸 菅原 Scheduling device
JP2019028576A (en) * 2017-07-27 2019-02-21 孝幸 菅原 Program, constraint satisfaction problem solving device and constraint satisfaction problem solving method

Also Published As

Publication number Publication date
JP2023164173A (en) 2023-11-10

Similar Documents

Publication Publication Date Title
Lombardi et al. Optimal methods for resource allocation and scheduling: a cross-disciplinary survey
Chatha et al. Hardware-software partitioning and pipelined scheduling of transformative applications
Krishnan et al. A genetic algorithm for the design space exploration of datapaths during high-level synthesis
Herroelen Resource-constrained project scheduling—the state of the art
Altuwaim et al. Optimizing the scheduling of repetitive construction to minimize interruption cost
Vishkin Using simple abstraction to reinvent computing for parallelism
Bakshi et al. Partitioning and pipelining for performance-constrained hardware/software systems
Dürr et al. Scheduling with explorable uncertainty
Bilavarn et al. Design space pruning through early estimations of area/delay tradeoffs for FPGA implementations
Atasu et al. Fast custom instruction identification by convex subgraph enumeration
Bofill et al. Compact MDDs for Pseudo-Boolean Constraints with At-Most-One Relations in Resource-Constrained Scheduling Problems.
Narasimhan et al. A fast approach to computing exact solutions to the resource-constrained scheduling problem
Chen et al. Single-machine scheduling with autonomous and induced learning to minimize total weighted number of tardy jobs
JP7169494B1 (en) program
Hillar et al. Equivariant Gröbner bases
Boucheneb et al. Optimal reachability in cost time Petri nets
Kritikakou et al. A systematic approach to classify design-time global scheduling techniques
Xie et al. Co-synthesis with custom ASICs
Li et al. ANNA: Accelerating Neural Network Accelerator through software-hardware co-design for vertical applications in edge systems
Hossain et al. Autogeneration of simulation network of the design process
Radivojevic et al. Symbolic techniques for optimal scheduling
Kirilov et al. Interactive environment WebOptim for solving multiple-objective problems using scalarising and evolutionary approaches
Abramson et al. Robust workflows for science and engineering
De Ita Luna et al. Finding pure Nash equilibrium for the resource-constrained project scheduling problem
Xiao et al. Optimization on operation sorting for HLS scheduling algorithms

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220502

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20220502

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20220823

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220909

R150 Certificate of patent or registration of utility model

Ref document number: 7169494

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250