校园导航系统(Floyd算法实现)
首先是配置文件
#include<iostream>
#include<stdlib.h>
using namespace std;
#define MaxInt 32767
#define MaxNum 100
typedef int status;
typedef string VerTexType;
typedef int ArcType;
typedef struct
{
VerTexType vexs[MaxNum];
ArcType arcs[MaxNum][MaxNum];
int vexnum,arcnum;
char name[MaxNum];
}AMGraph;
status CreateMap(AMGraph &G)
{
G.vexnum=10;
G.arcnum=13;
G.vexs[0]="北门";
G.vexs[1]="下沉广场";
G.vexs[2]="青年公寓";
G.vexs[3]="齐贤广场";
G.vexs[4]="15教";
G.vexs[5]="菜鸟驿站";
G.vexs[6]="汇森楼";
G.vexs[7]="图书馆";
G.vexs[8]="体育馆";
G.vexs[9]="南苑餐厅";
for(int i=0;i<MaxNum;i++)
{
for(int j=0;j<MaxNum;j++)
{
G.arcs[i][j] = MaxInt;
}
}
G.arcs[0][1] = G.arcs[1][0] = <