JP4636609B2 - Material allocation method, apparatus and program - Google Patents

Material allocation method, apparatus and program Download PDF

Info

Publication number
JP4636609B2
JP4636609B2 JP2005208348A JP2005208348A JP4636609B2 JP 4636609 B2 JP4636609 B2 JP 4636609B2 JP 2005208348 A JP2005208348 A JP 2005208348A JP 2005208348 A JP2005208348 A JP 2005208348A JP 4636609 B2 JP4636609 B2 JP 4636609B2
Authority
JP
Japan
Prior art keywords
weight
order
unit
allocated
upper limit
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.)
Expired - Fee Related
Application number
JP2005208348A
Other languages
Japanese (ja)
Other versions
JP2007026162A (en
JP2007026162A5 (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.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
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 International Business Machines Corp filed Critical International Business Machines Corp
Priority to JP2005208348A priority Critical patent/JP4636609B2/en
Publication of JP2007026162A publication Critical patent/JP2007026162A/en
Publication of JP2007026162A5 publication Critical patent/JP2007026162A5/ja
Application granted granted Critical
Publication of JP4636609B2 publication Critical patent/JP4636609B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Description

本発明は、材料引当方法、装置、プログラムに関する。さらに具体的には、材料を注文に応じて余剰なく引当てる計算方法、およびこれを実現する装置、プログラムに関する。   The present invention relates to a material allocation method, apparatus, and program. More specifically, the present invention relates to a calculation method for allocating materials without surplus according to orders, and an apparatus and a program for realizing the calculation method.

従来より、顧客からの注文に応じて製品を製造する受注生産の場合、製品素材への注文の引当の際に、製品素材と注文の引当方法を最適化する手法やシステムが知られている。特に、鉄鋼業界においては、顧客からの注文は通常、全体の注文量とは別に各納入製品の重量(単重)がそれぞれマージンをもって指定されて行われることが多く、このような注文方法に対して材料の引当の最適化を試みる手法が提案されている。   2. Description of the Related Art Conventionally, in the case of a build-to-order manufacturing in which a product is manufactured according to an order from a customer, a technique and a system for optimizing a product material and an order allocation method are known at the time of allocation of an order for product material. In particular, in the steel industry, orders from customers are usually made by specifying the weight (unit weight) of each delivered product with a margin separately from the total order quantity. A method that attempts to optimize the allocation of materials has been proposed.

例えば、特許文献1には、最終工程における製品の採取の際に単重外れが生じないような材料単位編成、及び注文製品の採取ができる生産管理システムが開示されている。また、特許文献2には、複数種類の製品の注文および複数種類の余剰素材を予め特性に基づいてそれぞれグルーピングし、グループ単位に特性を基準に引当の可否を判定する方法などが開示されている。
特開平5−19809号公報 特開平6−149850号公報
For example, Patent Document 1 discloses a production management system capable of collecting a material unit so as not to lose a single weight when collecting a product in a final process and collecting a custom product. Further, Patent Document 2 discloses a method of grouping a plurality of types of products and a plurality of types of surplus materials in advance based on characteristics, and determining whether allocation is possible based on the characteristics for each group. .
Japanese Patent Laid-Open No. 5-19809 Japanese Patent Laid-Open No. 6-149850

鉄鋼業界においては、一つの材料は、通常、小さく切断して、数個の注文に引当てる(図2に、一つの材料を三つの注文へ切り分けて引当てた例を示す)。各注文には、注文量とその上下のマージン(引当量の許容範囲)、そして、単重上下限が設定されている。材料は、各注文に対して、単重上下限の範囲内の大きさに切断し、引当量が許容範囲におさまるように引当てる。この際、材料に余剰(どの注文にも引当てられなかった余り)が出ないように引当てることが課題である。   In the steel industry, one material is usually cut into small pieces and allocated to several orders (FIG. 2 shows an example in which one material is divided into three orders and allocated). Each order has an order quantity, upper and lower margins (allowable amount allowance range), and unit weight upper and lower limits. For each order, the material is cut to a size within the upper and lower limits of the unit weight, and allocated so that the allocated amount falls within the allowable range. At this time, it is a problem to allocate so that there is no surplus in the material (a surplus not allocated to any order).

製鋼所では、原則として、顧客からの注文に応じて材料(スラブ・コイル等)を生産するため、各生産工程において注文と材料は関連付いた状態が保持されている。しかし、材料が各工程を通過するうちに、様々な原因により、注文と材料の関係が崩れることがある。こうした場合に、注文に関連付いていない材料を改めて注文に引当て直すシステムのことを材料引当システムという。   In steelworks, in principle, materials (slabs, coils, etc.) are produced in response to orders from customers. Therefore, the order and the materials are related in each production process. However, as the material passes through each process, the relationship between the order and the material may be broken due to various causes. In such a case, a system for reallocating materials not related to the order to the order again is called a material allocation system.

材料引当システムでは、基本的には、注文量に合わせて材料を引当てる。例えば、15tの注文に対して10tの材料が二つあれば、10tの材料一つを引当て、もう一つの10tの材料は5tだけ切断して引当てる。ただし、注文には、引当てる材料ひとつひとつの重量の上下限である、単重上限と単重下限が設定されている。そのため、材料を引当てる際には、この単重の範囲内に収まるように材料を切断して引当なければならない。   In the material allocation system, materials are basically allocated in accordance with the order quantity. For example, if there are two 10t materials for an order of 15t, one 10t material is allocated, and the other 10t material is allocated by cutting 5t. However, the order has a single weight upper limit and a single weight lower limit, which are the upper and lower limits of the weight of each allocated material. Therefore, when allocating a material, the material must be cut and allocated so as to be within this single weight range.

例えば、14tの注文に単重制限4t〜6tという制限がある場合、10tの材料を一つと4tの材料を一つ用いて引当てることは可能であるが(10tの材料は、5tずつ二つに切断すれば単重制限を満たすので引当可能)、7tの材料二つのみを用いて14tの注文を満たすことはできない(7tの材料は、どのように切断して引当も余剰無く引当てることはできず、14tに届かない)。単重制限があるため、材料を注文量と同じになるように引当ていくと、材料には小さな余剰(およそ5t未満)が多数発生してしまう。小さな余剰は廃棄される公算が高く、製鋼所にとっては損失になるため、注文には一定のマージンが設けられており、余剰が発生しない場合に限り、注文量の上下限の範囲内で注文への総引当量を調整することが許されている。逆に、注文量に合わせて引当てると小さな余剰が発生するときは、注文のマージンを使って余剰が発生しないように引当てることが望まれる。   For example, if there is a single weight limit of 4t to 6t in an order of 14t, it is possible to allocate 10t material using one 4t material (10t material is two for each 5t). However, it is not possible to satisfy the order of 14t using only two 7t materials (7t material can be cut and allocated without surplus) Cannot reach 14t). Since there is a single weight limit, if a material is allocated so as to be the same as the order quantity, many small surpluses (less than about 5 t) are generated in the material. A small surplus is likely to be discarded and is a loss for the steel mill, so there is a certain margin in the order, and only if there is no surplus, the order will be placed within the upper and lower limits. It is allowed to adjust the total allowance. On the contrary, when a small surplus occurs when allocation is made in accordance with the order quantity, it is desirable to use an order margin so that no surplus occurs.

以上のような条件のもとで、どの材料をどの注文に引当てるかについて最適化を行うのが、材料引当システムの最適化である。各材料は均質ではなく、個々の材料と注文の組み合わせについて、望ましい組み合わせやそうでない組み合わせがあるため、引当量を注文量に合わせるだけではなく、様々な引当の組み合わせを調べて最適な引当を探索する必要がある。しかし、たとえ組み合わせの候補となる注文と材料が数個程度ずつであったとしても、可能な引当方法は膨大な数があり、全ての可能性を網羅して最適な引当方法を求めるのは現実的ではない。キログラム単位で与えられる注文量や単重上下限について、1キログラムずつ引当量を変えながら全ての場合を調べつくすのは計算時間の面で困難だからである。   Optimization of the material allocation system optimizes which material is allocated to which order under the above conditions. Each material is not homogeneous, and there are desirable and non-relevant combinations of individual materials and orders, so not only the amount of the provision is matched to the order quantity, but also the various provision combinations are examined to find the optimum provision There is a need to. However, even if there are only a few orders and materials that are candidates for combination, there are a huge number of possible allocation methods, and it is a reality to find the optimal allocation method covering all possibilities Not right. This is because it is difficult in terms of calculation time to find out all cases of the order quantity and unit weight upper and lower limits given in kilograms while changing the provision amount by 1 kilogram.

そのため、何らかの経験則を用いて調べる引当の候補を限定することになる。実用上は、引当は原則として注文量に合わせて行うこととし、余剰が発生するケースについては例外的に対応する方法で、解決することが多い。つまり、原則として注文量にあわせて引当を行い、小さな余剰が発生する場合にのみ注文量のマージンを調べ、余剰の大きさがマージンの範囲内に入っていればマージンを利用して余剰を無くすアルゴリズムである。例えば、5tの注文が一つ、6tの注文が一つ、12tの材料が一つあるとき、まず材料を5tだけ切断して一方の注文に引当て、残り7tをもう一方の注文に引当てることを考える。このとき、注文に1t以上のマージンが設定されていれば、注文量の6tではなく7tを引当てることによって、余剰の発生を無くす。   Therefore, candidates for allocation to be examined using some rule of thumb are limited. In practice, provisions are made according to the order volume in principle, and cases where surpluses are generated are often solved by an exceptional method. In other words, in principle, provisions are made according to the order volume, and the margin of the order volume is checked only when a small surplus occurs. Algorithm. For example, if there is one order for 5t, one order for 6t, and one material for 12t, the material is first cut by 5t and allocated to one order, and the remaining 7t is allocated to the other order. Think about it. At this time, if a margin of 1 t or more is set for the order, the generation of surplus is eliminated by allocating 7 t instead of 6 t of the order quantity.

しかし、このような解決方法では、余剰を無くす引当が可能な場合でも、余剰を発生させてしまうことがある。例えば、11tの材料と、5tの注文が二つある場合を考える。二つの注文がともに、引当量上下限は4.5t〜5.5t、単重上下限は2.7t〜5.1tとされているとする。このとき、上記解決方法では、まず一つの注文に5tで引当を行い、次に、残りの6tの材料を5tの注文に引当てることを試みる。しかし、この場合、マージンが足りないので(上記アルゴリズムを適用した場合は)余剰を発生させてしまうことになる。ただし、実際には、二つの注文に5.5tずつ引当を行えば余剰無く引当てることができる。   However, such a solution may cause a surplus even when a provision for eliminating the surplus is possible. For example, consider a case where there are two orders for 11t material and 5t. Assume that the upper and lower limits of the provision amount are 4.5 t to 5.5 t and the upper and lower limits of the unit weight are 2.7 t to 5.1 t for both orders. At this time, in the above solution, first, one order is allocated at 5t, and then the remaining 6t material is allocated to the 5t order. However, in this case, a margin is insufficient (when the above algorithm is applied), a surplus is generated. However, in actuality, it is possible to reserve without surplus by allocating 5.5 t to two orders.

そこで、材料を余剰無く引当てることができる場合には、そのような引当て方も探索候補に追加するのが自然な考え方である。ところが、単重制限のもとでは、一つの材料を複数の注文に余剰無く引当てることができるかどうかを判定する問題は困難であり、効率的なアルゴリズムは知られていない。ただ、通常、一つの材料は多くとも三つ程度の注文にしか引当てられないので、注文の数を限定すれば問題の困難さは低減するが、それでも、余剰を無くす引当ができるかどうかを効率的に判定することは簡単な問題ではない。   Therefore, when materials can be allocated without surplus, it is a natural idea to add such allocation methods to search candidates. However, under the single weight restriction, it is difficult to determine whether one material can be allocated to a plurality of orders without surplus, and an efficient algorithm is not known. However, since a single material can usually be allocated to at most about three orders, limiting the number of orders will reduce the difficulty of the problem, but it will still be possible to allocate to eliminate the surplus. Efficient judgment is not a simple problem.

本発明で解決しようとする課題は、この余剰を無くす引当ができるかどうかを判定し、引当可能な場合は、その引当てる方法を提供することである。上記で述べたように、余剰が出ない引当を探す処理は、膨大な数の回数が実行されることが想定される。そのため、十分に高速なアルゴリズムであることが必要である。   The problem to be solved by the present invention is to determine whether or not an allowance for eliminating this surplus can be determined, and to provide a method for allocating if it can be reserved. As described above, it is assumed that an enormous number of times is performed in the process of searching for a provision that does not generate surplus. Therefore, it is necessary that the algorithm is sufficiently fast.

マージンのある引当材料の重量を算出する方法において、与えられる材料の重量の入力を受け、かつ、各々の注文に対する単重、単重上限、単重下限、マージン上限値、マージン下限値の入力を受けるステップと、入力された注文に対して、所定の算出式に基づいて、材料を余剰なく引当てることが可能であるかを判断するステップと、材料を余剰なく引当てることが可能であると判断したことに応じて、引当て材料の重量を算出するステップと、を含む方法、およびその方法を実現する装置、プログラムを提供する。   In the method of calculating the weight of allocated material with margin, input the weight of the given material, and input the unit weight, unit weight upper limit, unit weight lower limit, margin upper limit value, margin lower limit value for each order. A step of receiving, a step of determining whether a material can be allocated without surplus based on a predetermined calculation formula for the input order, and a material can be allocated without surplus A method including the step of calculating the weight of the material allocated according to the determination, and an apparatus and a program for realizing the method are provided.

前記の判断するステップでは、注文の数が一つである場合、材料の重量を単重下限で除算した商を超えない最大の整数と、単重上限との積が、材料の重量以上の重量であるとする算出式に基づいて判断する。   In the determining step, when the number of orders is one, the product of the maximum integer not exceeding the quotient obtained by dividing the weight of the material by the lower limit of the unit weight and the upper limit of the unit weight is a weight equal to or more than the weight of the material. It is determined based on a calculation formula that

また、前記の判断するステップでは、注文の数が複数の場合、入力された注文に対して、与えられる材料の重量、注文の各々の単重上限、単重下限に基づいて、引当が可能な引当量の組み合わせを、ユークリッド空間領域の格子点で表し、この格子点の有無を検出することにより、材料を余剰なく引当てることが可能であるかを判断する。   Further, in the determining step, when there are a plurality of orders, the input order can be allocated based on the weight of the given material, the single weight upper limit and the single weight lower limit of each order. A combination of the allocation amounts is represented by a grid point in the Euclidean space region, and whether or not the material can be allocated without a surplus is determined by detecting the presence or absence of the grid point.

上記発明によれば、余剰を無くす引当が存在するか否かを判定し、存在する場合は、その引当を提供する高速な処理を実現することができる。処理の高速性は、注文が一つの場合では、一つの不等式で判定することができるようになったことによる。注文が複数の場合では、二分探索などの手法を組み合わせて実現したことで、早く確実に余剰を無くす引当ができるかどうかを実用的な時間で判定することができるようになったことによる。   According to the above invention, it is determined whether or not there is a provision for eliminating the surplus, and when it exists, a high-speed process for providing the provision can be realized. The high speed of processing is due to the fact that when there is one order, it can be determined by one inequality. This is because, in the case where there are a plurality of orders, it has become possible to determine in a practical time whether or not it is possible to make provisions to eliminate surplus quickly and reliably by realizing a combination of techniques such as binary search.

以下、発明の実施形態を通じて本発明を説明する。なお、以下の実施形態は特許請求の範囲にかかる発明を限定するものではない。また、実施形態の中で説明されている構成要素の組み合わせの全てが発明の解決手段に必須であるとは限らない。   Hereinafter, the present invention will be described through embodiments of the invention. The following embodiments do not limit the invention according to the claims. Moreover, not all the combinations of the constituent elements described in the embodiments are essential for the solving means of the invention.

図1は、上記機能を備えた材料引当装置100の概略図である。材料引当装置100は、ユーザからの入力を受け付ける入力部110、演算処理を行う実行部115、アルゴリズム記憶部130、関数記憶部140、および出力部170で構成される。   FIG. 1 is a schematic diagram of a material allocation apparatus 100 having the above function. The material allocation apparatus 100 includes an input unit 110 that receives input from a user, an execution unit 115 that performs arithmetic processing, an algorithm storage unit 130, a function storage unit 140, and an output unit 170.

入力部110は、キーボードやマウスなど人間からの操作を受け付ける入力装置の他、他のプログラムなどの出力を入力データとして受け取る装置であってもよい。また、通信機能を備え、遠隔地の他のシステムからデータを受信してもよい。入力部110を介して、実行部115には、材料の重量、注文の数、各注文ごとの注文量の上限値注文量の下限値、単重の上限値、単重の下限値が与えられる。 The input unit 110 may be a device that receives an output from another program as input data in addition to an input device that accepts an operation from a human such as a keyboard or a mouse. In addition, a communication function may be provided to receive data from other remote systems. Through the input unit 110, the execution unit 115 is given the weight of the material, the number of orders, the upper limit value of the order quantity for each order, the lower limit value of the order quantity, the upper limit value of the single weight, and the lower limit value of the single weight. It is done.

実行部115は、注文の数によって適用されるアルゴリズムを選択するアルゴリズム選択部120、選択されたアルゴリズムの実行結果によって、材料が余剰なく引当可能かどうかを判断する引当判断部150、引当られた材料の重量を算出する重量算出部160によって構成される。実行部115は、入力部110から与えられた入力によって材料が各注文に対して余剰なく
引当可能かどうかの判断、および引当可能な場合はその引当量を各注文ごとに計算する。
The execution unit 115 includes an algorithm selection unit 120 that selects an algorithm to be applied according to the number of orders, an allocation determination unit 150 that determines whether the material can be allocated without surplus according to the execution result of the selected algorithm, and the allocated material It is comprised by the weight calculation part 160 which calculates the weight of. The execution unit 115 determines whether or not the material can be allocated without surplus for each order by the input given from the input unit 110, and calculates the allocation amount for each order when the material can be allocated.

アルゴリズム記憶部130は、注文の数によって選択される複数のアルゴリズムを記憶する。また、各アルゴリズムは、演算を行うために必要な一または複数の関数を呼び出すために関数記憶部140と接続される。各アルゴリズムと関数は、後述するように、それぞれ再帰的に呼び出されることが可能である。   The algorithm storage unit 130 stores a plurality of algorithms selected according to the number of orders. In addition, each algorithm is connected to the function storage unit 140 in order to call one or a plurality of functions necessary for performing an operation. Each algorithm and function can be called recursively, as described below.

出力部170は、実行部115によって得られた結果、すなわち、余剰なく引当が可能かどうかの判断、引当が可能と判断された場合は、各注文に対する引当重量の計算結果を表示する。出力部170は、実行部115の結果を出力する機能を備え、CRTや液晶ディスプレーなどの表示装置であってよく、また、他のシステムやプログラムにデータを受け渡す通信部であってもよい。   The output unit 170 displays the result obtained by the execution unit 115, that is, whether or not it is possible to reserve without surplus, and when it is determined that allocation is possible, the calculation result of the allocated weight for each order. The output unit 170 has a function of outputting the result of the execution unit 115, may be a display device such as a CRT or a liquid crystal display, and may be a communication unit that transfers data to other systems or programs.

本発明の実施形態では、一つの材料を、余剰が出ないように複数個の注文に引当てることが可能な場合、その引当のパターンは少数のパターンに限定できるので、全てのパターンについて余剰が出ない引当が存在するかどうかを判定する。個々の引当パターンについて、余剰が出ない引当の探索は、以下の二つのアルゴリズムを組み合わせて実現した。一つは、ある一つの注文への引当量が、その注文の単重制限を満たすか否かを高速に判定するアルゴリズム。もう一つは、複数の注文に一つの材料を引当てるとき、引当が可能な引当量の組み合わせをユークリッド空間(実施形態では二次元平面上)の多面体内(面上を含む)の格子点で表現し、その多面体内の格子点を高速に見つけるアルゴリズム。多面体内の格子点を見つけるアルゴリズムは、2次元平面にマップした三角形内の格子点の数を高速に数えるアルゴリズムと二分探索法を用いて実現した。以下、これらのアルゴリズムについて詳しく説明する。   In the embodiment of the present invention, when a single material can be allocated to a plurality of orders so as not to generate surplus, the allocation pattern can be limited to a small number of patterns. It is determined whether there is a provision that cannot be issued. For each allocation pattern, a search for an allocation with no surplus was realized by combining the following two algorithms. One is an algorithm that determines at a high speed whether or not the provision amount for an order satisfies the unit weight limit of the order. The other is that when a material is allocated to a plurality of orders, a combination of allocation amounts that can be allocated is represented by lattice points in a polyhedron (including a plane) in the Euclidean space (in the embodiment, on a two-dimensional plane). An algorithm that expresses and finds lattice points in the polyhedron at high speed. The algorithm for finding the lattice points in the polyhedron is realized by using an algorithm that counts the number of lattice points in a triangle mapped to a two-dimensional plane at high speed and a binary search method. Hereinafter, these algorithms will be described in detail.

[解くべき問題]
以下、簡単のため注文数は1〜3の場合で説明するが、本発明に係る手法は、注文数が4以上の場合でも拡張が可能である。
入力: 注文の数n(1≦n≦3)が与えられ、各注文Oi(1≦i≦n)について、以下の制限が与えられる。
1)注文量の上限rui
2)注文量の下限rli
3)単重の上限uui
4)単重の下限uli
材料については、材料の重さwが与えられる。
出力: 制約条件を満たす、各注文Oi(1≦i≦n)への引当量AQi。制約条件を満たさない場合は、その旨を出力する。
制約条件: 各注文Oi(1≦i≦n)への引当量AQiは、以下の制約を満たす必要がある。
1)rli≦AQi≦rui(引当量の制約)
2)ある整数kiが存在して、uli・ki≦AQi≦uui・ki(単重制限)
3)w=AQ1+AQ2+・・・+AQn (余剰はゼロでなければならない)
[Problem to be solved]
Hereinafter, for the sake of simplicity, the case where the number of orders is 1 to 3 will be described, but the method according to the present invention can be extended even when the number of orders is 4 or more.
Input: The number of orders n (1 ≦ n ≦ 3) is given, and for each order O i (1 ≦ i ≦ n), the following restrictions are given.
1) Maximum order quantity ru i
2) Lower limit of order quantity rl i
3) Upper limit of unit weight uu i
4) Lower limit of unit weight ul i
For materials, the weight of the material w is given.
Output: Provision AQ i for each order O i (1 ≦ i ≦ n) that satisfies the constraint condition. If the constraint is not satisfied, a message to that effect is output.
Constraints: The allocation amount AQ i for each order O i (1 ≦ i ≦ n) must satisfy the following constraints.
1) rl i ≦ AQ i ≦ ru i (restriction of provision amount)
2) There exists an integer k i and ul i · k i ≦ AQ i ≦ uu i · k i (single weight limit)
3) w = AQ 1 + AQ 2 + ... + AQ n (the surplus must be zero)

