好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

动态规划之最短路径源代码.docx

5页
  • 卖家[上传人]:杨***
  • 文档编号:281802734
  • 上传时间:2022-04-24
  • 文档格式:DOCX
  • 文档大小:20.92KB
  • / 5 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    •     动态规划之最短路径源代码-    动态规划之最短路径问题源代码#include "stdio.h"#include "conio.h"#define n 16 /*图的顶点数*/#define k 7 /*图的段数*/#define l 30#define MAX 100typedef int NodeNumber;/*节点编号*/typedef int CostType;/*成本值类型*/CostType cost[n][n];NodeNumber path[k];NodeNumber cur=-1;void creategraph(CostType *cost[n][n]) /*创建图的成本矩阵*/ {int i,j,x,y,value;for(i=0;i=0;i--){ leng=MAX;for(j=i+1;j<=n-1;j++)if(cost[i][j]>0 && (cost[i][j]+v[j])=0;i--){ leng=MAX;for(j=i+1;j<=n-1;j++)if(cost[i][j]>0 && (cost[i][j]+v[j])

      点击阅读更多内容
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.