-和尚-

导航

2012年8月5日 #

Play on Words

摘要: 题目:DescriptionSome of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, the puzzle is very important for us.There is a large number of magnetic plates on every door. Every plate has 阅读全文

posted @ 2012-08-05 17:04 -和尚- 阅读(238) 评论(0) 推荐(0) 编辑

匈牙利算法

摘要: 本文来自:http://www.byvoid.com/blog/hungary/这是一种用增广路求二分图最大匹配的算法。它由匈牙利数学家Edmonds于1965年提出,因而得名。 定义 未盖点:设Vi是图G的一个顶点,如果Vi 不与任意一条属于匹配M的边相关联,就称Vi 是一个未盖点。交错路:设P是图G的一条路,如果P的任意两条相邻的边一定是一条属于M而另一条不属于M,就称P是一条交错路。可增广路:两个端点都是未盖点的交错路叫做可增广路。流程图伪代码:bool 寻找从k出发的对应项出的可增广路{ while (从邻接表中列举k能关联到顶点j) { if (j不在增广路上) { 把j加入增广路; 阅读全文

posted @ 2012-08-05 16:06 -和尚- 阅读(160) 评论(0) 推荐(0) 编辑