[アルゴリズム]
以上の制約条件を解くために注文の数に応じて、適用するアルゴリズムが異なる。注文の数が一つのときは後述のアルゴリズム1を適用し、注文の数が二つのときは後述するアルゴリズム2を適用し、注文の数が三つのときは後述のアルゴリズム3を適用する。また、注文の数によらず共通に使用する関数を以下に記述する。
[algorithm]
In order to solve the above constraints, the applied algorithm differs depending on the number of orders. Algorithm 1 described later is applied when the number of orders is one, algorithm 2 described later is applied when the number of orders is two, and algorithm 3 described later is applied when the number of orders is three. In addition, functions commonly used regardless of the number of orders are described below.

[注文数によらない関数]
<床関数、天井関数>
以降、実数xについて、floor(x)(床関数)は、xを超えない最大の整数、ceil(x)(天井関数)はxを下回らない最小の整数と定義する。また、図中では、簡単化のため、

Figure 0004636609
と表記する。 [Function without order quantity]
<Floor function, ceiling function>
Hereinafter, for real number x, floor (x) (floor function) is defined as the largest integer that does not exceed x, and ceil (x) (ceiling function) is defined as the smallest integer that does not fall below x. In the figure, for simplicity,
Figure 0004636609
Is written.

<関数1(Oi,w)>
入力: 注文Oiと引当可能な材料の重量w
if w≦floor(w/uli)・uui then 注文Oiに引当量wで引当可能と判定
else
余剰を無くす引当は不可能と判定
図11に関数1のアルゴリズムのフローチャートを示す。
<Function 1 (O i , w)>
Input: Order O i and material weight w available
if w ≦ floor (w / ul i ) ・ uu i then Judge that the order O i can be allocated with the allocation amount w
else
FIG. 11 shows a flowchart of the function 1 algorithm.

<関数2(Oa,Ob,a,b,c,xu,xl)>
入力: 注文Oa,Obと整数a,b,c、および実数xu,xl
拡張ユークリッド互除法を用いてa,bの最大公約数dと、ax0+by0=dを満たす整数x0,y0を求める
if cがdで割り切れる、かつ、ceil((xl-(c/d)x0)・(d/b))≦floor((xu-(c/d)x0)・(d/b)) then
注文Oaに引当量a((c/d)x0+(b/d)ceil((xl-(c/d)x0)・(d/b)))
注文Obに引当量c-a((c/d)x0+(b/d)ceil((xl-(c/d)x0)・(d/b)))
で引当可能と判定する
else
余剰を無くす引当は不可能と判定
図12に関数2のアルゴリズムのフローチャートを示す。
<Function 2 (O a , O b , a, b, c, x u , x l )>
Input: Order O a , O b and integer a, b, c and real number x u , x l
Find the greatest common divisor d of a and b and integers x 0 and y 0 that satisfy ax 0 + by 0 = d using the extended Euclidean algorithm
if c is divisible by d, and ceil ((x l- (c / d) x 0 ) · (d / b)) ≦ floor ((x u- (c / d) x 0 ) · (d / b )) Then
Order O a a reserve amount a ((c / d) x 0 + (b / d) ceil ((x l - (c / d) x 0) · (d / b)))
Order O b in reserve amount ca ((c / d) x 0 + (b / d) ceil ((x l - (c / d) x 0) · (d / b)))
Judge that it is possible to reserve in
else
FIG. 12 shows a flowchart of the function 2 algorithm.

