You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
test1/图 algraph_text.cpp

29 lines
505 B

#include <iostream>
#include "algraph.h"
using namespace std;
int main()
{
ALGraph<char,int,20> G;
InitGraph(G);
int a = AddVertex(G, 'A');
int b = AddVertex(G, 'B');
int c = AddVertex(G, 'C');
int d = AddVertex(G, 'D');
int e = AddVertex(G, 'E');
AddEdge(G, a, b, 1);
AddEdge(G, a, c, 1);
AddEdge(G, a, b, 1);
AddEdge(G, b, d, 1);
AddEdge(G, c, b, 1);
AddEdge(G, d, c, 1);
AddEdge(G, e, a, 1);
AddEdge(G, e, d, 1);
DestoryGraph(G);
}