<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>caligue</author_name>
  <author_url>https://blog.hatena.ne.jp/caligue/</author_url>
  <blog_title>caligue’s blog</blog_title>
  <blog_url>https://caligue.hatenadiary.org/</blog_url>
  <categories>
    <anon>algorithm</anon>
  </categories>
  <description>全点対最短経路問題(All-Pairs Shortest Paths Problem)において、Floyd-Warshall法などで最短経路の距離行列が求められている場合に、その最短距離行列から対応する経路行列を構築するアルゴリズムについてのメモ。アルゴリズムはO(n^3)のアルゴリズムで単純な実装ではFloyd-Warshall法と同程度の計算処理時間がかかる。以下はCによる実装例。 void construct_aps_path(const int n, const int **A, const int **D, int **P) { for (int i = 0; i &lt; n; i++)…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcaligue.hatenadiary.org%2Fentry%2F20110303%2F1299107118&quot; title=&quot;最短経路の距離行列から経路行列を構築するアルゴリズム - caligue’s blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2011-03-03 08:05:18</published>
  <title>最短経路の距離行列から経路行列を構築するアルゴリズム</title>
  <type>rich</type>
  <url>https://caligue.hatenadiary.org/entry/20110303/1299107118</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