<関数countT(a,b,m)>
if m<0 then return 0
if a<b then return countT(b,a,m)
p=floor(m/a)とおく。
if a=b then return p(p-1)/2
k=floor((a-1)/b)とおく。
q=floor((c-ap)/q)とおく。
return countT(a-bk,b,c-b(kp+q))+kp(p-1)/2+pq
図13に関数countTのアルゴリズムのフローチャートを示す。
<Function countT (a, b, m)>
if m <0 then return 0
if a <b then return countT (b, a, m)
Set p = floor (m / a).
if a = b then return p (p-1) / 2
Let k = floor ((a-1) / b).
Let q = floor ((c-ap) / q).
return countT (a-bk, b, cb (kp + q)) + kp (p-1) / 2 + pq
FIG. 13 shows a flowchart of the algorithm of the function countT.

[注文が一つの場合のアルゴリズム]
<アルゴリズム1(Oi,w)>
入力: 注文Oiと引当可能な材料の重量w
if rli≦w≦rui then
関数1(Oi,w)の判定結果をそのまま返す
else
余剰を無くす引当は不可能と判定
図3にアルゴリズム1のフローチャートを示す。
[Algorithm when there is one order]
<Algorithm 1 (O i , w)>
Input: Order O i and material weight w available
if rl i ≦ w ≦ ru i then
Returns the result of function 1 (O i , w)
else
FIG. 3 shows a flowchart of algorithm 1 in which it is impossible to reserve to eliminate the surplus.

以下、前述のアルゴリズムが正しく動作することを示す。アルゴリズムの正しさを示すために、後述で示される補題を利用している。アルゴリズム1では、まず、材料の重量が注文Oiの引当量が注文量の上下限内に入っているかどうかをチェックしている。注文量の上下限内に入っているときは、次に、単重の制約を満たすかどうかを判定する必要がある。引当量xが単重制約を満たすということは、単重上限uuと単重下限ulについて、ある正の整数nを用いてn・ul≦x≦n・uuと書き表せることにほかならない。これは、補題1より、x≦floor(x/ul)・uuの関係を満たすことと同値である。アルゴリズム1では、関数1を用いて、その判定をしている。引当量が注文量の上下限内に入っているかどうかと単重制約を満たしているかどうかを正しくチェックしているので、アルゴリズム1は、正しく動作することがわかる。 The following shows that the above algorithm operates correctly. In order to show the correctness of the algorithm, the following lemma is used. In the algorithm 1, first, it is checked whether the weight of the material is within the upper and lower limits of the order quantity for the order O i . When the order quantity is within the upper and lower limits, it is next necessary to determine whether or not the single weight constraint is satisfied. The fact that the allocation amount x satisfies the unit weight constraint is that the unit weight upper limit uu and unit weight lower limit ul can be written as n · ul ≦ x ≦ n · uu using a certain positive integer n. From Lemma 1, this is equivalent to satisfying the relationship x ≦ floor (x / ul) · uu. In algorithm 1, the determination is made using function 1. Since it is correctly checked whether the allocation amount is within the upper and lower limits of the order amount and whether the single weight constraint is satisfied, it can be seen that Algorithm 1 operates correctly.

[注文が二つの場合のアルゴリズム]
<アルゴリズム2(Oi,Oj,w)>
入力:注文Oi,Ojと引当可能な材料の重量w
if 関数1(Oi,rui)=引当可能、かつアルゴリズム1(Oj,w-rui)=引当可能 then
注文Oiに引当量rui、注文Ojに引当量w-ruiで引当可能と判定
else if 関数1(Oi,rli)=引当可能、かつアルゴリズム1(Oj,w-rli)=引当可能 then
注文Oiに引当量rli、注文Ojに引当量w-rliで引当可能と判定
else if 関数1(Oj,ruj)=引当可能、かつアルゴリズム1(Oi,w-ruj)=引当可能 then
注文Ojに引当量ruj、注文Oiに引当量w-rujで引当可能と判定
else if 関数1(Oj,rlj)=引当可能、かつアルゴリズム1(Oi,w-rlj)=引当可能 then
注文Ojに引当量rlj、注文Oiに引当量w-rljで引当可能と判定
else if 関数3(O1,O2,w,uu1)=引当可能、または関数3(O1,O2,w,ul1)=引当可能 then
関数3の判定結果を用いて引当可能と判定
else if 関数3(O2,O1,w,uu2)=引当可能、または関数3(O2,O1,w,ul2)=引当可能 then
関数3の判定結果を用いて引当可能と判定
else
余剰を無くす引当は不可能と判定
図4〜6にアルゴリズム2のフローチャートを示す。
[Algorithm when there are two orders]
<Algorithm 2 (O i , O j , w)>
Input: Order O i , O j and the weight of material available w
if function 1 (O i , ru i ) = allowable and algorithm 1 (O j , w-ru i ) = allowable then
Allowance amount ru i in order O i, provision can be a determination in the reserve amount w-ru i in order O j
else if function 1 (O i , rl i ) = can be allocated and algorithm 1 (O j , w-rl i ) = can be allocated then
It is determined that the allocation amount rl i can be allocated to the order O i and the allocation amount w-rl i can be allocated to the order O j.
else if function 1 (O j , ru j ) = allowable and algorithm 1 (O i , w-ru j ) = allowable then
Order O j is determined to be available with provision amount ru j and order O i is determined with provision amount w-ru j
else if function 1 (O j , rl j ) = can be allocated and algorithm 1 (O i , w-rl j ) = can be allocated then
Order O j is determined to be allocated with allocation amount rl j and order O i is allocated with allocation amount w-rl j
else if function 3 (O 1 , O 2 , w, uu 1 ) = can be allocated, or function 3 (O 1 , O 2 , w, ul 1 ) = can be allocated then
Judgment can be made using the judgment result of function 3
else if function 3 (O 2 , O 1 , w, uu 2 ) = can be allocated, or function 3 (O 2 , O 1 , w, ul 2 ) = can be allocated then
Judgment can be made using the judgment result of function 3
else
It is determined that it is not possible to reserve to eliminate the surplus. FIGS.

