リポジトリ 計算結果(最短距離とバックポインタ) 最短経路はbuildPath()で復元。 /** Results of All-Pairs Shortest Path (APSP) Algorithm */ public static class APSPResult{ private int[][] dist; // dist[d]:= shortest path to d private int[][] prev; // back pointers private boolean hasNegativeCycle; public APSPResult(int[][] dist, int[][] prev, boolean hasNegativeCycle){ set(dist, prev, hasNegativeCycle); } final private void set(int