??world 2016-11-20 07:25 采纳率: 100%

# JAVA算法题，求最优路线，请大神指点！

public class Config {

``````static final int STATION_COUNT = 10;//车站数

static final float TIME_OF_ONE_RIDE = 3.0f;//行走一个站的时间（分钟）

static final float TIME_OF_ONE_STOP = 0.5f;//停靠一次站的时间（分钟）

static final String[] STATION_NAMES = new String[]{"A","B","C","D","E","F","G","H","I","J"};//站名

static final int INIT_INDEX = 7;//车子的起始站点号

static int[][] countsOfFromTo = null;//从某站到目的站的候车人数

/*
* 下面通过静态构造器来对二维数组进行初始化
*/
static {
//countsOfFromTo[i][j]表示从i站到j站的候车人数
countsOfFromTo = new int[][]{
/**************A,B,C,D,E,F,G,H,I,J*/
/*A*/new int[]{0,5,3,7,8,2,6,4,2,3},
/*B*/new int[]{1,0,4,3,7,6,3,4,2,6},
/*C*/new int[]{3,2,0,7,5,4,7,5,1,2},
/*D*/new int[]{5,1,2,0,5,3,3,1,8,6},
/*E*/new int[]{4,2,7,3,0,6,1,5,4,3},
/*F*/new int[]{2,9,6,2,1,0,3,6,5,1},
/*G*/new int[]{6,1,4,3,5,2,0,3,2,4},
/*H*/new int[]{3,2,5,1,8,2,3,0,7,4},
/*I*/new int[]{4,2,6,3,1,7,5,2,0,3},
/*J*/new int[]{7,1,4,8,1,2,9,1,5,0}
};
}
``````

}

• 写回答

#### 1条回答默认 最新

• ??world 2016-11-20 08:06
关注

本回答被题主选为最佳回答 , 对您是否有帮助呢?
评论

#### 悬赏问题

• ¥15 实时声纹降噪算法进行无关说话人语音抑制
• ¥15 Python如何爬取post请求头的数据