<関数3(Oa,Ob,w,ua)>
入力: 材料の重量wと、注文Oa,Ob、注文Oaの単重上下限の一方をua
xl=ceil(max{rla,w-rub}/ua)とおく
xu=floor(min{rua,w-rlb}/uaとおく
if xl>xu then
余剰を無くす引当は不可能と判定
else if ceil((w-xl・ua)/uub)≦floor((w-xl・ua)/ulb) then
注文Oaに引当量xl・ua、注文Obに引当量w-xl・uaで引当可能と判定
else if ceil((w-xu・ua)/uub)≦floor((w-xu・ua)/ulb) then
注文Oaに引当量xu・ua、注文Obに引当量w-xu・uaで引当可能と判定
else if 関数2(Oa,Ob,ua,ulb,w,xu,xl)=引当可能 then
関数2の引当を用いて引当可能と判定する
else if 関数2(Oa,Ob,ua,uub,w,xu,xl)=引当可能 then
関数2の引当を用いて引当可能と判定する
else
関数4(Oa,Ob,w,ua,xu,xl)の判定をそのまま返す
図14に関数3のフローチャートを示す。
<Function 3 (O a , O b , w, u a )>
Input: u a of material weight w and order O a , O b , order O a single weight upper and lower limit
x l = ceil (max {rl a , w-ru b } / u a )
x u = floor (min {ru a , w-rl b } / u a
if x l > x u then
Judgment that it is impossible to eliminate surplus
else if ceil ((wx l・ u a ) / uu b ) ≦ floor ((wx l・ u a ) / ul b ) then
It is determined that the order O a can be allocated with the allocation amount x l · u a and the order O b with the allocation amount wx l · u a
else if ceil ((wx u・ u a ) / uu b ) ≦ floor ((wx u・ u a ) / ul b ) then
It is determined that the order O a can be allocated with the allocation amount x u · u a and the order O b with the allocation amount wx u · u a
else if function 2 (O a , O b , u a , ul b , w, x u , x l ) = can be allocated then
Judge that allocation is possible using the allocation of function 2
else if function 2 (O a , O b , u a , uu b , w, x u , x l ) = can be allocated then
Judge that allocation is possible using the allocation of function 2
else
A flowchart of the function 3 is shown in FIG. 14 which returns the determination of the function 4 (O a , O b , w, u a , x u , x l ) as it is.

<関数4(Oa,Ob,w,ua,xu,xl)>
入力: 材料の重量wと、注文Oaの単重(上限もしくは下限)uaと、二分探索する範囲xl≦x≦xu
if xu-xl<2 then 余剰を無くす引当は不可能と判定
else
xp=floor((xl+xu)/2)とおく
if ceil((w-xp・ua)/uub)≦floor((w-xp・ua)/ulb) then
注文Oaに引当量xp・ua、注文Obに引当量w-xp・uaで引当可能と判定
else
kp=countT(ua,ulb,w-ua・xp)-countT(ua,uub,w-ua・xp)
ku=countT(ua,ulb,w-ua・xu)-countT(ua,uub,w-ua・xu)
kl=countT(ua,ulb,w-ua・xl)-countT(ua,uub,w-ua・xl)
if kp-ku>0 then 関数4(Oa,Ob,w,ua,xu,xp)の判定をそのまま返す
else if kl-kp>0 then 関数4(Oa,Ob,w,ua,xp,xl)の判定をそのまま返す
else
余剰を無くす引当は不可能と判定
図15に関数4のアルゴリズムのフローチャートを示す。
<Function 4 (O a , O b , w, u a , x u , x l )>
Input: Weight of material w, unit weight of order O a (upper or lower limit) u a and range to search binary x l ≤ x ≤ x u
if x u -x l <2 then
else
Let x p = floor ((x l + x u ) / 2)
if ceil ((wx p・ u a ) / uu b ) ≦ floor ((wx p・ u a ) / ul b ) then
It is determined that the order O a can be allocated with the provision amount x p · u a and the order O b with the provision amount wx p · u a
else
k p = countT (u a , ul b , wu a・ x p ) -countT (u a , uu b , wu a・ x p )
k u = countT (u a , ul b , wu a・ x u ) -countT (u a , uu b , wu a・ x u )
k l = countT (u a , ul b , wu a・ x l ) -countT (u a , uu b , wu a・ x l )
if k p -k u > 0 then return function 4 (O a , O b , w, u a , x u , x p )
else if k l -k p > 0 then return function 4 (O a , O b , w, u a , x p , x l )
else
FIG. 15 shows a flowchart of the algorithm of the function 4 in which it is impossible to allocate the surplus.

以下、注文が二つの場合のアルゴリズムについて説明する。補題2(後述)より、もし余剰を無くす引当が可能ならば、一つの引当を除いて他の全ての引当の引当量が、単重上下限いずれかの倍数、もしくは、引当量の上下限に一致するような引当をつくることができる。よって、一つの引当を除いて、残りの全ての引当の引当量は単重上下限いずれかの倍数、もしくは、引当量の上下限に一致する引当を求めることを考える。   Hereinafter, an algorithm in the case of two orders will be described. From Lemma 2 (discussed later), if it is possible to reserve to eliminate the surplus, the amount of provision for all other provisions, except for one, will be a multiple of the upper or lower limit of the unit weight, or the upper and lower limits of the provision amount You can make provisions that match. Therefore, except for one provision, the provision amount of all the remaining provisions is considered to be a multiple of one of the upper and lower limits of the unit weight, or to obtain an provision that matches the upper and lower limits of the provision amount.

アルゴリズム2では、まず、一つの引当が注文量の上下限の一方に一致するケースを処理する。一つの注文への引当量を注文量の上下限の一方に一致させると、他方の注文について余剰を無くす引当ができるかどうかは、アルゴリズム1を用いて判定できるからである。   In Algorithm 2, first, a case where one allocation matches one of the upper and lower limits of the order quantity is processed. This is because if the amount of provision for one order is matched with one of the upper and lower limits of the order amount, it can be determined using the algorithm 1 whether the provision for eliminating the surplus can be made for the other order.

次に、一つの引当が単重上下限の一方の倍数に一致するケースを処理する。二つの注文について、単重上下限それぞれについて調べるため、関数3を最大4(=2×2)回呼び出して全ての可能性を調べる。関数3は、注文Oaの引当量を単重uaの倍数に限定して、余剰を無くす引当ができるかどうかを判定する。 Next, the case where one allocation matches one multiple of the upper and lower unit weights is processed. In order to examine each of the upper and lower unit weights for the two orders, function 3 is called up to 4 (= 2 × 2) times to examine all possibilities. The function 3 determines whether or not the provision for eliminating the surplus can be made by limiting the provision amount of the order O a to a multiple of the single weight u a .

関数3では、まず、Oaの引当量の上下限を求めている。Oaに単重uaのx倍で引当てる場合、max{rla,w-rub}≦ua・x≦min{rua,w-rlb}を満たす必要がある(逆に、この不等式を満たせば、Obに引当量w-ua・xで引当てることができることにも注意)。これより、max{rla,w-rub}/ua≦x≦min{rua,w-rlb}/ua。xl=ceil(max{rla,w-rub}/ua),xu=floor(min{rua,w-rlb}/ua)とおくと、xl>xuのとき、上記不等式を満たす整数xは存在しないので、余剰を無くす引当はないと判断する。 In Function 3, first, the upper and lower limits of the reserve amount of O a are obtained. When allocating to O a by x times the unit weight u a , it is necessary to satisfy max {rl a , w-ru b } ≦ u a · x ≦ min {ru a , w-rl b } (inversely, satisfies the inequality, note also that can Hikiateru by O b in reserve amount wu a · x). From this, max {rl a , w-ru b } / u a ≦ x ≦ min {ru a , w-rl b } / u a . If x l = ceil (max {rl a , w-ru b } / u a ), x u = floor (min {ru a , w-rl b } / u a ), then x l > x u Since there is no integer x that satisfies the above inequality, it is determined that there is no provision for eliminating the surplus.

図22は、注文が二つのときの領域と格子点を表す図である。xl≦x≦xuを満たす整数xが存在するとき、余剰を無くす引当ができるのは、x-y平面上の四つの直線x=xl, x=xu, P:ua・x+ulb・y=w, Q:ua・x+uub・y=wに囲まれる領域(図22の領域ADFC)に(直線上を含め)格子点が存在することと同値である。(格子点(x′,y′)が存在すれば、Oaに引当量ua・x′,Obに引当量w-ua・x′で引当てることができる。)直線x=xlと直線ua・x+ulb・y=w, ua・x+uub・y=wとの交点は、それぞれ(xl,(w-ua・xl)/ulb), (xl,(w-ua・xl)/uub)なので、floor((w-ua・xl)/ulb)≧ceil((w-ua・xl)/uub)を満たすとき、直線x=xl上に格子点が存在する。このとき、注文Oaに引当量ua・xl、注文Obに引当量w-ua・xlで引当可能である。同様に、直線x=xu上に格子点があるかどうかも判定できる。 FIG. 22 is a diagram illustrating regions and grid points when there are two orders. When there is an integer x that satisfies x l ≤ x ≤ x u , the four straight lines on the xy plane x = x l , x = x u , P: u a・ x + ul b · y = w, Q: u a · x + uu This is equivalent to the existence of a grid point (including a straight line) in an area (area ADFC in FIG. 22) surrounded by b · y = w. (Lattice point (x ', y' if there is), O a a reserve amount u a · x ', the O b reserve amount wu a · x' can be Hikiateru in.) And the straight line x = x l The intersections of the straight lines u a・ x + ul b・ y = w, u a・ x + uu b・ y = w are (x l , (wu a・ x l ) / ul b ), (x l , (wu a・ x l ) / uu b ), so that when floor ((wu a・ x l ) / ul b ) ≧ ceil ((wu a・ x l ) / uu b ) is satisfied, on the straight line x = x l There are grid points. In this case, allowance amount u a · x l in order O a, it is possible provision in provision amount wu a · x l in order O b. Similarly, it can also be determined whether there is a grid point on the straight line x = x u .

次に、直線P:ua・x+ulb・y=w, 直線Q:ua・x+uub・y=w上に格子点があるかどうかを確認する。補題5より、正しく判定できていることがわかる。残るケースは、領域ADCF内に格子点があるかどうかを判別することである。関数4では、その判別を、領域を分割して二分探索することで実現している。 Next, it is confirmed whether or not there is a grid point on the straight line P: u a · x + ul b · y = w, and the straight line Q: u a · x + uu b · y = w. From Lemma 5, it can be seen that the correct decision was made. The remaining case is to determine whether there is a grid point in the region ADCF. In the function 4, the discrimination is realized by dividing the region and performing a binary search.

関数4では、まず、直線x=xlと直線x=xuの中間にある直線x=floor((xl+xu)/2)上に格子点があるかどうかを調べている。この直線上にも格子点がない場合、左右それぞれの領域(領域ADEBと領域BEFC)内の格子点の数を調べ、どちらか一方の領域に格子点が存在すれば、その領域について再帰的に関数4を適用することで格子点を探す。いずれの領域にも格子点が無い場合、余剰を無くす引当は不可能と判断する。 In the function 4, first, it is examined whether or not there is a lattice point on the straight line x = floor ((x l + x u ) / 2) between the straight line x = x l and the straight line x = x u . If there are no grid points on this straight line, check the number of grid points in each of the left and right areas (area ADEB and area BEFC), and if there is a grid point in either area, recursively for that area. A lattice point is searched by applying function 4. If there is no grid point in any region, it is determined that it is impossible to reserve to eliminate the surplus.

領域内の格子点の数は、補題6(後述)より、関数countTを用いて計算できる。例えば、領域ADEBについては、((△AGJ内の格子点の数)-(△DGJ内の格子点の数))-((△BHJ内の格子点の)-(△EHJ内の格子点の数))で計算できる。関数4では、これを利用して、格子点の数を求めている。   The number of grid points in the region can be calculated using the function countT from Lemma 6 (described later). For example, for the region ADEB, ((number of grid points in AGJ)-(number of grid points in DGJ))-((of grid points in BHJ)-(of grid points in ΔEHJ) Number)). In function 4, this is used to determine the number of grid points.

[注文が三つの場合のアルゴリズム]
<アルゴリズム3(Oi,Oj,Ok,w)>
入力:注文Oi,Oj,Okと引当可能な材料の重量w
if 関数1(Oi,rli)=引当可能、かつアルゴリズム2(Oj,Ok,w-rli)=引当可能 then
注文Oiに引当量rli、注文Oj,Okは、アルゴリズム2が出力した引当量で引当可能と判定
else if 関数1(Oj,rlj)=引当可能、かつアルゴリズム2(Oi,Ok,w-rlj)=引当可能 then
注文Ojに引当量rlj、注文Oi,Okは、アルゴリズム2が出力した引当量で引当可能と判定
else if 関数1(Ok,rlk)=引当可能、かつアルゴリズム2(Oi,Oj,w-rlk)=引当可能 then
注文Okに引当量rlk、注文Oi,Ojは、アルゴリズム2が出力した引当量で引当可能と判定
else if 関数1(Oi,rui)=引当可能、かつアルゴリズム2(Oj,Ok,w-rui)=引当可能 then
注文Oiに引当量rui、注文Oj,Okは、アルゴリズム2が出力した引当量で引当可能と判定
else if 関数1(Oj,ruj)=引当可能、かつアルゴリズム2(Oi,Ok,w-ruj)=引当可能 then
注文Ojに引当量ruj、注文Oi,Okは、アルゴリズム2が出力した引当量で引当可能と判定
else if 関数1(Ok,ruk)=引当可能、かつアルゴリズム2(Oi,Oj,w-ruk)=引当可能 then
注文Okに引当量ruk、注文Oi,Ojは、アルゴリズム2が出力した引当量で引当可能と判定
else if 関数5(Oi,Oj,Ok,w,uui,uuj)=引当可能、または関数5(Oi,Oj,Ok,w,uli,uuj)=引当可能 then
関数5の判定結果を用いて引当可能と判定
else if 関数5(Oi,Oj,Ok,w,uui,ulj)=引当可能、または関数5(Oi,Oj,Ok,w,uli,ulj)=引当可能 then
関数5の判定結果を用いて引当可能と判定
else if 関数5(Oj,Ok,Oi,w,uuj,uuk)=引当可能、または関数5(Oj,Ok,Oi,w,ulj,uuk)=引当可能 then
関数5の判定結果を用いて引当可能と判定
else if 関数5(Oj,Ok,Oi,w,uuj,ulk)=引当可能、または関数5(Oj,Ok,Oi,w,ulj,ulk)=引当可能 then
関数5の判定結果を用いて引当可能と判定
else if 関数5(Ok,Oi,Oj,w,uuk,uui)=引当可能、または関数5(Ok,Oi,Oj,w,ulj,uuk)=引当可能 then
関数5の判定結果を用いて引当可能と判定
else if 関数5(Ok,Oi,Oj,w,uuk,uli)=引当可能、または関数5(Ok,Oi,Oj,w,ulj,ulk)=引当可能 then
関数5の判定結果を用いて引当可能と判定
else
余剰を無くす引当は不可能と判定
図7〜10にアルゴリズム3のフローチャートを示す。
[Algorithm when there are three orders]
<Algorithm 3 (O i , O j , O k , w)>
Input: Order O i , O j , O k and the weight of material available w
if function 1 (O i , rl i ) = allowable and algorithm 2 (O j , O k , w-rl i ) = allowable then
It is determined that the allocation amount rl i and the orders O j and O k can be allocated to the order O i with the allocation amount output by the algorithm 2.
else if function 1 (O j , rl j ) = can be allocated and algorithm 2 (O i , O k , w-rl j ) = can be allocated then
It is determined that the allocation amount rl j and the orders O i and O k can be allocated to the order O j with the allocation amount output by the algorithm 2.
else if function 1 (O k , rl k ) = can be allocated and algorithm 2 (O i , O j , w-rl k ) = can be allocated then
Order O k in reserve amount rl k, the order O i, O j is possible provision in provision amount Algorithm 2 has output determination
else if function 1 (O i , ru i ) = can be allocated and algorithm 2 (O j , O k , w-ru i ) = can be allocated then
It is determined that the allocation amount ru i and the order O j and O k can be allocated to the order O i with the allocation amount output by the algorithm 2.
else if function 1 (O j , ru j ) = can be allocated and algorithm 2 (O i , O k , w-ru j ) = can be allocated then
It is determined that the provision amount ru j and the order O i , Ok are available for the order O j with the provision amount output by the algorithm 2.
else if function 1 (O k , ru k ) = allowable and algorithm 2 (O i , O j , w-ru k ) = allowable then
Order O k in reserve amount ru k, the order O i, O j is possible provision in provision amount Algorithm 2 has output determination
else if function 5 (O i , O j , O k , w, uu i , uu j ) = can be allocated, or function 5 (O i , O j , O k , w, ul i , uu j ) = can be allocated then
Judgment that allocation is possible using judgment result of function 5
else if function 5 (O i , O j , O k , w, uu i , ul j ) = can be allocated, or function 5 (O i , O j , O k , w, ul i , ul j ) = can be allocated then
Judgment that allocation is possible using judgment result of function 5
else if function 5 (O j , O k , O i , w, uu j , uu k ) = can be allocated, or function 5 (O j , O k , O i , w, ul j , uu k ) = can be allocated then
Judgment that allocation is possible using judgment result of function 5
else if function 5 (O j , O k , O i , w, uu j , ul k ) = can be allocated, or function 5 (O j , O k , O i , w, ul j , ul k ) = can be allocated then
Judgment that allocation is possible using judgment result of function 5
else if function 5 (O k , O i , O j , w, uu k , uu i ) = can be allocated, or function 5 (O k , O i , O j , w, ul j , uu k ) = can be allocated then
Judgment that allocation is possible using judgment result of function 5
else if function 5 (O k , O i , O j , w, uu k , ul i ) = can be allocated, or function 5 (O k , O i , O j , w, ul j , ul k ) = can be allocated then
Judgment that allocation is possible using judgment result of function 5
else
Determining that it is impossible to allocate the surplus, FIGS.

<関数5(Oa,Ob,Oc,w,ua,ub)>
入力: 材料の重量wと、注文Oaの単重(上限もしくは下限)uaと、注文Obの単重(上限もしくは下限)ub
xl=ceil(rla/ua), xu=floor(rua/ua)とおく
if xl>xu then 余剰を無くす引当は不可能と判定する
else
yl=ceil(rlb/ub), yu=floor(rub/ub)とおく
if yl>yu then 余剰を無くす引当は不可能と判定する
else if 関数1(Oc,w-xl・ua-yl・ub)=引当可能 then
Oaに引当量xl・ua, Obに引当量yl・ub, Ocに引当量w-xl・ua-yl・ubで引当可能と判定する
else if 関数1(Oc,w-xl・ua-yu・ub)=引当可能 then
Oaに引当量xl・ua, Obに引当量yu・ub, Ocに引当量w-xl・ua-yl・ubで引当可能と判定する
else if 関数1(Oc,w-xu・ua-yl・ub)=引当可能 then
Oaに引当量xu・ua, Obに引当量yl・ub, Ocに引当量w-xu・ua-yl・ubで引当可能と判定する
else if 関数1(Oc,w-xu・ua-yu・ub)=引当可能 then
Oaに引当量xu・ua, Obに引当量yu・ub, Ocに引当量w-xu・ua-yu・ubで引当可能と判定する
else
zl=ceil(rlc/ulc), zu=floor(ruc/ulc)とおく
z=zlとおく
while z≦zu
su=min{floor((w-z・uuc-yl・ub)/ua),xu}とおく
sl=max{ceil((w-z・uuc-yu・ub)/ua),xl}とおく
if 関数2(Oa,Ob,ua,ub,w-z・uuc,su,sl)=引当可能 then
注文Oa,Obに関数2の引当量を用いて引当、注文Ocに引当量w-z・uucで引当可能と判定する
else
tx=max{floor((w-z・ulc-yu・ub)/ua),xl-1}とおく
if sl≦tx then
注文Oaに注文量tx・ua、注文Obに注文量yu・ub、注文Ocにw-tx・ua-yu・ubで引当可能と判定する
else
ty=max{floor((w-z・uuc-xu・ua)/ub),yl-1}とおく
if su=xu、かつ(w-uuc・z-xu・ua)/ub≦ty then
注文Oaに注文量xu・ua、注文Obに注文量ty・ub、注文Ocにw-xu・ua-ty・ubで引当可能と判定する
else if 関数6(Oa,Ob,Oc,w,ua,ub,uuc・z,ulc・z)=引当可能 then
関数6の判定をそのまま返す
else
z=z+1
while end
図16〜19に関数5のアルゴリズムのフローチャートを示す。
<Function 5 (O a , O b , O c , w, u a , u b )>
Input: material weight w, order O a unit weight (upper or lower limit) u a and order O b unit weight (upper or lower limit) u b
x l = ceil (rl a / u a ), x u = floor (ru a / u a )
if x l > x u then Judge that it is impossible to reserve to eliminate surplus
else
y l = ceil (rl b / u b), placing a y u = floor (ru b / u b)
if y l > y u then it is determined that it is not possible to allocate the surplus
else if function 1 (O c , wx l・ u a -y l・ u b ) = Allowable then
O a a reserve amount x l · u a, O b in reserve amount y l · u b, the O c enabling provision in provision amount wx l · u a -y l · u b determines
else if function 1 (O c , wx l・ u a -y u・ u b ) = Allowable then
O a a reserve amount x l · u a, O b in reserve amount y u · u b, the O c enabling provision in provision amount wx l · u a -y l · u b determines
else if function 1 (O c , wx u・ u a -y l・ u b ) = Allowable then
O a a reserve amount x u · u a, O b in reserve amount y l · u b, the O c enabling provision in provision amount wx u · u a -y l · u b determines
else if function 1 (O c , wx u・ u a -y u・ u b ) = Allowable then
O a reserve x u・ u a , O b reserve y u・ u b , O c reserve wx u・ u a -y u・ u b
else
z l = ceil (rl c / ul c ), z u = floor (ru c / ul c )
z = z l
while z ≦ z u
s u = min {floor ((wz ・ uu c -y l・ u b ) / u a ), x u }
s l = max {ceil ((wz ・ uu c -y u・ u b ) / u a ), x l }
if function 2 (O a , O b , u a , u b , wz · uu c , s u , s l ) = can be allocated then
The order O a and O b are allocated using the allocation amount of the function 2, and the order O c is determined to be allocated with the allocation amount wz · uu c.
else
t x = max {floor ((wz ・ ul c -y u・ u b ) / u a ), x l -1}
if s l ≤t x then
Order O a in order amount t x · u a, orders O b in order quantity y u · u b, and can reserve the order O c in wt x · u a -y u · u b determines
else
t y = max {floor ((wz ・ uu c -x u・ u a ) / u b ), y l -1}
if s u = x u and (w-uu c・ zx u・ u a ) / u b ≦ t y then
Order O a in order quantity x u · u a, orders O b in order amount t y · u b, determines the possible provision to apply O c in wx u · u a -t y · u b
else if function 6 (O a , O b , O c , w, u a , u b , uu c・ z, ul c・ z) = Allowable then
Return the judgment of function 6 as it is
else
z = z + 1
while end
16 to 19 show flowcharts of the algorithm of the function 5.

<関数6(Oa,Ob,Oc,w,ua,ub,ru,rl)>
入力: 材料の重量wと、注文Oaの単重(上限もしくは下限)uaと、注文Obの単重(上限もしくは下限)ubと、Ocの引当量の上限ruと下限rl
rp=floor((ru+rl)/2)とおく
su=min{floor((w-rp-yl・ub)/ua),xu}とおく
sl=max{ceil((w-rp-yu・ub)/ua),xl}とおく
if rpがdで割り切れる、かつ関数2(Oa,Ob,ua,ub,w-rp,su,sl)=引当可能 then
注文Oa,Obに関数2の引当量を用いて引当、注文Ocに引当量w-rpで引当可能と判定する
else
kp=countT(ua,ub,w-rp-xl・ua-yl・ub)-countT(ua,ub,w-rp-xu・ua-yl・ub)-countT(ua,ub,
w-rp-xl・ua-yu・ub)
ku=countT(ua,ub,w-ru-xl・ua-yl・ub)-countT(ua,ub,w-ru-xu・ua-yl・ub)-countT(ua,ub,
w-ru-xl・ua-yu・ub)
kl=countT(ua,ub,w-rl-xl・ua-yl・ub)-countT(ua,ub,w-rl-xu・ua-yl・ub)-countT(ua,ub,
w-rl-xl・ua-yu・ub)
if kp-ku>0 then
関数6(Oa,Ob,Oc,w,ua,ub,rp,ru)の判定をそのまま返す
else if kl-kp>0 then
関数6(Oa,Ob,Oc,w,ua,ub,rl,rp)の判定をそのまま返す
else
余剰を無くす引当は不可能と判定
図20〜21に関数6のアルゴリズムのフローチャートを示す。
<Function 6 (O a , O b , O c , w, u a , u b , r u , r l )>
Input: Material weight w, Order O a unit weight (upper or lower limit) u a , Order O b unit weight (upper or lower limit) u b , O c allowance upper limit r u and lower limit r l
r p = floor ((r u + r l ) / 2)
s u = min {floor ((wr p -y l・ u b ) / u a ), x u }
s l = max {ceil ((wr p -y u・ u b ) / u a ), x l }
if r p is divisible by d, and function 2 (O a , O b , u a , u b , wr p , s u , s l ) = can be allocated then
Order O a, O b provision with provision of function 2 determines that allow provision in provision amount wr p in order O c
else
k p = countT (u a , u b , wr p -x l・ u a -y l・ u b ) -countT (u a , u b , wr p -x u・ u a -y l・ u b ) -countT (u a , u b ,
wr p -x l・ u a -y u・ u b )
k u = countT (u a , u b , wr u -x l・ u a -y l・ u b ) -countT (u a , u b , wr u -x u・ u a -y l・ u b ) -countT (u a , u b ,
wr u -x l・ u a -y u・ u b )
k l = countT (u a , u b , wr l -x l・ u a -y l・ u b ) -countT (u a , u b , wr l -x u・ u a -y l・ u b ) -countT (u a , u b ,
wr l -x l・ u a -y u・ u b )
if k p -k u > 0 then
Returns the judgment of function 6 (O a , O b , O c , w, u a , u b , r p , r u ) as it is
else if k l -k p > 0 then
Returns the judgment of function 6 (O a , O b , O c , w, u a , u b , r l , r p ) as it is
else
Determining that it is not possible to allocate the surplus, FIGS. 20 to 21 show flowcharts of the algorithm of the function 6.

以下、注文が三つの場合のアルゴリズムについて説明する。注文が二つのときと同様、補題2より、もし余剰を無くす引当が可能ならば、一つの引当を除いて他の全ての引当の引当量が、単重上下限いずれかの倍数、もしくは、引当量の上下限に一致するような引当をつくることができる。よって、一つの引当を除いて、残りの全ての引当の引当量は単重上下限いずれかの倍数、もしくは、引当量の上下限に一致する引当を求めることを考える。   Hereinafter, an algorithm in the case of three orders will be described. As in the case of two orders, from Lemma 2, if the allowance to eliminate the surplus is possible, the provision amount of all other provisions, except for one provision, is either a multiple of the upper or lower unit weight or the provision Provisions can be made to match the volume limits. Therefore, except for one provision, the provision amount of all the remaining provisions is considered to be a multiple of one of the upper and lower limits of the unit weight, or to obtain an provision that matches the upper and lower limits of the provision amount.

アルゴリズム3では、まず、少なくとも一つの引当が注文量の上下限の一方に一致するケースを処理する。一つの注文への引当量を注文量の上下限の一方に一致させると、残りの注文について余剰を無くす引当ができるかどうかは、アルゴリズム2を用いて判定できるからである。   In Algorithm 3, first, a case where at least one allocation matches one of the upper and lower limits of the order quantity is processed. This is because if the amount of provision for one order is matched with one of the upper and lower limits of the order amount, it can be determined using the algorithm 2 whether or not provision for eliminating the surplus can be made for the remaining orders.

次に、二つの引当が単重上下限の一方の倍数に一致するケースを処理する。引当量を単重上下限の倍数に一致させない注文の選び方が3通りで、二つの注文について、単重上下限それぞれについて調べるため、関数5を最大12(=3×2×2)回呼び出して全ての可能性を調べる。関数5は、注文Oaの引当量を単重uaの倍数、注文Obの引当量を単重ubの倍数に限定して、余剰を無くす引当ができるかどうかを判定する。 Next, the case where the two allocations match one multiple of the upper and lower unit weights is handled. There are three ways to select orders that do not match the multiple of the single weight upper and lower limits. In order to examine each of the single weight upper and lower limits for two orders, function 5 is called a maximum of 12 (= 3 × 2 × 2) times. Examine all possibilities. Function 5 determines whether the provision of order O a multiple of unit weight u a, by limiting the provision of order O b a multiple of unit weight u b, eliminating the surplus reserve can.

関数5では、まず、注文Oaへの引当量をx・ua、注文Obへの引当量をy・ubとしたとき、x,y(ともに整数)の上下限xl≦x≦,yl≦y≦yuを求めている。次に、注文Oaへの引当量をそれぞれxl・ua,xu・uaにしたときと、注文Obへの引当量をそれぞれyl・ub,yu・ubにしたときの4通りについて、余剰を無くすことができるかどうかを関数1を利用して判定している。 In function 5, firstly, provision amount x · u a to order O a, when the provision of the order O b was y · u b, x, y ( both integers) lower x l ≦ x ≦ on the , seeking y l ≦ y ≦ y u. Next, when the amount of provision for order O a is set to x l · u a and x u · u a respectively, the amount of provision for order O b is set to y l · u b and yu · u b It is determined using function 1 whether the surplus can be eliminated for the four ways.

そして、整数zを用いて、注文Ocへの引当量をz・ulc以上z・uuc以下の範囲に限定したとき、余剰を無くす引当ができるかどうかについてチェックしている(整数zを、いろいろな値に変更して、全ての場合を網羅している)。図23は、注文が三つのときの領域と格子点を表す図である。余剰を無くす引当ができるとき、図23の領域BDFGECの内部(辺上を含む)に格子点が存在する。領域内に格子点があるかどうかは、関数6で判定している。 Then, using the integer z, it is checked whether or not the allocation to the order O c is limited to the range of z · ul c to z · uu c (the integer z And change to different values to cover all cases). FIG. 23 is a diagram illustrating regions and grid points when there are three orders. When it is possible to reserve to eliminate the surplus, there are lattice points in the area BDFGEC (including on the side) in FIG. Whether or not there is a grid point in the region is determined by function 6.

関数6で行っていることは、注文が二つの場合と同様、格子点の数を数えるアルゴリズムと二分探索を組み合わせである。二分探索時、半分に分ける方法が、直線Pと直線Qに平行な直線に変わっていることを除けば、おおむね関数4と同様の判定をしているだけなので、詳細な説明は省略する。   What function 6 does is a combination of an algorithm for counting the number of grid points and a binary search, as in the case of two orders. In the binary search, except for the fact that the method of dividing in half is changed to a straight line parallel to the straight line P and the straight line Q, the determination is almost the same as that of the function 4, and the detailed description is omitted.

ここでは、前述アルゴリズムの説明で使用した補題について説明する。   Here, the lemma used in the description of the algorithm will be described.

[補題1]
実数x>0, b≧a>0について、an≦x≦bnを満たす自然数nが存在することは、x≦floor(x/a)・bが成り立つことと同値である。
(証明)
an≦x≦bnを満たす自然数nが存在するとき、an≦xよりn≦x/a。
nは自然数なので、n≦floor(x/a)もまた成り立つ。x≦bnより、x≦floor(x/a)・b。
次に、x≦floor(x/a)・bが成り立つとする。n=floor(x/a)とおくと、an≦a・floor(x/a)≦a・x/a≦x。また、bn≧b・floor(x/a)≧x(最後の不等式は仮定より)。よって、an≦x≦bnが成り立つ。
(証明終)
[Lemma 1]
For a real number x> 0, b ≧ a> 0, the existence of a natural number n satisfying an ≦ x ≦ bn is equivalent to x ≦ floor (x / a) · b.
(Proof)
When there is a natural number n satisfying an ≦ x ≦ bn, n ≦ x / a from an ≦ x.
Since n is a natural number, n ≦ floor (x / a) also holds. From x ≦ bn, x ≦ floor (x / a) · b.
Next, suppose that x ≦ floor (x / a) · b holds. If n = floor (x / a), an ≦ a · floor (x / a) ≦ a · x / a ≦ x. Bn ≧ b · floor (x / a) ≧ x (the last inequality is assumed). Therefore, an ≦ x ≦ bn holds.
(End of proof)

[補題2]
各注文Oiについて、引当量をpiとすると、単重制約を満たしかつ引当量上下限の範囲内にあるとする。このとき、一つの引当を除いて、他の引当の引当量が全て、単重(上限あるいは下限)の整数倍、もしくは、引当量上下限のいずれかと一致するような引当量p′iを求めることができる。
(証明)
二つの引当がともに、単重上下限の整数倍にも引当量上下限にも一致しないとき、この二つ以外の引当の引当量を変化させずに、二つの引当のうち一つを単重の整数倍あるいは引当量上下限に一致させることができることを示す。この操作を繰り返すことによって、所望の引当が得られることは、容易にわかる。
p1,p2が、単重の整数倍にも引当量上下限にも一致しないとする。ここで、
d1=min{ceil(p1/b1)・b1, floor(p1/a1)・a1,u1-p1-p1-l1},
d2=min{ceil(p2/b2)・b2, floor(p2/a2)・a2,u2-p2,p2-l2}
とおく。d1>0, d2>0であることに注意されたい。
このとき、d1<d2ならば、(p′1,p′2)=(p1-d1,p2+d1)あるいは(p′1,p′2)=(p1+d1,p2-d1)とすると、p′1が単重の整数倍あるいは引当量上下限に一致する。d1≧d2ならば、(p′1,p′2)=(p1-d2,p2+d2)あるいは(p′1,p′2)=(p1+d2,p2-d2)とすると、p′2が単重の整数倍あるいは引当量上下限に一致する。また、いずれの場合も(p′1,p′2)が単重制限・引当量上下限内にあることは容易に確認できる。
(証明終)
[Lemma 2]
For each order O i , assuming that the amount of provision is p i , it is assumed that the single weight constraint is satisfied and that the amount is within the upper and lower limits of the amount of provision. At this time, except for one provision, the provision amount p ′ i is obtained such that all the provision amounts of the other provisions coincide with either the integral multiple of the unit weight (upper limit or lower limit) or the upper and lower limits of the provision amount. be able to.
(Proof)
When both of the two provisions do not match an integer multiple of the upper and lower limits of the unit weight or the upper and lower limits of the provision amount, one of the two provisions is changed to the single weight without changing the provision amount of the other provisions. It is shown that it can be made to be an integral multiple of or an upper and lower limit of the provision amount. It can be easily understood that a desired allocation can be obtained by repeating this operation.
Suppose that p 1 and p 2 do not match an integer multiple of unit weight or the upper and lower limits of the provision amount. here,
d 1 = min {ceil (p 1 / b 1 ) ・ b 1 , floor (p 1 / a 1 ) ・ a 1 , u 1 -p 1 -p 1 -l 1 },
d 2 = min {ceil (p 2 / b 2 ) ・ b 2 , floor (p 2 / a 2 ) ・ a 2 , u 2 -p 2 , p 2 -l 2 }
far. Note that d 1 > 0, d 2 > 0.
If d 1 <d 2 then (p ′ 1 , p ′ 2 ) = (p 1 -d 1 , p 2 + d 1 ) or (p ′ 1 , p ′ 2 ) = (p 1 + d 1 , p 2 -d 1 ), p ′ 1 matches an integer multiple of the unit weight or the upper and lower limits of the provision amount. If d 1 ≧ d 2 , (p ′ 1 , p ′ 2 ) = (p 1 -d 2 , p 2 + d 2 ) or (p ′ 1 , p ′ 2 ) = (p 1 + d 2 , p 2 -d 2 ), p ′ 2 is equal to an integral multiple of the unit weight or the upper and lower limits of the provision amount. In either case, it can be easily confirmed that (p ′ 1 , p ′ 2 ) is within the upper limit and lower limit of the unit weight limit / allocation amount.
(End of proof)

[補題3]
整数a,bの最大公約数をd=GCD(a,b)とする。このとき、ax+by=cが解をもつための必要十分条件は、cがdで割り切れることである。解が存在する場合、解の一組を(x,y)=(x0,y0)とすれば、他の任意の解は、以下の式で一般的に与えられる。
x=x0+(b/d)k, y=y0-(a/d)k
(証明)
前半は、ほぼ自明。aとbはdで割り切れるから、ax+byもdで割り切れる。よって、cはdで割り切れる必要がある。
後半については、まず、a′=a/d, b′=b/dとおく。a′x+b′y=c/d, a′x0+b′y0=c/dが成り立つから、a′(x-x0)+b′(y-y0)=0。a′,b′は互いに素なので、整数kを用いてa′(x-x0)=-b′(y-y0)=a′・b′・kと表せる。よって、x=x0+b′・k, y=y0-a′・k。
(証明終)
[Lemma 3]
Let d = GCD (a, b) be the greatest common divisor of integers a and b. At this time, a necessary and sufficient condition for ax + by = c to have a solution is that c is divisible by d. If a solution exists, if another set of solutions is (x, y) = (x 0 , y 0 ), another arbitrary solution is generally given by the following equation.
x = x 0 + (b / d) k, y = y 0- (a / d) k
(Proof)
The first half is almost self-explanatory. Since a and b are divisible by d, ax + by is also divisible by d. Therefore, c must be divisible by d.
In the second half, first, a ′ = a / d and b ′ = b / d. Since a′x + b′y = c / d and a′x 0 + b′y 0 = c / d, a ′ (xx 0 ) + b ′ (yy 0 ) = 0. Since a ′ and b ′ are relatively prime, they can be expressed as a ′ (xx 0 ) = − b ′ (yy 0 ) = a ′ · b ′ · k using the integer k. Therefore, x = x 0 + b ′ · k, y = y 0 −a ′ · k.
(End of proof)

[補題4]
正の整数a,bに対してa,bの最大公約数d=GCD(a,b)を求めると同時に、ax+by=dを満たす整数x,yの組x=x0, y=y0を一組求めるアルゴリズムが存在する(拡張ユークリッド互除法)。計算量は、通常のユークリッドの互除法と同程度で、O(max{log a,log b})。
[Lemma 4]
Find the greatest common divisor d = GCD (a, b) of a and b for positive integers a and b, and at the same time, set x = x 0 , y = y of integer x and y satisfying ax + by = d There is an algorithm for finding a set of 0 (extended Euclidean algorithm). The amount of calculation is the same as the normal Euclidean algorithm, O (max {log a, log b}).

[補題5]
a,b,cは正の整数とする。直線ax+by=c上に格子点(x′,y′)が存在し、かつ、xl≦x′≦xuの関係が満たされていることは、以下の条件(1)と(2)が共に成り立つことと同値である。ただし、a,bの最大公約数をdとする。
(1) cがdで割り切れる
(2) ceil((xl-c/d・x0)(d/b))≦floor((xu-c/d・x0)(d/b)
(証明)
補題4より、拡張ユークリッド互除法を用いて、a,bの最大公約数dと、ax0+by0=dを満たす整数x0,y0の組を求めることができる。aとbはdで割り切れるから、ax+byもdで割り切れる。よって、cはdで割り切れる必要がある((1)が成り立つ)。x=(c/d)x0,y=(c/d)y0は、ax+by=cを満たすから、補題3より、x′=(c/d)x0+(b/d)kと表せる。xl≦x′≦xuであるためには、(xl-(c/d)x0)(d/b)≦k≦(xu-(c/d)x0)(d/b)を満たす整数kが必要である。これより、(2)が成り立つ必要があることがわかる。逆に、(1)と(2)が成り立てば、格子点(x′,y′)が見つけられることは、容易に分かる。
(証明終)
[Lemma 5]
a, b, and c are positive integers. The fact that the lattice point (x ′, y ′) exists on the straight line ax + by = c and the relationship of x l ≦ x ′ ≦ x u is satisfied is that the following conditions (1) and (2 ) Is equivalent to both. Where d is the greatest common divisor of a and b.
(1) c is divisible by d
(2) ceil ((x l -c / d ・ x 0 ) (d / b)) ≦ floor ((x u -c / d ・ x 0 ) (d / b)
(Proof)
From Lemma 4, the extended Euclidean algorithm can be used to obtain a set of integers x 0 and y 0 satisfying the greatest common divisor d of a and b and ax 0 + by 0 = d. Since a and b are divisible by d, ax + by is also divisible by d. Therefore, c must be divisible by d ((1) holds). Since x = (c / d) x 0 , y = (c / d) y 0 satisfies ax + by = c, from Lemma 3, x ′ = (c / d) x 0 + (b / d) It can be expressed as k. In order to satisfy x l ≦ x ′ ≦ x u , (x l − (c / d) x 0 ) (d / b) ≦ k ≦ (x u − (c / d) x 0 ) (d / b An integer k that satisfies) is required. This shows that (2) needs to hold. Conversely, if (1) and (2) hold, it can be easily understood that the lattice point (x ′, y ′) can be found.
(End of proof)

[補題6]
a,bを互いに素な正の整数とする。領域T(a,b,c)={(x,y)∈R2|ax+by≦c, x>0, y>0}に含まれる格子点の数をN(a,b,c)とおく。ここで、R2は2次のユークリッド空間を表す。N(a,b,c)は、O(max{log a,log b})時間で計算できる。
[Lemma 6]
Let a and b be relatively prime positive integers. The number of lattice points contained in the region T (a, b, c) = {(x, y) ∈R 2 │ax + by ≦ c, x> 0, y> 0} is N (a, b, c) far. Here, R 2 represents a secondary Euclidean space. N (a, b, c) can be calculated in O (max {log a, log b}) time.

(証明)
p=floor(c/a), q=(c-ap)/bとおく。p=0のとき、明らかにN(a,b,c)=0なので、p>0とする。
三角形T(a,b,c)の面積を、N(a,b,c)を用いて表すことを考える。T(a,b,c)内にある、一辺の長さが1の正方形の数は、N(a,b,c)に等しい。よって、残りの領域について、複数の台形と一つの三角形に分割することを考える(数3を参照)。各0<j≦pについて、台形Sjを以下のように定義する。実数xについて、{x}はx-floor(x)で定義する。
(Proof)
Let p = floor (c / a) and q = (c-ap) / b. When p = 0, clearly N (a, b, c) = 0, so p> 0.
Consider representing the area of a triangle T (a, b, c) using N (a, b, c). The number of squares with a side length of 1 in T (a, b, c) is equal to N (a, b, c). Therefore, consider dividing the remaining region into a plurality of trapezoids and one triangle (see Equation 3). For each 0 <j ≦ p, the trapezoid S j is defined as follows. For real number x, {x} is defined by x-floor (x).

Sj={(x,y)∈R2|ax+by≦c, j-1≦x≦j, y≧floor((c-aj)/b)}
次に、三角形Rを以下のように定義する。
R={(x,y)∈R2|ax+by≦c, p≦x, y≧0}
このとき、三角形T(a,b,c)の面積は以下のように表せる。

Figure 0004636609
S j = {(x, y) ∈R 2 | ax + by ≦ c, j-1 ≦ x ≦ j, y ≧ floor ((c-aj) / b)}
Next, the triangle R is defined as follows.
R = {(x, y) ∈R 2 | ax + by ≦ c, p ≦ x, y ≧ 0}
At this time, the area of the triangle T (a, b, c) can be expressed as follows.
Figure 0004636609

|T(a,b,c)|=c2/(2ab)、|R|=q(c/a-p)/2が成り立つので、以下の関係が導ける。

Figure 0004636609
Figure 0004636609
Since | T (a, b, c) | = c 2 / (2ab) and | R | = q (c / ap) / 2 hold, the following relationship can be derived.
Figure 0004636609
Figure 0004636609

次に、台形Sjの面積について考える。台形Sjの面積|Sj|は、以下のように表せる。

Figure 0004636609
Next, consider the area of the trapezoid S j . The area | S j | of the trapezoid S j can be expressed as follows.
Figure 0004636609

よって、N(a,b,c)は以下のように表せる。

Figure 0004636609
Therefore, N (a, b, c) can be expressed as follows.
Figure 0004636609

二番目の等式は、q=(c-ap)/bの関係から成り立つ。ここで、N(a,b,c)=N(b,a,c)が成り立つので、一般性を失わずにa≧bとする。また、a=bの場合、N(a,b,c)=floor(c/a)(floor(c/a)-1)/2であることは、容易に示せる。よって、a>bの場合について考えれば良い。aがbで割り切れる場合、k=a/b-1、そうでない場合、k=floor(a/b)とおく。c′=c-b(kp+floor(q))とおくと、直線(a-bk)x+by=c′は二点(0,c′/b)と(p,{q})を通る。これより、N(a-bk,b,c′)は以下のように表せる。

Figure 0004636609
The second equation consists of the relationship q = (c-ap) / b. Here, since N (a, b, c) = N (b, a, c) holds, it is assumed that a ≧ b without losing generality. Further, when a = b, it can be easily shown that N (a, b, c) = floor (c / a) (floor (c / a) -1) / 2. Therefore, the case of a> b may be considered. If a is divisible by b, k = a / b-1, otherwise k = floor (a / b). If c ′ = cb (kp + floor (q)), the straight line (a-bk) x + by = c ′ passes through two points (0, c ′ / b) and (p, {q}). From this, N (a-bk, b, c ′) can be expressed as follows.
Figure 0004636609

整理して、

Figure 0004636609
Organize
Figure 0004636609

よって、N(a,b,c)は、以下のアルゴリズムで計算可能。
Algorithm calc(a,b,c)
a,b,c は a≧bとなる正の整数
begin
if (a mod b)=0 then k:=a/b-1; else k:=floor(a/b);
p:=floor(c/a);
q:=floor((c-ap)/b);
if p=0 then
return 0;
else if a=b then
return p(p-1)/2;
else
return calc(b,a-bk,c-b(kp+q))+kp(p-1)/2+pq;
endif
end
Therefore, N (a, b, c) can be calculated with the following algorithm.
Algorithm calc (a, b, c)
a, b, c is a positive integer such that a ≧ b
begin
if (a mod b) = 0 then k: = a / b-1; else k: = floor (a / b);
p: = floor (c / a);
q: = floor ((c-ap) / b);
if p = 0 then
return 0;
else if a = b then
return p (p-1) / 2;
else
return calc (b, a-bk, cb (kp + q)) + kp (p-1) / 2 + pq;
endif
end

アルゴリズムcalcの計算時間は、calcの再帰呼び出し回数に比例する。calcの再帰呼び出し回数は、aとbにユークリッドの互除法を適用したときの再帰呼び出し回数に等しいので、アルゴリズムcalcの計算時間は、O(max{log a,log b})。
(証明終)
The calculation time of the algorithm calc is proportional to the number of recursive calls of calc. Since the number of recursive calls of calc is equal to the number of recursive calls when Euclidean algorithm is applied to a and b, the calculation time of the algorithm calc is O (max {log a, log b}).
(End of proof)

以下、上記述べた計算方法の具体的実施例を示す。   Hereinafter, specific examples of the calculation method described above will be shown.

実施例1:注文量10.0t(許容範囲8.0t〜12.0t)、単重制限4.5t〜5.5tの注文と10.0tの材料が与えられたとき、アルゴリズム1を適用すると10.0tの材料が引当可能であると判定される。   Example 1: When order quantity 10.0t (acceptable range 8.0t-12.0t), single weight limit 4.5t-5.5t order and 10.0t material are given, algorithm 1 is applied It is determined that 10.0 t of material can be allocated.

実施例2:注文量10.0t(許容範囲8.0t〜12.0t)、単重制限4.5t〜5.5tの注文と8.0tの材料が与えられたとき、アルゴリズム1を適用すると、関数1で、8.0≦floor(8.0/4.5)*5.5の関係が満たされないので、8.0tの材料を余剰無く引当てることは不可能と判定される。   Example 2: When order 10.0t (allowable range 8.0t to 12.0t), single weight limit 4.5t to 5.5t and 8.0t material are given, algorithm 1 is applied Since the relationship of 8.0 ≦ floor (8.0 / 4.5) * 5.5 is not satisfied in the function 1, it is determined that it is impossible to allocate 8.0 t of material without surplus.

実施例3:注文量9.0t(許容範囲1.45t〜10.0t)、単重制限1.45t〜1.55tの注文Aと注文量3.0t(許容範囲2.5t〜3.5t)、単重制限2.5t〜2.9tの注文Bと12.0tの材料が与えられたとき、アルゴリズム2を適用すると、注文Aに9.3t、注文Bに2.7tを引当てることで、余剰無く引当可能であると判定される。   Example 3: Order amount 9.0t (allowable range 1.45t to 10.0t), single weight limit 1.45t to 1.55t order A and order amount 3.0t (allowable range 2.5t to 3.5t) ), When order B with a weight limit of 2.5t to 2.9t and material of 12.0t are given, apply algorithm 2 to allocate 9.3t for order A and 2.7t for order B Thus, it is determined that it is possible to reserve without surplus.

実施例4:注文量9.0t(許容範囲2.5t〜10.0t)、単重制限1.5t〜1.6tの注文Aと注文量4.0t(許容範囲2.5t〜5.5t)、単重制限1.55t〜1.7tの注文Bと12.0tの材料が与えられたとき、アルゴリズム2を適用すると、余剰無く引当てることは不可能と判定される。   Example 4: Order amount 9.0t (allowable range 2.5t to 10.0t), single weight limit 1.5t to 1.6t order A and order amount 4.0t (allowable range 2.5t to 5.5t) ) When the order B of the single weight limit of 1.55 t to 1.7 t and the material of 12.0 t are given, it is determined that it is impossible to allocate without surplus if the algorithm 2 is applied.

実施例5:注文量1.9t(許容範囲1.5t〜5.0t)、単重制限1.5t〜1.9tの注文Aと注文量4.8t(許容範囲2.5t〜5.0t)、単重制限2.5t〜3.0tの注文Bと注文量4.0t(許容範囲3.5t〜8.0t)、単重制限1.2t〜1.5tの注文Cと11.0tの材料が与えられたとき、アルゴリズム3を適用すると、注文Aに1.5t、注文Bに5.0t、注文Cに4.5tを引当てることで、余剰無く引当可能であると判定される。   Example 5: Order quantity 1.9t (allowable range 1.5t to 5.0t), single weight limit 1.5t to 1.9t order A and order quantity 4.8t (allowable range 2.5t to 5.0t) ), Order B with single weight limit 2.5t to 3.0t and order quantity 4.0t (allowable range 3.5t to 8.0t), Order C with single weight limit 1.2t to 1.5t and 11.0t When the algorithm 3 is applied, it is determined that the order A can be allocated without surplus by allocating 1.5 t to the order A, 5.0 t to the order B, and 4.5 t to the order C. .

