/******************************************************************************
Copyright ©, 1988-2012
File name: mgraph.h
Author: libin
Version: 1.0.0.1
Date: 2011-12-01
Description: 图的邻接实现
Others: 无
******************************************************************************/
#ifndef _MGRAPH_H
#define _MGRAPH_H
#ifdef __cplusplus
extern "C" {
#endif /* __cpluscplus */
#define MaxVertexNum 100 /*最大顶点数设为100*/
typedef char VertexType; /*顶点类型设为字符型*/
typedef int EdgeType; /*边的权值设为整型*/
typedef struct
{
VertexType vexs[MaxVertexNum]; /*顶点表*/
EdgeType edges[MaxVertexNum][MaxVertexNum]; /*邻接矩阵,即边表*/
int vertex; /*顶点数*/
int side; /*边数*/
}Mgragh; /*Maragh是以邻接矩阵存储的图类型*/
/******************************************************************************
Function: CreateMGraph
Description: 建立有向图G的邻接矩阵存储
Input: MGraph *G 指向邻接矩阵图指针
Output: 无
Return: 无
Others: 无
******************************************************************************/
void CreateMGraph(Mgragh* grap);
#ifdef __cplusplus
}
#endif /* __cpluscplus */
#endif