跳到主要内容

京都大学 情報学研究科 知能情報学専攻 2024年8月実施 情報学基礎 F2-1

Author

itsuitsuki

Description (English)

Q.1

In the undirected graph shown below, the numbers attached to the edges represent their lengths. The edge length xx between nodes aa and bb is a positive real number. Among all paths between two nodes ss and tt, those with the minimum total edge length are called the shortest paths between ss and tt. The total edge length in a shortest path is referred to as the distance between ss and tt. A path is represented as a sequence of nodes in which no node appears more than once.

(1) Derive the distance between bb and jj, and identify all shortest paths, each represented as a sequence of nodes.

(2) Derive the condition on xx under which bb is included in all shortest paths between aa and jj.

Q.2

Given a set U={1,2,,n}U = \{1, 2, \dots, n\} and a set S={S1,S2,,Sm}S = \{S_1, S_2, \dots, S_m\} where each SiS_i is a subset of UU, the set cover problem is to identify a set C={Sc1,Sc2,,Sck}S\mathcal{C} = \{S_{c_1}, S_{c_2}, \dots, S_{c_k}\} \subseteq S with the minimum kk such that Sc1Sc2Sck=US_{c_1} \cup S_{c_2} \cup \dots \cup S_{c_k} = U holds. Note that nn and mm are positive integers and it is assumed that S1S2Sm=US_1 \cup S_2 \cup \dots \cup S_m = U holds. The following pseudo-code describes a greedy algorithm that computes an approximate solution to this problem.

Note that #(X)\#(X), max(X)\max(X), and min(X)\min(X) denote the number of elements, the maximum element, and the minimum element of a set XX, respectively. Note also that XYX \setminus Y denotes the set difference, which is the set obtained by deleting the elements belonging to both XX and YY from XX. For example, {1,3,4,5}{2,3,5}={1,4}\{1, 3, 4, 5\} \setminus \{2, 3, 5\} = \{1, 4\} holds.

This algorithm may output different solutions even for the same SS, depending on the ordering of their elements. For example, suppose that U={1,2,3,4,5}U = \{1, 2, 3, 4, 5\} and S={{1,3,5},{2,4},{2,3,5}}S = \{\{1, 3, 5\}, \{2, 4\}, \{2, 3, 5\}\}. This algorithm outputs C={{1,3,5},{2,4}}\mathcal{C} = \{\{1, 3, 5\}, \{2, 4\}\} if S1={1,3,5},S2={2,4}S_1 = \{1, 3, 5\}, S_2 = \{2, 4\}, and S3={2,3,5}S_3 = \{2, 3, 5\}, whereas it outputs C={{2,3,5},{2,4},{1,3,5}}\mathcal{C} = \{\{2, 3, 5\}, \{2, 4\}, \{1, 3, 5\}\} if S1={2,3,5},S2={2,4}S_1 = \{2, 3, 5\}, S_2 = \{2, 4\}, and S3={1,3,5}S_3 = \{1, 3, 5\}.

When considering all possible orderings of the elements of SS (i.e., all permutations of the elements of SS) for given UU and SS, among all solutions C\mathcal{C} outputted by this algorithm, let Amin(U,S)A_{\min}(U, S) denote the cardinality of C\mathcal{C} with the smallest cardinality, and let Amax(U,S)A_{\max}(U, S) denote the cardinality of C\mathcal{C} with the largest cardinality. Note that for the case of (U,S)(U, S) given above, Amin(U,S)=2A_{\min}(U, S) = 2 and Amax(U,S)=3A_{\max}(U, S) = 3 hold. Answer the following questions where reasons must be given for all answers.

(1) Let U={1,2,,10}U = \{1, 2, \dots, 10\} and S={{i,i+1}i=1,2,,9}S = \{\{i, i+1\} \mid i = 1, 2, \dots, 9\}. Derive Amin(U,S)A_{\min}(U, S) and Amax(U,S)A_{\max}(U, S).

(2) Let U={1,2,,100}U = \{1, 2, \dots, 100\} and S={{i,j}all integers i,j satisfying 1i<j100}S = \{\{i, j\} \mid \text{all integers } i, j \text{ satisfying } 1 \le i < j \le 100\}. Derive Amin(U,S)A_{\min}(U, S) and Amax(U,S)A_{\max}(U, S).

(3) Let U={1,2,,63}U = \{1, 2, \dots, 63\} and S={{i,2i},{i,2i+1}i=1,2,,31}S = \{\{i, 2i\}, \{i, 2i+1\} \mid i = 1, 2, \dots, 31\}. Derive Amin(U,S)A_{\min}(U, S).