実施例6:注文量4.3t(許容範囲1.5t〜10.0t)、単重制限1.5t〜1.9tの注文Aと注文量4.8t(許容範囲4.5t〜9.0t)、単重制限1.5t〜1.7tの注文Bと注文量4.8t(許容範囲4.5t〜9.0t)、単重制限1.5t〜1.7tの注文Cと9.0tの材料が与えられたとき、アルゴリズム3を適用すると、余剰無く引当てることは不可能と判定される。   Example 6: Order amount 4.3t (allowable range 1.5t to 10.0t), single weight limit 1.5t to 1.9t order A and order amount 4.8t (allowable range 4.5t to 9.0t) ), Order B with single weight limit 1.5t to 1.7t and order quantity 4.8t (allowable range 4.5t to 9.0t), Order C with single weight limit 1.5t to 1.7t and 9.0t When algorithm 3 is applied, it is determined that it is impossible to reserve without surplus.

上記発明の実施形態によれば、余剰を無くす引当が存在するか否かを判定し、存在する場合は、その引当を提供する高速な処理を実現することができる。処理の高速性は、注文が一つの場合について言えば、一つの不等式で判定することができるようになったことによるものである。従来手法では、通常、単重上限と下限を2倍、3倍していくことで、材料の重量が単重制約を満たす区間に入っているかどうかチェックする必要があった。この部分が高速化したことによって、注文が複数の場合の判定の高速化に寄与したばかりではなく、ある引当が単重制限を満たすかどうかを判定する部分等、材料引当プログラム全体の高速化にも大きく貢献する。注文が複数の場合について言えば、二分探索などの手法を組み合わせて実現したことで、早く確実に余剰を無くす引当ができるかどうかを実用的な時間で判定することができるようになる。   According to the embodiment of the present invention, it is determined whether or not there is a provision for eliminating the surplus, and when it exists, high-speed processing for providing the provision can be realized. The high speed of processing is due to the fact that it is possible to determine with one inequality for a single order. In the conventional method, it is usually necessary to check whether the weight of the material is in an interval satisfying the single weight constraint by multiplying the upper limit and lower limit of the single weight twice or three times. The speed of this part not only contributed to speeding up the judgment when there are multiple orders, but also speeded up the entire material provisioning program, such as the part to determine whether a certain provision meets the single weight limit. Greatly contribute. In the case where there are a plurality of orders, it is possible to determine in a practical time whether or not the provision for eliminating the surplus can be made quickly and reliably by realizing by combining techniques such as binary search.

