実験で使いそうなベースラインがページランク的なアルゴリズムだったので、Rubyの実装を適当にC++に翻訳してみただけ。超簡単なのでよい。 Rubyでもっとも重要なライブラリは何か?PageRankで計算してみた - aikeの日記 #include <map> #include <cmath> #include <iostream> #include <vector> typedef std::map<int, std::vector<int> > AdjacentMatrix; class PageRank { public: PageRank(AdjacentMatrix graph, int n, double damping = 0.85) { graph_ = graph; N_ = n; damping_ = damping; for (AdjacentMatrix::iter
![C++でページランクを実装 - yasuhisa's blog](https://cdn-ak-scissors.b.st-hatena.com/image/square/8075d165fdb6edd407158f22bbbf15e115e8964f/height=288;version=1;width=512/http%3A%2F%2Fecx.images-amazon.com%2Fimages%2FI%2F418QiJnf16L.jpg)