跳到主要内容

京都大学 情報学研究科 知能情報学専攻 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 between nodes and is a positive real number. Among all paths between two nodes and , those with the minimum total edge length are called the shortest paths between and . The total edge length in a shortest path is referred to as the distance between and . A path is represented as a sequence of nodes in which no node appears more than once.

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

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

Q.2

Given a set and a set where each is a subset of , the set cover problem is to identify a set with the minimum such that holds. Note that and are positive integers and it is assumed that holds. The following pseudo-code describes a greedy algorithm that computes an approximate solution to this problem.

Note that , , and denote the number of elements, the maximum element, and the minimum element of a set , respectively. Note also that denotes the set difference, which is the set obtained by deleting the elements belonging to both and from . For example, holds.

This algorithm may output different solutions even for the same , depending on the ordering of their elements. For example, suppose that and . This algorithm outputs if , and , whereas it outputs if , and .

When considering all possible orderings of the elements of (i.e., all permutations of the elements of ) for given and , among all solutions outputted by this algorithm, let denote the cardinality of with the smallest cardinality, and let denote the cardinality of with the largest cardinality. Note that for the case of given above, and hold. Answer the following questions where reasons must be given for all answers.

(1) Let and . Derive and .

(2) Let and . Derive and .

(3) Let and . Derive .