#include
using namespace std;
typedef char VertexType;
typedef int EdgeType;
const int MAXVEX = 100;
const int INFINITY = 65535;
typedef struct
{
VertexType vexs[MAXVEX];
EdgeType arc[MAXVEX][MAXVEX];
int numVertexes,numEdges;
}MGraph;
/*
建立无向网图的邻接矩阵表示
*/
void CreateMGraph_Undirected(MGraph *G)
{
int i,j,k,w;
cout<<“请输入顶点数和边数:”<<endl;
cin>>G->numVertexes>>G->numEdges;
cout<<“请输入顶点名称:”<<endl;
for(i = 0;i < G->numVertexes;++i)//输入顶点
{
cin>>G->vexs[i];
}
for(i = 0;i < G->numVertexes;++i)//初始化邻接矩阵,除对角线元素 = 0,其余为INFINITY;
{
for(j = 0;j < G->numVertexes;++j)
{
if(i == j)
{
G->arc[i][j] = 0;
}
else
{