MathDB
The Kingdom of Moles

Source: 2023 Japan TST p12

July 21, 2023
combinatorics

Problem Statement

The Kingdom of Moles consists of 20232023 cities, and there are several tunnels connecting different pairs of cities. Each tunnel allows bidirectional travel, and there is at most one tunnel connecting any two distinct cities. Furthermore, it is possible to travel between any two distinct cities through a combination of several tunnels.
A pair of distinct cities {A,B}\{A, B\} is considered good if it satisfies the following condition for any city CC different from AA and BB:
Let dC,Ad_{C,A} be the minimum number of tunnels required to travel from CC to AA, and let dC,Bd_{C,B} be the minimum number of tunnels required to travel from CC to BB. For any such pair {A,B}\{A, B\}, it is guaranteed that regardless of the paths XX and YY chosen to travel from CC to AA (using dC,Ad_{C,A} tunnels) and from CC to BB (using dC,Bd_{C,B} tunnels), respectively, XX and YY do not share any common tunnel.
Find the second largest possible value for the number of good pairs of cities. Note that the pairs {A,B}\{A, B\} and {B,A}\{B, A\} are considered the same combination.