以上、本発明を実施形態、具体例を用いて説明したが、本発明の技術的範囲は上記実施形態に記載の範囲に限定されない。上記実施形態に、多様な変更または改良を加えることができる。そのような変更または改良を加えた形態も本発明の技術的範囲に含まれ得ることが、特許請求の範囲の記載から明らかである。また、上記実施例からも理解されるように、本発明の方法および装置は重量の大小に関係なく適用可能である。例えば材料の重量に単重制約のあるお菓子や、小材料の引当てにも本願本質を逸脱することはなく適用可能である。   As mentioned above, although this invention was demonstrated using embodiment and a specific example, the technical scope of this invention is not limited to the range as described in the said embodiment. Various modifications or improvements can be added to the above embodiment. It is apparent from the scope of the claims that the embodiments added with such changes or improvements can be included in the technical scope of the present invention. As can be understood from the above embodiments, the method and apparatus of the present invention can be applied regardless of the weight. For example, the present invention can be applied to a confectionery having a single weight restriction on the weight of the material or to allocate a small material without departing from the essence of the present application.

本発明は、一つの実施形態として、材料引当装置100(図1)上のコンピュータ・プログラムによって実現可能である。上記プログラムを格納する記憶媒体は、電子的、磁気的、光学的、電磁的、赤外線または半導体システム(または、装置または機器)あるいは伝搬媒体であることができる。コンピュータ可読の媒体の例には、半導体またはソリッド・ステート記憶装置、磁気デープ、取り外し可能なコンピュータ可読の媒体の例には、半導体またはソリッド・ステート記憶装置、磁気テープ、取り外し可能なコンピュータ・ディスケット、ランダム・アクセス・メモリ(RAM)、リードオンリー・メモリ(ROM)、リジッド磁気ディスクおよび光ディスクが含まれる。現時点における光ディスクの例には、コンパクト・ディスク−リードオンリー・メモリ(CD-ROM)、コンパクト・ディスク−リード/ライト(CD-R/W)およびDVDが含まれる。   As one embodiment, the present invention can be realized by a computer program on the material allocation apparatus 100 (FIG. 1). The storage medium storing the program can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. Examples of computer readable media include semiconductor or solid state storage, magnetic tape, examples of removable computer readable media include semiconductor or solid state storage, magnetic tape, removable computer diskettes, Random access memory (RAM), read only memory (ROM), rigid magnetic disk and optical disk are included. Current examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read / write (CD-R / W) and DVD.

