I’m currently looking at the test data from 2021 December Silver Problem 2 (Connecting Two Barns, data found here) and the problem states that
It is guaranteed that there is at most one path between any two fields
I believe that this should imply that there are no cycles in the graph of fields connected by the bidirectional paths (please correct me if I’m wrong here). However, when I look at the data from test case #2, the first sub-test case contains the following edges:
8 5
11 9
7 2
3 11
3 4
3 1
7 11
6 3
10 9
2 10
8 9
5 10
9 2
5 2
3 5
When I looked closer at this, I noticed that it contained the edges:
- 11 9
- 7 2
- 7 11
- 10 9
- 2 10
implying the cycle 11-7-2-10-9-11, which means that there are two paths between nodes 11 and 9:
- 11 → 7 → 2 → 10 → 9
- 11 → 9
Doesn’t this contradict the problem statement, or am I misinterpreting something? Thanks!