@Test public void testDistanceIntInt() { Graph<String> graph = Graphs.k(10, "x"); FloydWarshall<String> fw = new FloydWarshall<String>(graph); for(Node<String> a : graph.nodes()) for(Node<String> b : graph.nodes()) assertEquals(a.equals(b) ? 0 : 1, fw.distance(a.index(), b.index())); }
public int distance(int i, int j) { return distances[i][j]; }
FloydWarshall implements Distance<Node<L>> { public int distance(int i, int j) { return distances[i][j]; } }
FloydWarshall implements Distance<Node<L>> { public int distance(int i, int j) { return distances[i][j]; } FloydWarshall(Graph<L> graph); }
FloydWarshall implements Distance<Node<L>> { public int distance(int i, int j) { return distances[i][j]; } FloydWarshall(Graph<L> graph); int distance(int i, int j); double meanDistance(); double diameter(); @Override double distance(Node<L> a, Node<L> b); RealMatrix matrix(); }
FloydWarshall implements Distance<Node<L>> { public int distance(int i, int j) { return distances[i][j]; } FloydWarshall(Graph<L> graph); int distance(int i, int j); double meanDistance(); double diameter(); @Override double distance(Node<L> a, Node<L> b); RealMatrix matrix();  }