public static String shortest(User user) {标签:String,int,shortestPathLength,terminusStation,user,4.24,startingStation From: https://www.cnblogs.com/kongxiangzeng/p/18246121
Connection connection = JDBCUtils.getConn();
String startingStation = user.getStarting_Station();
String terminusStation = user.getTerminus_Station();
// 1. 构建站点名称到ID的映射
Map<String, Integer> stationIdMap = buildStationIdMap();
// 2. 构建邻接矩阵
int[][] adjacencyMatrix = adjacency();
// 3. 计算最短路径长度
int shortestPathLength = calculateShortestPath(adjacencyMatrix, startingStation, terminusStation, stationIdMap);
System.out.println(shortestPathLength+startingStation+"erhjhgfdshjhgfds");
// 返回结果,这里可以根据需要将结果转换为字符串
return "Shortest path length from " + startingStation + " to " + terminusStation + " is: " + shortestPathLength;
}