Welcome![Sign In][Sign Up]
Location:
Search - c BranchAndBound priority_queue

Search list

[OtherBranchAndBound

Description: 本程序是用分支定界法求最短路径的程序,用C++编写。采取的基本思想是:使用最小优先队列分支界限法来构建程序,细节是对于每个节点,包含三个变量:当前走过的路径长度、当前的花费和该节点对应的实际城市的编号。关于确定节点优先级,我们规定首先以“当前走过的路径长度”来确定优先级,当路径长度相等时,以“当前的花费”来确定优先级。同时,我们还定义两个数组dist[i]和pric[i]保存当前求得的从源城市到每个城市的最短距离和花费,用于剪枝时的评判标准。-This procedure is to use branch and bound procedure for seeking the shortest path, using C++ to implement. The basic idea is: Using the minimum priority queue Branch and Bound method to build a program, the details are: for each node, containing three varibles: the current path length traversed, the current cost and the node number corresponding to the actual city. On the determination of priorities, we first use the current path length traversed to determine the priority if the path length is equal, then current cost is used to determine priority. At the same time, we also define two arrays dist [i] and the pric [i] to save the current shortest distance and cost from the source city to every other city . This will be used as the evaluation criterion when pruning.
Platform: | Size: 61440 | Author: 李贺 | Hits:

CodeBus www.codebus.net