資源簡介
代價一致的寬度搜索、有限制的深度優先搜索、A*算法、貪婪算法解決羅馬尼亞度假問題!
代碼片段和文件信息
const?int?MaxVertices?=?100; //圖中的最大頂點數目
const?int?MaxWeight?=?1000; //無窮大的權值
const?int?MaxQueueSize?=?100; //順序循環隊列的最大元素數目
typedef?int?WT; //圖中邊權值類型WT
struct?RowColWeight
{
int?row; //行下標
int?col; //列下標
WT?weight; //權值
};
using?namespace?std;
#include??
#include?
#include?
#include?
#include?
#include?
#include?
#include?“SeqList.h“ //包含動態數組結構的順序表類
#include?“SeqQueue.h“ //包含靜態數組結構的順序隊列類
#include?“AdjMWGraph.h“ //鄰接矩陣的圖類
#include?“CreatAdjWGraph.h“ //鄰接矩陣的圖類、鄰接表的圖類的構造
void?PrintItem(string?item) //輸出頂點數據域
{
cout?<}
void?main()
{
while(1){
int?num=0;
AdjMWGraph?G;
vector?rowcolweight_vec;
vector?vertex_vec;
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-12-02?18:40??人工智能\
?????目錄???????????0??2015-11-19?12:56??人工智能\人工智能\
?????文件???????18617??2015-11-15?13:21??人工智能\人工智能\AdjMWGraph.h
?????文件?????????334??2015-10-31?12:27??人工智能\人工智能\CreatAdjWGraph.h
?????文件????????1980??2014-10-31?00:03??人工智能\人工智能\SeqList.h
?????文件????????1461??2014-10-29?11:42??人工智能\人工智能\SeqQueue.h
?????文件????????3435??2015-11-19?12:53??人工智能\人工智能\main.cpp
?????文件????????4279??2015-11-19?12:54??人工智能\人工智能\人工智能.vcxproj
?????文件????????1340??2015-10-27?19:04??人工智能\人工智能\人工智能.vcxproj.filters
?????文件????????3816??2015-10-31?12:11??人工智能\人工智能\數據.txt
?????文件?????????316??2015-10-31?12:18??人工智能\人工智能\貪婪數據.txt
?????文件?????????903??2015-10-27?19:02??人工智能\人工智能.sln
?????文件???????54784??2015-11-15?14:08??人工智能\人工智能.v11.suo
?????文件???????54784??2015-11-20?13:12??人工智能\人工智能.v12.suo
- 上一篇:基于STM32f4的無感BLDCM控制程序
- 下一篇:簡化牛頓法
評論
共有 條評論