if(allVertex[i] != MAX_INT && shortestWeight > graph[currentStart][i]){//并且这条line不能是计算过的。如果合法,则比较当前最小的weight。
shortestWeight = graph[currentStart][i];//选中这条line。
shortestEnd = i;//记住这条line。
if(distances[i] >= MAX_INT){//调整distances和previous.
distances[i] = graph[currentStart][i] + distances[currentStart];
previous[i] = currentStart;
}else{
if(distances[currentStart] + graph[currentStart][i] < distances[i]){
distances[i] = distances[currentStart] + graph[currentStart][i];
previous[i] = currentStart;
}
}
}
}
}
}
}
//4. 把最短的line的end作为新的start重新循环,
if(shortestEnd == MIN_INT){
cout<<"error!! shortestEnd == MIN_INT"<
}else{