急求!!用C语言求最短路径

来源:百度知道 编辑:UC知道 时间:2024/05/26 23:16:27
求图中任意两点间的最短路径
用C语言编程,谢谢了

#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
const int MAXSIZE = 10;
const int HEAD = -1;
const int s = MAXSIZE * MAXSIZE;
struct TNode{
int x, y;
int parent;
};
int Metrix[MAXSIZE][MAXSIZE] = {
1, 1, 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1,
0, 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1,
0 , 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1,
0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1,
0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 0 , 1,
0 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1,
0 , 1 , 1 ,1 , 0 , 1 , 0 , 0 , 0 , 1,
0 , 1 , 0