{"width":"100%","categories":["Ruby","\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0"],"url":"https://obelisk.hatenablog.com/entry/2017/08/07/180132","blog_title":"Camera Obscura","description":"\u524d\u30a8\u30f3\u30c8\u30ea\u3067\u306f\u9589\u8def\u306a\u3057\u6709\u5411\u30b0\u30e9\u30d5\uff08DAG\uff09\u306e\u5834\u5408\u306b\u6700\u77ed\u7d4c\u8def\u3092\u6c42\u3081\u3066\u307f\u307e\u3057\u305f\u304c\u3001\u30c0\u30a4\u30af\u30b9\u30c8\u30e9\u6cd5\u306f\u9589\u8def\u304c\u3042\u308a\u3001\u304b\u3064\u8fba\u306e\u91cd\u307f\u304c\u975e\u8ca0\u306e\u5834\u5408\u306b\u6700\u77ed\u7d4c\u8def\u3092\u6c42\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u5165\u51fa\u529b\u306f\u3001\u9589\u8def\u304c\u3042\u3063\u3066\u8fba\u306e\u91cd\u307f\u304c\u975e\u8ca0\u3067\u3042\u308b\u4ee5\u5916\u3001DAG \u306e\u5834\u5408\u3068\u540c\u3058\u306a\u306e\u3067\u3001\u305d\u3061\u3089\u3092\u898b\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 dijkstra.rb def dijkstra(graph, start) h = graph.map {|x| [x[0], x[1].keys]}.to_h shortest = Hash.new(F\u2026","author_url":"https://blog.hatena.ne.jp/obelisk2/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fobelisk.hatenablog.com%2Fentry%2F2017%2F08%2F07%2F180132\" title=\"\u30c0\u30a4\u30af\u30b9\u30c8\u30e9\u6cd5\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>","blog_url":"https://obelisk.hatenablog.com/","type":"rich","published":"2017-08-07 18:01:32","provider_name":"Hatena Blog","height":"190","image_url":"http://img.f.hatena.ne.jp/images/fotolife/o/obelisk2/20170807/20170807175016.png","version":"1.0","provider_url":"https://hatena.blog","title":"\u30c0\u30a4\u30af\u30b9\u30c8\u30e9\u6cd5\uff08Ruby\uff09","author_name":"obelisk2"}