1 Star 1 Fork 0

pocket/算法基础

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.cpp 826 Bytes
一键复制 编辑 原始数据 按行查看 历史
pocket 提交于 2021-12-30 14:38 +08:00 . No commit message
#include "Johnson.hpp"
#include <ctime>
#define N_VERTEX 27
void run(){
time_t time = 0;
vector<vector<int>> weight;
for (size_t i = 0; i < N_VERTEX; i++)
{
vector<int> row;
for (size_t j = 0; j < N_VERTEX; j++)
{
int a;
scanf("%d,", &a);
row.push_back(a);
}
weight.push_back(row);
}
for (size_t i = 0; i < 100; i++)
{
auto w = weight;
auto G = Weight_Directed_Graph(w);
auto J = Johnson();
time_t begin, end;
begin = clock();
auto D_PI = J.run_Johnson(&G, &w);
end = clock();
if (i == 99)
{
J.output_Johnson_result(&D_PI);
}
time += end - begin;
}
cout << "time =" << time << endl;
}
int main(){
run();
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/mcpocket/algorithm.git
git@gitee.com:mcpocket/algorithm.git
mcpocket
algorithm
算法基础
master

搜索帮助