#include <iostream>
#include<iomanip>
#include <string>
#include<queue>
using namespace std;
//图的邻接矩阵存储表示
#define MAX_VERTEX_NUM 50
typedef enum { DG, DN, UDG, UDN } GraphKind; //{有向图,有向网,无向图,无向网}
typedef enum { OK, ERROR } Status;
typedef struct ArcCell{
int adj;
//顶点关系类型。对于无权图,用0或1表示相邻否。对于有权图,则为权值类型。
string info;
//该弧所携带的信息
}ArcCell, AdjMatrix[MAX_VERTEX_NUM][MAX_VERTEX_NUM];
typedef struct {
int vexs[MAX_VERTEX_NUM];
//顶点向量
AdjMatrix arcs;
//邻接矩阵
int vexnum, arcnum;
//图的当前顶点数和弧数
GraphKind kind;
//图的种类标志
}MGraph;
bool visited[MAX_VERTEX_NUM];
//设访问标志数组,供遍历时使用
void DFS(MGraph G, int v);
void VisitFunc(int v);
int FirstAdjVex(MGraph G, int v);
int NextAdjVex(MGraph G, int v, int w);
void CreateUDGTest(MGraph &G)
{
//构造一个测试用的无