@Test public void randomTest() { for (int i = 1; i < 100; i++) { EdgeWeightedGraph graph = buildRandomConnectedGraph(i); EagerPrim test = new EagerPrim(graph); PrimMST expect = new PrimMST(graph); assertTrue(info(test, expect), Math.abs(test.weight() - expect.weight()) < FLOATING_POINT_EPSILON); System.out.println("pass " + i); } }
@Override public double weight() { return weight; }
EagerPrim implements MST { @Override public double weight() { return weight; } }
EagerPrim implements MST { @Override public double weight() { return weight; } EagerPrim(EdgeWeightedGraph G); }
EagerPrim implements MST { @Override public double weight() { return weight; } EagerPrim(EdgeWeightedGraph G); @Override Iterable<Edge> edges(); @Override double weight(); }
EagerPrim implements MST { @Override public double weight() { return weight; } EagerPrim(EdgeWeightedGraph G); @Override Iterable<Edge> edges(); @Override double weight();  }