#ifndef __GRAPH_H__
#define __GRAPH_H__
#include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;

typedef long int vid;
typedef long int eid;

typedef struct edge{
	int nodef,nodet;
	long edgeID;
//	double inFlow;
//	double outFlow;
	int direction;
}edge;					//有向图边

typedef struct vertex{
	vid id;
	double la;  //latitude
	double lo;   //longtitude
	vector<edge> e; //Edges associated with the vertex
}vertex;					//图顶点


/**************************************Graph(时空图)类：*****************************************/
class Graph
{
	public:
		map<vid, vertex> sg;    //时空图
		map<eid,edge> eg;

	public:
		Graph();

		void InsertVertex(vid id, double la, double lo);		//插入顶点
		void InsertEdge(int edgeID, vid id1, vid id2, double inFlow, double outFlow,int direction);		//插入边
		//vertex* select_vertex(vid id);		//选择顶点
		//edge* select_edge(vertex* v, vid id);			//选择一个顶点的一条边
		//vertex* graph_get();		//获取图的指针
		//long int graph_size();			//获取图的顶点个数
		void Clear();
		void Visual(int size);			//打印图
};

#endif