材料引当装置概略図である。It is a material allocation apparatus schematic. 一つの材料を三つの注文へ切り分けて引当てた例である。In this example, one material is allocated to three orders. アルゴリズム1のフローチャートである。3 is a flowchart of Algorithm 1. アルゴリズム2のフローチャート(1/3)である。It is a flowchart (1/3) of algorithm 2. アルゴリズム2のフローチャート(2/3)である。It is a flowchart (2/3) of algorithm 2. アルゴリズム2のフローチャート(3/3)である。It is a flowchart (3/3) of the algorithm 2. アルゴリズム3のフローチャート(1/4)である。It is a flowchart (1/4) of algorithm 3. アルゴリズム3のフローチャート(2/4)である。It is a flowchart (2/4) of the algorithm 3. アルゴリズム3のフローチャート(3/4)である。It is a flowchart (3/4) of the algorithm 3. アルゴリズム3のフローチャート(4/4)である。It is a flowchart (4/4) of the algorithm 3. 関数1のフローチャートである。It is a flowchart of function 1. 関数2のフローチャートである。It is a flowchart of function 2. 関数countTのフローチャートである。It is a flowchart of function countT. 関数3のフローチャートである。10 is a flowchart of Function 3. 関数4のフローチャートである。10 is a flowchart of function 4. 関数5のフローチャート(1/4)である。It is a flowchart (1/4) of function 5. 関数5のフローチャート(2/4)である。It is a flowchart (2/4) of the function 5. 関数5のフローチャート(3/4)である。It is a flowchart (3/4) of the function 5. 関数5のフローチャート(4/4)である。It is a flowchart (4/4) of function 5. 関数6のフローチャート(1/2)である。It is a flowchart (1/2) of the function 6. 関数6のフローチャート(2/2)である。It is a flowchart (2/2) of the function 6. 注文が二つのときの領域と格子点を表す図である。It is a figure showing the area | region and lattice point when there are two orders. 注文が三つのときの領域と格子点を表す図である。It is a figure showing the area | region and lattice point when an order is three.

符号の説明Explanation of symbols

100 材料引当装置
110 入力部
115 実行部
120 アルゴリズム選択部
130 アルゴリズム記憶部
140 関数記憶部
150 引当判断部
160 重量算出部
170 出力部

DESCRIPTION OF SYMBOLS 100 Material allocation apparatus 110 Input part 115 Execution part 120 Algorithm selection part 130 Algorithm storage part 140 Function storage part 150 Allocation determination part 160 Weight calculation part 170 Output part

Claims (6)

