模拟退火
tomjobs
别慌,慌也没用
展开
-
2021年度训练联盟热身训练赛第一场 A. Weird Flecks, But OK(最小圆覆盖,模拟退火)
题意: 空间有nnn个点,求3种维度中的平面能画出一个圆覆盖所有点的最小直径。 思路: 实际就是在三个维度作最小圆覆盖。模拟退火可以解决最小球覆盖,三维改成二维就是最小圆覆盖了。 不过最小圆覆盖是有Welzl算法的,待补。。。 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> using namespace std; c原创 2021-03-10 23:47:29 · 203 阅读 · 0 评论 -
2018ICPC 南京 Problem D. Country Meow(模拟退火)
思路: 裸的最小球覆盖,直接模拟退火写。 #include <bits/stdc++.h> using namespace std; const int maxn = 1050; const int inf = 0x3f3f3f3f; const double delta = 0.98; const double eps = 1e-7; struct Point { double x,y,z; }a[maxn]; int n; double dist(Point a,Point b){.原创 2021-01-17 23:26:54 · 201 阅读 · 0 评论 -
模拟退火(ACdreamer)
周日的中南多校考了道最小包含多边形的退火题,那就向yddalao学习,学学退火。 模拟退火算法是用来求解最优化问题的算法。比如著名的TSP问题,函数最大值最小值问题等等。接下来将以如下几个方面来详细介绍模拟退火算法。 Contents 模拟退火算法认识 模拟退火算法描述 费马点问题求解 最小包含球问题求解 函数最值问题求解 TSP问题求解 模拟退火算法认识 爬山算法也是...转载 2019-04-02 16:04:06 · 727 阅读 · 0 评论