-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patht05-local.out
59 lines (49 loc) · 1.32 KB
/
t05-local.out
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
The input data is:
Salem
Beverly 2.4 mi via bridge
Danvers 3.7 mi via bridge
Lynn 4.9 mi
Beverly
Danvers 2.9 mi
Salem 2.4 mi via bridge
Wenham 5.2 mi
Danvers
Beverly 2.9 mi
Wenham 4.2 mi
Salem 3.7 mi via bridge
Lynn
Salem 4.9 mi
Wenham
Beverly 5.2 mi
Danvers 4.2 mi
The shortest paths from Salem are:
The shortest path from Salem to Wenham is 7.6 mi:
Salem
Beverly
Wenham
The shortest path from Salem to Beverly is 2.4 mi:
Salem
Beverly
The shortest path from Salem to Danvers is 3.7 mi:
Salem
Danvers
The shortest path from Salem to Lynn is 4.9 mi:
Salem
Lynn
The road upgrading goal can be achieved at minimal cost by upgrading:
Beverly to Salem
Danvers to Beverly
Danvers to Wenham
Lynn to Salem
Connected components in event of a major storm are:
If all bridges fail, the following towns would form an isolated group:
Salem
Lynn
If all bridges fail, the following towns would form an isolated group:
Wenham
Beverly
Danvers
Destruction of any of the following would result in the province becoming
disconnected:
Salem
------------------------------------------------------------------