还是Dijstra,代码如下:
#include<stdio.h>
#define max_edge 510
#define max_int 100000
typedef struct Node_Type{
int dis;
int cost;
}Node;
int n,m,s,d,cnt=0;
int vst[max_edge],pre[max_edge];
int Dis[max_edge],Cost[max_edge];
Node map[max_edge][max_edge];
void init(){
int i,j;
for(i=0;i<n;i++){
vst[i]=0;
Dis[i]=max_int;
Cost[i]=max_int;
for(j=0;j<n;j++){
map[i][j].dis=max_int;
......
阅读全文