{"published":"2009-07-29 07:24:43","categories":["Python"],"image_url":null,"title":" \u52dd\u624b\u306b\u63a1\u70b9 (Re: \u81ea\u5206\u306a\u3089\u3053\u3046\u66f8\u304f - python\u3067A*)","height":"190","blog_url":"https://methane.hatenablog.jp/","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmethane.hatenablog.jp%2Fentry%2F20090729%2F1248819883\" title=\" \u52dd\u624b\u306b\u63a1\u70b9 (Re: \u81ea\u5206\u306a\u3089\u3053\u3046\u66f8\u304f - python\u3067A*) - methane\u306e\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"methane\u306e\u30d6\u30ed\u30b0","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/methane/","width":"100%","type":"rich","description":"\u81ea\u5206\u306a\u3089\u3053\u3046\u66f8\u304f - python\u3067A* - \u30e9\u30b7\u30a6\u30e9\u3088\u308a def astar(init, goal, nexts, distance=lambda path: len(path), heuristic=lambda pos: 0): import heapq queue = [] checked = [init] heapq.heappush(queue, (distance([init]) + heuristic(init), [init])) while len(queue) > 0: score, path = heapq.heappop(queue) last = path[-1] \u2026","url":"https://methane.hatenablog.jp/entry/20090729/1248819883","author_name":"methane","provider_name":"Hatena Blog"}