int i,j,x_c,y_c; if(path_num>=MAX_V_NUM) return; if(path[k] == fid) { int match=1; if(k>1) //道路数至少两条 { //判断是否全是人/车行道 for(i=1;i<=k;i++) if(G.arcs[path[i-1]][path[i]].kind != kind) { match = 0; break; } if(match == 1) { int m,can_stop=0,can_go=0,is_include; if(path_num == 0)//如果全局路径数组里没有路径 { for(m=0;m<=k;m++) path_kh[0][m] = path[m]; path_kh_vnum[0] = k+1; path_num++; } else { for(i=0;i 30 if(can_go != 1)//path数组作为新路径覆盖 { for(m=0;m 31 该条路径顶点数 path_num++; } }//end if }//end if }//end if } else { for(j=0;j //类别判断较长路径是否完全包含较短路径 int DFS_allpath_kh_isinclude(int bz_i,int pa_k,int kind) //[bz_i]:当前进行比较的标准数组的i值 [pa_k]:path数组的k值 [kind]:较长(0:标准路径 1.path路径) { int m,i,l_num,s_num,l_road[MAX_V_NUM],s_road[MAX_V_NUM],match=0,first; //赋值两种路径各自的信息 if(kind == 0) { l_num = path_kh_vnum[bz_i]; s_num = pa_k+1; for(m=0;m 32 } //判断较长路径中包含较短路径顶点的个数 for(m=0;m else return 0; } 33
题目8:全国铁路运输网最佳经由问题 - 图文(7)
2019-05-17 16:59
题目8:全国铁路运输网最佳经由问题 - 图文(7).doc
将本文的Word文档下载到电脑
下载失败或者文档不完整,请联系客服人员解决!