摘要: 思路:blleman—ford检验负回路代码:#include#include#includeusing namespace std;struct infor{ int from; int to; double r; double c;};infor es[20008];double dis[200],v;int enu,n,s;bool bellman(){ memset(dis,0,sizeof(dis)); dis[s]=v; for(int i=0;i>n>>m>>s>>v; for(int i=0;i>a>>b>> 阅读全文
posted @ 2013-11-08 17:16 Neptunes 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 思路:bellman-ford检验正回路代码:#include#include#includeusing namespace std;struct infor{ int from; int to; double r; double c;};infor es[20008];double dis[200],v;int enu,n,s;bool bellman(){ memset(dis,0,sizeof(dis)); dis[s]=v; for(int i=0;i>n>>m>>s>>v; for(int i=0;i>a>>b>> 阅读全文
posted @ 2013-11-08 17:10 Neptunes 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 思路:Dijkstra代码:#include#include#include#includeusing namespace std;struct infor{ int x; int y;};int t,n=0;infor stone[202];double d(int x,int y){ return sqrt(x*x+y*y);}double dis[201];double map[202][202];bool visit[202];using namespace std;void dijkstra(){ while(true){ double m=10... 阅读全文
posted @ 2013-11-08 17:07 Neptunes 阅读(195) 评论(0) 推荐(0) 编辑