跳到主要内容

東京大学 情報理工学系研究科 創造情報学専攻 2011年8月実施 筆記試験 第1問

Author

itsuitsuki

Description

品物 はそれぞれ重量 で価値 (ここで ) を持つ。最大重量限界 のナップサックに出来るだけ合計価値が大きくなるように品物を詰める問題をナップサック問題といい、一般的に次のように定式化することができる。

[問題 A0] 最大化 条件 , ( をナップサックに詰める時に となる)

ここで具体的なナップサック問題としては次の [問題 A1] を考える。

[問題 A1] 最大化 条件

最も直接的な解法は列挙法であり、全ての場合を生成して調べる。[問題 A1] の具体例では場合数 で十分計算可能な範囲であるが、品物数 の増大につれて、場合数は指数的に増大する。そこでここでは、(1) 分枝限定法 (branch and bound method) と (2) 動的計画法 (dynamic programming) の二つの方法により効率的探索を図ることを考える。

(1) 分枝限定法による探索

(1-1) 目的関数最大化を求める分枝限定法の動作について、以下の用語を使用して説明せよ。 「分枝操作」、「部分問題(子問題)」、「暫定値」、「上界値」、「限定操作」、「実行可能解」。

(1-2) ナップサック問題の場合、品物は単位重量当たりの価値の順にソートされていると都合良く、上記 [問題 A1] では、 の順に単位重量当たりの価値が高くなっている。 の条件を緩和し、 とした緩和問題の解はこの場合には容易に求めることができ、 の時、最大価値 を得ることができる。この推定値が の条件の場合の合計価値の上界を与える。この緩和問題による上界の計算は、部分問題でも同様に利用することができる。 [問題 A1] について、 の順に、かつ の値の順に具体化していく縦型(深さ優先)探索において、上記の分枝限定法の探索を行い解を求めよ。 解答には探索木とナップサックに詰める品物 と最大合計価値を示せ。

(2) 動的計画法による計算

同じナップサック問題の解を動的計画法によって求めることを考える。なお、ここでは一般性を失うことなく、一般化した [問題 A0] における は正の整数とする。そして次の関数 を定める (ここで は整数で )。 : 重量制限 以下のなかに詰める品物の候補を に限定した時に得られる最大の合計価値

明らかに であり、[問題 A1] に対して となる。そして、[問題 A1] の最終的な最大合計価値は として求められ、[問題 A0] の最終的な最大合計価値は として求められることになる。

(2-1) この あるいは から出発し、一般的な問題である [問題 A0] において を順次増やしながら最終的に を計算する方法を得たい。 (ここで ) が求められている場合、この を用いて を求める方法を式として示せ。但し が負の整数の時は便宜的に として式を得ることを可とする。

(2-2) 上記の結果を利用し、[問題 A1] に対して下に示す の表を順次計算することにより、[問題 A1] を解け。 解答には数値を計算した の表と、ナップサックに詰める品物、最大合計価値を示すこと。

[問題 A1] に対する の表

0123456789
00000000000
1001414141414141414
2
3
4
5

Description (English)

Items have weights and values (where ), respectively. The problem of packing items into a knapsack with a maximum weight capacity such that the total value is as large as possible is called the knapsack problem, which can generally be formulated as follows.

[Problem A0] Maximize Subject to , ( when item is packed into the knapsack)

As a specific knapsack problem, consider the following [Problem A1].

[Problem A1] Maximize Subject to

The most direct solution method is the enumeration method, where all cases are generated and examined. In the specific example of [Problem A1], the number of cases is well within the calculable range, but as the number of items increases, the number of cases increases exponentially. Therefore, here we consider efficient search using two methods: (1) the branch and bound method and (2) dynamic programming.

(1) Search by the branch and bound method

(1-1) Explain the operation of the branch and bound method for maximizing an objective function using the following terms: "branching operation," "subproblem (child problem)," "tentative value," "upper bound," "bounding operation," and "feasible solution."

(1-2) In the case of the knapsack problem, it is convenient if the items are sorted in the order of value per unit weight; in [Problem A1] above, the value per unit weight is higher in the order . By relaxing the condition and setting , the solution to the relaxed problem can be easily found in this case. When , a maximum value of can be obtained. This estimate gives an upper bound on the total value for the condition . This calculation of the upper bound by the relaxation problem can be similarly utilized for subproblems. For [Problem A1], find the solution by performing a branch and bound search in a vertical (depth-first) search that instantiates in that order, and in the order of values . Show the search tree, the items packed in the knapsack , and the maximum total value in your answer.

(2) Calculation by dynamic programming

Consider finding the solution to the same knapsack problem using dynamic programming. Here, without loss of generality, let and in the generalized [Problem A0] be positive integers. Then, define the following function (where and are integers such that ). : the maximum total value obtained when candidates for items to be packed within a weight limit are limited to .

Clearly is , and for [Problem A1], and . Then, the final maximum total value for [Problem A1] is found as , and the final maximum total value for [Problem A0] will be found as .

(2-1) Starting from this or , we want to obtain a method to finally calculate while sequentially increasing in the general [Problem A0]. If (where ) has been found, show the method to find using this as a formula. However, if is a negative integer, it is permissible to obtain the formula by setting for convenience.

(2-2) Using the above results, solve [Problem A1] by sequentially calculating the table for shown below for [Problem A1]. Show the table for with calculated numerical values, the items packed in the knapsack, and the maximum total value in your answer.

Table of for [Problem A1]

0123456789
00000000000
1001414141414141414
2
3
4
5