Y by rokkc
The one-way routes connecting towns
,
,
,
,
, and
are shown in the figure below (not drawn to scale).The distances in kilometers along each route are marked. Traveling along these routes, what is the shortest distance from A to Z in kilometers?
![[asy]
/* AMC8 P14 2024, by NUMANA: BUI VAN HIEU */
import graph;
unitsize(2cm);
real r=0.25;
// Define the nodes and their positions
pair[] nodes = { (0,0), (2,0), (1,1), (3,1), (4,0), (6,0) };
string[] labels = { "A", "M", "X", "Y", "C", "Z" };
// Draw the nodes as circles with labels
for(int i = 0; i < nodes.length; ++i) {
draw(circle(nodes[i], r));
label("$" + labels[i] + "$", nodes[i]);
}
// Define the edges with their node indices and labels
int[][] edges = { {0, 1}, {0, 2}, {2, 1}, {2, 3}, {1, 3}, {1, 4}, {3, 4}, {4, 5}, {3, 5} };
string[] edgeLabels = { "8", "5", "2", "10", "6", "14", "5", "10", "17" };
pair[] edgeLabelsPos = { S, SE, SW, S, SE, S, SW, S, NE};
// Draw the edges with labels
for (int i = 0; i < edges.length; ++i) {
pair start = nodes[edges[i][0]];
pair end = nodes[edges[i][1]];
draw(start + r*dir(end-start) -- end-r*dir(end-start), Arrow);
label("$" + edgeLabels[i] + "$", midpoint(start -- end), edgeLabelsPos[i]);
}
// Draw the curved edge with label
draw(nodes[1]+r * dir(-45)..controls (3, -0.75) and (5, -0.75)..nodes[5]+r * dir(-135), Arrow);
label("$25$", midpoint(nodes[1]..controls (3, -0.75) and (5, -0.75)..nodes[5]), 2S);
[/asy]](//latex.artofproblemsolving.com/9/3/7/937e770e18903819330e195c68a57256dec0b6f0.png)







![[asy]
/* AMC8 P14 2024, by NUMANA: BUI VAN HIEU */
import graph;
unitsize(2cm);
real r=0.25;
// Define the nodes and their positions
pair[] nodes = { (0,0), (2,0), (1,1), (3,1), (4,0), (6,0) };
string[] labels = { "A", "M", "X", "Y", "C", "Z" };
// Draw the nodes as circles with labels
for(int i = 0; i < nodes.length; ++i) {
draw(circle(nodes[i], r));
label("$" + labels[i] + "$", nodes[i]);
}
// Define the edges with their node indices and labels
int[][] edges = { {0, 1}, {0, 2}, {2, 1}, {2, 3}, {1, 3}, {1, 4}, {3, 4}, {4, 5}, {3, 5} };
string[] edgeLabels = { "8", "5", "2", "10", "6", "14", "5", "10", "17" };
pair[] edgeLabelsPos = { S, SE, SW, S, SE, S, SW, S, NE};
// Draw the edges with labels
for (int i = 0; i < edges.length; ++i) {
pair start = nodes[edges[i][0]];
pair end = nodes[edges[i][1]];
draw(start + r*dir(end-start) -- end-r*dir(end-start), Arrow);
label("$" + edgeLabels[i] + "$", midpoint(start -- end), edgeLabelsPos[i]);
}
// Draw the curved edge with label
draw(nodes[1]+r * dir(-45)..controls (3, -0.75) and (5, -0.75)..nodes[5]+r * dir(-135), Arrow);
label("$25$", midpoint(nodes[1]..controls (3, -0.75) and (5, -0.75)..nodes[5]), 2S);
[/asy]](http://latex.artofproblemsolving.com/9/3/7/937e770e18903819330e195c68a57256dec0b6f0.png)
