#include#define MAX_VERTEX_NUM 20
#define INFINITY 32768
#define ERROR -1
typedef enum {DG,DN,UDG,UDN} GraphKind;
typedef char VertexData;
typedef struct ArcNode
{
int adj; /*权值类型*/
char info;
}ArcNode;
typedef struct{
VertexData vertex[MAX_VERTEX_NUM];
ArcNode arcs[MAX_VERTEX_NUM][MAX_VERTEX_NUM];/*邻接矩阵*/
int vexnum,arcnum;
//GraphKind kind;
}AdjMatrix;
int LocateVertex(AdjMatrix *G,VertexData v)
{
int j = ERROR,k;
for(k = 0;k< G -> vexnum;k ++)
{
if(G -> vertex[k] == v )
{
j = k;
break;
}
}
return (j);
}
void CreatDN(AdjMatrix *G)
{
int i,j,k,weight;
VertexData v1,v2;