2012年2月2日
摘要:
//公司有M个顾客,给出每个顾客的发车时间,和起点和终点,如果第i个顾客
//到达之后而第j个顾客还没出发,那么第i辆车就可以去送第j个顾客。。求最少要几辆车。
//这样就比较容易想到最短路径覆盖了。。最短路径覆盖=顶点数-最大匹配数。把可以两个顾客一辆车送的连起来,然后匈牙利算法好了。。 阅读全文
posted @ 2012-02-02 21:48
→木头←
阅读(257)
评论(0)
推荐(0)
摘要:
//基本上能想到二分匹配就能做得出来了。。把第j门课与星期a的第b节课相连,,然后匈牙利算法就直接出来了。。#include <iostream>#include <stdio.h>#include <string.h>using namespace std;int const maxn=500;int mk[maxn] ;int nx, ny;//X和Y集合中顶点的个数int g[maxn][maxn];//邻接矩阵, X集合和Y集合中顶点间边的信息int cx[maxn] , cy[maxn];//cx[i]表示最终求得的最大匹配中与Xi匹配的Y顶点, 阅读全文
posted @ 2012-02-02 16:57
→木头←
阅读(243)
评论(0)
推荐(0)
摘要:
#include<iostream>#include<stdio.h>#include<cmath>#include<algorithm>#include<fstream>using namespace std;#define eps 1e-6struct node{ int x,y;}Queue[55];double Dis(node a,node b){ return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));}double Mul(node a,node b,node c){ r 阅读全文
posted @ 2012-02-02 15:59
→木头←
阅读(257)
评论(0)
推荐(0)
浙公网安备 33010602011771号