入力部と演算処理部とを備えるコンピュータにより、マージンのある引当材料の重量を算出する方法であって、
前記入力部から与えられる材料の重量の入力を受け、かつ、二つ以上の注文について各々の注文に対する単重、単重上限、単重下限、マージン上限値、マージン下限値の入力を受けるステップと、
前記演算処理部が入力された前記注文に対して、所定の算出式に基づいて、前記材料を余剰なく引当てることが可能であるかを判断するステップと、
前記材料を余剰なく引当てることが可能であると判断したことに応じて、前記演算処理部が引当材料の重量を算出するステップと、
を含み、
前記判断するステップでは、
入力された前記注文に対して、引当可能な引当量の組み合わせを、ユークリッド空間内の多面体の格子点で表し、前記与えられる材料の重量、前記注文の各々の 前記単重上限、および、前記単重下限とで形成される領域の前記格子点の有無を検出することにより、前記材料を余剰なく引当てることが可能であるかを判断する方法
A method of calculating a weight of a provision material with a margin by a computer including an input unit and an arithmetic processing unit ,
Receiving the input of the weight of the material given from the input unit and receiving the input of the unit weight, unit weight upper limit, unit weight lower limit, margin upper limit value, margin lower limit value for each order for two or more orders ; ,
Determining whether the material can be allocated without surplus based on a predetermined calculation formula for the order input by the arithmetic processing unit ;
In response to determining that the material can be allocated without surplus, the arithmetic processing unit calculates the weight of the allocated material;
Only including,
In the determining step,
A combination of allocations that can be allocated for the input order is represented by polyhedral grid points in Euclidean space, the weight of the given material, the unit weight upper limit of each of the orders, and the unit A method of determining whether or not the material can be allocated without surplus by detecting the presence or absence of the lattice points in the region formed by the lower and upper limit .
前記判断するステップでの領域とは、前記注文の数が二つであることに応答して、
前記与えられる材料の重量をw、一の注文の前記単重上限をuua、前記単重下限ula、マージン上限値rua、マージン下限値rla、もう一つの注文の前記単重上限をuub、前記単重下限ulb、マージン上限値rub、マージン下限値rlb、ua=uuaまたはula、ub=uubまたはulb、ceil(x)をxの天井関数、floor(x)をxの床関数として、
ua・x+ulb・y≦w、ua・x+uub・y≧w、
ceil(max{rla,w-rub}/ua)≦x≦floor(min{rua,w-rlb}/ua)
にて形成される領域の格子点の有無を算出することにより、前記与えられる材料を引当可能であるとする、請求項に記載の方法。
The area in the determining step is in response to the number of orders being two,
The weight of the given material is w, the unit weight upper limit of one order uu a , the unit weight lower limit ul a , the margin upper limit value ru a , the margin lower limit value rl a , and the unit weight upper limit of another order. uu b , the unit weight lower limit ul b , margin upper limit value ru b , margin lower limit value rl b , u a = uu a or ul a , u b = uu b or ul b , ceil (x) is the ceiling function of x, Let floor (x) be the floor function of x
u a・ x + ul b・ y ≦ w, u a・ x + uu b・ y ≧ w,
ceil (max {rl a , w-ru b } / u a ) ≦ x ≦ floor (min {ru a , w-rl b } / u a )
The method according to claim 1, wherein the given material can be allocated by calculating the presence / absence of a lattice point in a region formed in step ( 1 ).
前記判断するステップでの領域とは、前記注文の数が三つであることに応答して、
前記与えられる材料の重量をw、一の注文の前記単重上限をuua、前記単重下限ula、マージン上限値rua、マージン下限値rla、二の注文の前記単重上限をuub、前記単重下限ulb、マージン上限値rub、マージン下限値rla、三の注文の前記単重上限をuuc、前記単重下限ulc、マージン上限値ruc、マージン下限値rlc、ua=uuaまたはua=ula、ub=uubまたはub=ulb、ceil(x)をxの天井関数、floor(x)をxの床関数、
xl=ceil(rla/ua)、xu=floor(rua/ua)、
yl=ceil(rlb/ub)、yu=floor(rub/ub)、
zl=ceil(rlc/uuc)、zu=floor(ruc/ulc)、
として、
zl≦z≦zuを満たす整数値zそれぞれについて、
ua・x+ub・y≦w-ulc・z、ua・x+ub・y≦w-uuc・z
max{ceil((w-z・uuc-yu・ub)/ua),xl}≦x≦min{floor((w-zu・lc-yl・ub)/ua),xu}、
max{ceil((w-z・uuc-xu・ua)/ub),yl}≦y≦min{floor((w-z・ulc-xl・ua)/ub),yu}
にて形成される領域の格子点の有無を検出することにより、前記与えられる材料を引当可能であるとする、請求項に記載の方法。
The area in the determining step is in response to the number of orders being three,
The weight of the given material is w, the unit weight upper limit of one order is uu a , the unit weight lower limit ul a , the margin upper limit value ru a , the margin lower limit value rl a , and the unit weight upper limit of the second order is uu b , the unit weight lower limit ul b , the margin upper limit value ru b , the margin lower limit value rl a , the unit weight upper limit of the third order uu c , the unit weight lower limit ul c , the margin upper limit value ru c , and the margin lower limit value rl c , u a = uu a or u a = ul a , u b = uu b or u b = ul b , ceil (x) is the ceiling function of x, floor (x) is the floor function of x,
xl = ceil (rl a / u a ), xu = floor (ru a / u a ),
yl = ceil (rl b / u b ), yu = floor (ru b / u b ),
zl = ceil (rl c / uu c ), zu = floor (ru c / ul c ),
As
For each integer value z satisfying zl ≦ z ≦ zu,
u a・ x + u b・ y ≦ w-ul c・ z, u a・ x + u b・ y ≦ w-uu c・ z
max {ceil ((wz ・ uu c -yu ・ u b ) / u a ), xl} ≦ x ≦ min {floor ((w-zu ・ l c -yl ・ u b ) / u a ), xu},
max {ceil ((wz ・ uu c -xu ・ u a ) / u b ), yl} ≦ y ≦ min {floor ((wz ・ ul c -xl ・ u a ) / u b ), yu}
By detecting the presence or absence of lattice points in the region formed by, for the given material to be possible provision method according to claim 1.
前記判断するステップでの前記格子点の有無を、二分探索法を用いて検出する請求項1乃至3のいずれかに記載の方法。 The method according to any one of claims 1 to 3 the presence of the grid points in the step of determining, detected using a binary search. マージンのある引当材料の重量を算出する装置であって、
与えられる材料の重量の入力を受け、かつ、二つ以上の注文について各々の注文に対する単重、単重上限、単重下限、マージン上限値、マージン下限値の入力を受ける入力部と、
入力された前記注文に対して、所定の算出式に基づいて、前記材料を余剰なく引当てることが可能であるかを判断する判断部と、
前記材料を余剰なく引当てることが可能であると判断したことに応じて、引当材料の重量を算出する算出部と、
を含み、
前記判断部は、
入力された前記注文に対して、引当可能な引当量の組み合わせを、ユークリッド空間内の多面体の格子点で表し、前記与えられる材料の重量、前記注文の各々の 前記単重上限、および、前記単重下限とで形成される領域の前記格子点の有無を検出することにより、前記材料を余剰なく引当てることが可能であるかを判断する装置
A device for calculating the weight of the allocated material with a margin,
An input unit that receives input of the weight of a given material and receives input of a unit weight, a unit weight upper limit, a unit weight lower limit, a margin upper limit value, and a margin lower limit value for each order for two or more orders ;
A determination unit that determines whether it is possible to reserve the material without surplus based on a predetermined calculation formula for the input order;
In response to determining that the material can be allocated without surplus, a calculating unit that calculates the weight of the allocated material;
Including
The determination unit
A combination of allocations that can be allocated for the input order is represented by polyhedral grid points in Euclidean space, the weight of the given material, the unit weight upper limit of each of the orders, and the unit An apparatus for determining whether or not it is possible to reserve the material without surplus by detecting the presence or absence of the lattice points in the region formed by the lower and upper limit .
マージンのある引当材料の重量を算出するためのコンピュータ・プログラムであって、入力部と演算処理部とを備えるコンピュータに、
前記入力部により与えられる材料の重量の入力を受け、かつ、二つ以上の注文について各々の注文に対する単重、単重上限、単重下限、マージン上限値、マージン下限値の入力を受けさせるステップと、
入力された前記注文に対して、前記演算処理部により所定の算出式に基づいて、前記材料を余剰なく引当てることが可能であるかを判断させるステップと、
前記材料を余剰なく引当てることが可能であると判断したことに応じて、前記演算処理部により引当材料の重量を算出させるステップと、
を実行させ
前記判断させるステップでは、
入力された前記注文に対して、引当可能な引当量の組み合わせを、ユークリッド空間内の多面体の格子点で表し、前記与えられる材料の重量、前記注文の各々の 前記単重上限、および、前記単重下限とで形成される領域の前記格子点の有無を検出することにより、前記材料を余剰なく引当てることが可能であるかを判断させる、コンピュータ・プログラム。
A computer program for calculating the weight of a provisioned material with a margin, the computer comprising an input unit and an arithmetic processing unit ,
It receives the weight of the material provided by the input unit, and the unit weight for each of the orders for two or more orders, unit weight limit, unit weight lower, margin upper limit value, the step of subjecting the input margin lower limit value When,
For the input order, a step of determining whether the material can be allocated without surplus based on a predetermined calculation formula by the arithmetic processing unit ;
In response to determining that the material is capable of Hikiateru without excess, a step of causing calculate the weight of the reserve material by the processing unit,
Execute
In the step of determining,
A combination of allocations that can be allocated for the input order is represented by polyhedral grid points in Euclidean space, the weight of the given material, the unit weight upper limit of each of the orders, and the unit A computer program that makes it possible to determine whether or not the material can be allocated without surplus by detecting the presence or absence of the lattice points in the region formed by the lower and upper limit .
JP2005208348A 2005-07-19 2005-07-19 Material allocation method, apparatus and program Expired - Fee Related JP4636609B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005208348A JP4636609B2 (en) 2005-07-19 2005-07-19 Material allocation method, apparatus and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005208348A JP4636609B2 (en) 2005-07-19 2005-07-19 Material allocation method, apparatus and program

Publications (3)

Publication Number Publication Date
JP2007026162A JP2007026162A (en) 2007-02-01
JP2007026162A5 JP2007026162A5 (en) 2008-07-17
JP4636609B2 true JP4636609B2 (en) 2011-02-23

Family

ID=37786814

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005208348A Expired - Fee Related JP4636609B2 (en) 2005-07-19 2005-07-19 Material allocation method, apparatus and program

Country Status (1)

Country Link
JP (1) JP4636609B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105302105B (en) * 2015-11-30 2018-04-17 广州普朗克工业设备有限公司 Intelligent daily use chemicals production line on-line control system

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06149850A (en) * 1992-11-05 1994-05-31 Nippon Steel Corp Product material and order reserving method/system
JPH06195346A (en) * 1992-10-09 1994-07-15 Matsushita Electric Ind Co Ltd Scheduling device and parameter adjusting device
JPH07204996A (en) * 1994-01-07 1995-08-08 Nippon Steel Corp Sheet steel production managing method in steel work industry
JP2000263386A (en) * 1999-03-12 2000-09-26 Kawasaki Steel Corp Thin plate production control method
JP2000343389A (en) * 1999-06-08 2000-12-12 Kawasaki Steel Corp Dividing plan deciding method
JP2001326152A (en) * 2000-02-02 2001-11-22 Texas Instr Inc <Ti> System and method for dispatching semiconductor lot to manufacturing equipment for manufacturing
JP2002329105A (en) * 2001-04-27 2002-11-15 Nkk Corp Electronic commerce method
JP2003268428A (en) * 2002-03-08 2003-09-25 Jfe Steel Kk Apparatus for controlling quality of steel product
JP2004178572A (en) * 2002-11-11 2004-06-24 Jfe Steel Kk Allocation method of actual article to order in manufacturing process of steel product
JP2004227301A (en) * 2003-01-23 2004-08-12 Nippon Steel Corp Shipment amount predicting device and method for product and computer readable recording medium
JP2004277835A (en) * 2003-03-17 2004-10-07 Jfe Steel Kk System for supporting orders for product of steel material

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06195346A (en) * 1992-10-09 1994-07-15 Matsushita Electric Ind Co Ltd Scheduling device and parameter adjusting device
JPH06149850A (en) * 1992-11-05 1994-05-31 Nippon Steel Corp Product material and order reserving method/system
JPH07204996A (en) * 1994-01-07 1995-08-08 Nippon Steel Corp Sheet steel production managing method in steel work industry
JP2000263386A (en) * 1999-03-12 2000-09-26 Kawasaki Steel Corp Thin plate production control method
JP2000343389A (en) * 1999-06-08 2000-12-12 Kawasaki Steel Corp Dividing plan deciding method
JP2001326152A (en) * 2000-02-02 2001-11-22 Texas Instr Inc <Ti> System and method for dispatching semiconductor lot to manufacturing equipment for manufacturing
JP2002329105A (en) * 2001-04-27 2002-11-15 Nkk Corp Electronic commerce method
JP2003268428A (en) * 2002-03-08 2003-09-25 Jfe Steel Kk Apparatus for controlling quality of steel product
JP2004178572A (en) * 2002-11-11 2004-06-24 Jfe Steel Kk Allocation method of actual article to order in manufacturing process of steel product
JP2004227301A (en) * 2003-01-23 2004-08-12 Nippon Steel Corp Shipment amount predicting device and method for product and computer readable recording medium
JP2004277835A (en) * 2003-03-17 2004-10-07 Jfe Steel Kk System for supporting orders for product of steel material

Also Published As

Publication number Publication date
JP2007026162A (en) 2007-02-01

Similar Documents

Publication Publication Date Title
US9591028B2 (en) Visualization and analysis of complex security information
CN107391526A (en) A kind of data processing method and equipment based on block chain
JP5121936B2 (en) RESOURCE ALLOCATION DEVICE, RESOURCE ALLOCATION PROGRAM, RECORDING MEDIUM, AND RESOURCE ALLOCATION METHOD
JP6779231B2 (en) Data processing method and system
CN110019353B (en) Data processing method and device
CN108804383B (en) Support point parallel enumeration method and device based on measurement space
CN108090225A (en) Operation method, device, system and the computer readable storage medium of database instance
CN108650684A (en) A kind of correlation rule determines method and device
CN108256570A (en) Data clustering method, device and storage medium based on K neighborhood similarities
CN111552509A (en) Method and device for determining dependency relationship between interfaces
CN106649226A (en) Report generation method and device
CN107016115A (en) Data export method, device, computer-readable recording medium and electronic equipment
CN109992699A (en) Optimization method and device, storage medium, the computer equipment of user group
US20160292220A1 (en) Variable virtual split dictionary for search optimization
JP4636609B2 (en) Material allocation method, apparatus and program
CN107784195A (en) Data processing method and device
CN106909556A (en) The storage equalization methods and device of main memory cluster
CN107346350A (en) Integrated circuit layout data handles distribution method, device and the group system of task
CN110020954B (en) Revenue distribution method and device and computer equipment
CN115442262B (en) Resource evaluation method and device, electronic equipment and storage medium
CN115375231A (en) Storage bit allocation method and device, electronic equipment and computer readable medium
CN114996503A (en) Node positioning method and device
CN113449208B (en) Space query method, device, system and storage medium
CN112053114B (en) Order grouping method and system for improving single batch order loading capacity
CN113449008B (en) Modeling method and device

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080603

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080603

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: 20101116

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

RD14 Notification of resignation of power of sub attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7434

Effective date: 20101118

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20101119

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131203

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees