摘要: A*算法求第k短路流程:1)计算h[],即当前点到t的估计值 若为有向图,建立反向图求出h[]。若为无向图,可直接求解h[]。可通过SPFA求解。2)A*搜索 每次找到新节点就直接加入队列,计算出估价函数f[]=g[]+h[],然后加入优先队列中。(此步不可优化,否则可能造成失解) 常用STL... 阅读全文
posted @ 2014-09-04 15:10 Estimator 阅读(235) 评论(0) 推荐(0) 编辑
摘要: POJ 3253 Fence RepairSTL堆操作我想说,STL里堆是我目前见到最蛋疼的操作。#include #include #include #include #include #include #include #include #include #include #include #d... 阅读全文
posted @ 2014-09-04 12:46 Estimator 阅读(341) 评论(0) 推荐(0) 编辑