{"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fobelisk.hatenablog.com%2Fentry%2F2017%2F08%2F08%2F163002\" title=\"\u30d9\u30eb\u30de\u30f3\u2212\u30d5\u30a9\u30fc\u30c9\u30fb\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\uff08Ruby\uff09 - Camera Obscura\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":"http://img.f.hatena.ne.jp/images/fotolife/o/obelisk2/20170808/20170808161948.png","width":"100%","author_name":"obelisk2","description":"\u30d9\u30eb\u30de\u30f3\u2212\u30d5\u30a9\u30fc\u30c9\u30fb\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306f\u3001\u30c0\u30a4\u30af\u30b9\u30c8\u30e9\u6cd5\u306b\u3055\u3089\u306b\u8fba\u306e\u91cd\u307f\u304c\u8ca0\u306e\u5834\u5408\u3082\u542b\u3081\u3066\u6700\u77ed\u7d4c\u8def\u3092\u6c42\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u5165\u51fa\u529b\u306a\u3069\u306f\u30c0\u30a4\u30af\u30b9\u30c8\u30e9\u6cd5\u306e\u5834\u5408\u3092\u53c2\u7167\u3057\u3066\u4e0b\u3055\u3044\u3002\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306f Ruby \u3067\u884c\u3044\u307e\u3057\u305f\u3002\u8fd4\u308a\u5024\u306f\u914d\u5217 [shortest, pred] \u3067\u3001pred \u3092\u898b\u308b\u3068\u6700\u77ed\u7d4c\u8def\u304c\u308f\u304b\u308a\u307e\u3059\u3002 bellman_ford.rb def bellman_ford(g, s) h = g.map {|x| [x[0], x[1].keys]}.to_h shortest = Hash.new(Float::INFINITY) pred = {} shortest[s] = 0 (h.size -\u2026","type":"rich","url":"https://obelisk.hatenablog.com/entry/2017/08/08/163002","height":"190","title":"\u30d9\u30eb\u30de\u30f3\u2212\u30d5\u30a9\u30fc\u30c9\u30fb\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\uff08Ruby\uff09","blog_url":"https://obelisk.hatenablog.com/","version":"1.0","provider_url":"https://hatena.blog","categories":["Ruby","\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0"],"author_url":"https://blog.hatena.ne.jp/obelisk2/","published":"2017-08-08 16:30:02","provider_name":"Hatena Blog","blog_title":"Camera Obscura"}