(int n)
| 39 | public class GraphTest { |
| 40 | |
| 41 | private static Graph<Integer> genRandomGraph(int n) { |
| 42 | SimpleGraph<Integer> graph = new SimpleGraph<>(); |
| 43 | Random random = new Random(System.currentTimeMillis()); |
| 44 | for (int i = 0; i < n; ++i) { |
| 45 | graph.addNode(i); |
| 46 | } |
| 47 | for (int i = 0; i < 2 * n; ++i) { |
| 48 | graph.addEdge(random.nextInt(n), random.nextInt(n)); |
| 49 | } |
| 50 | return graph; |
| 51 | } |
| 52 | |
| 53 | @Test |
| 54 | void testSimpleGraph() { |