main.cpp

来自「在VC的环境下」· C++ 代码 · 共 27 行

CPP
27
字号
#include <afxwin.h>
#include <iostream.h>
#include <time.h>
#include "SearchLib.h"

void main()
{
	ALGRAPH graph;
	
//	srand((unsigned int)time(NULL));
	
	CreateRandomGraph(graph);

	list<int> listShortestPath;
	
	STUDYRESULT resultPath;

	int a = GetTickCount();
	Dual_ShortestPath_AStart(graph, 0, MAX_VERTEX_NUM-1, listShortestPath, resultPath);
	int b = GetTickCount();

	cout<<"耗时: "<<b-a<<endl;
	cout<<"最短路径长度是: "<<resultPath.dCostSumOnASelectedPath<<endl;
	cout<<"扩展的节点: "<<resultPath.nNumberOfExpandedNode<<endl;
	cout<<"最短路径上的节点数: "<<resultPath.nNodeNumberOnASelectedPath<<endl;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?