#include<iostream>
#define Max 30 //图中最大顶点数
#define inital 65535
using namespace std;
template<class T>
class Dijkstra
{
public:
Dijkstra()
{
for (int i = 1; i <= Max; i++)
for (int j = 1; j <= Max; j++)
{
if(i==j)
GraphC[i][j] = 0;
else
GraphC[i][j] = inital;
}
}
void creatGraph(int,int);
void dijkstraTree(int);
void Floyd(int);
private:
int GraphC[Max][Max];//邻接矩阵
T adjlist[Max]; //存储顶点
T mark[Max]; //当前顶点集合
int D[Max];//存储当前点到源点的集合
int A[Max][Max]; //Floyd 存储两个顶点最短路长的矩阵
};
template<class T>
void Dijkstra<T>::creatGraph(int n,int e)
{
for (int i = 1; i <= n; i++)
{
cout << "输入第" << i << "个顶点:";
cin >> adjlist[i];
}
int x, y, w;
for (int k = 1; k <= e; k++)
{
cout << "输入第" << k << "条边(i->j,权值 w):";