Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jerrychen97/tsp_branch_and_bound

旅行商问题,采用分支定界法求解Sovling TSP problem with the method of Branch and Bound
https://github.com/jerrychen97/tsp_branch_and_bound

Last synced: 13 days ago
JSON representation

旅行商问题,采用分支定界法求解Sovling TSP problem with the method of Branch and Bound

Awesome Lists containing this project

README

        

# TSP_Branch_and_Bound
Sovling TSP problem with the method of Branch and Bound

## 解决TSP问题的分支定界法类
### 使用说明
先通过BranchAndBound(int VertexNum, int EdgeNum, vector initEdge)初始化该类

其中VertexNum为节点数目,EdgeNum为边的数目,initEdge为所有边组成的向量

注意边的编号从0开始,节点的编号也是从0开始

getHLoopLength()返回最短H回路的大小

FinalHLoop[0]--FinalHLoop[VertexNum]中存储着最短哈密顿回路中各边的编号

通过printFinalResult()即可打印结果