摘要: 最短路问题是一种常见的问题,她一般被描述为包含n个点和m,主要分为两类:(1)(单源最短路径)求解从起点s到终点e的最短路径(2)(多源最短路径)求解图中任意两点的最短路径。常用的解题算法有四种:Dijkstra,bellman-ford,spfa,Floyd 阅读全文
posted @ 2014-08-23 10:09 HuberyQian 阅读(230) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #define INF 0x3f3f3f3fusing namespace std;struct node{ int u,v,w,next;}edge[150001];int head[30001],dis[30001],... 阅读全文
posted @ 2014-08-23 09:21 HuberyQian 阅读(265) 评论(0) 推荐(0) 编辑