j;Р minDis = distance[j];Р }Р }Р if (minDis == MaxWeight||u==v1)return;Р s[u] = 1; Р for (j = 0; j < n; j++)Р if (s[j] == 0 && G.GetWeight(u, j) < MaxWeight&&Р distance[u] + G.GetWeight(u, j) < distance[j])Р {Р SumExpand++;Р distance[j] = distance[u] + G.GetWeight(u, j);Р path[j] = u;Р }Р Expand = SumExpand;Р?}Р}Р有限制的深度搜索Р从根节点开始若没有超过搜索层数将扩展点的子节点入栈,选择栈顶元素作为下一个扩展点重复,直到栈为空或找到目标节点为止Рvoid Non_recDfs(AdjMWGraph &G, VT a, VT b, vector<int> &path,int *Expand)Р{Р?int tempa = G.IsVertex(a);Р?int tempb = G.IsVertex(b);Р?int n = G.NumOfVertices();Р?int e = G.NumOfEdges();Р?int SumExpand = 0; //扩展节点总数Р?SeqStack<int> S; //节点栈Р?int *visited = new int[n];?//访问节点标记数组Р?int tempw; //记录下一个访问节点Р?memset(visited, 0, n*sizeof(int));Р?S.Push(tempa);Р?visited[tempa] = 1;Р?while (true)Р?{Р int temptop = S.GetTop();