@Test public void testRandomDirected() { for(int i : series(100)) { DGraph<?> g = RandomGraphs.randomDirectedFast(100, 220); assertEquals(g.numLinks(), Graphs.toSimpleDGraph(g).numLinks()); } }
public static DTGraph<String, String> randomDirected(int n, double prob) { MapDTGraph<String, String> graph = new MapDTGraph<String, String>(); for(int i : series(n)) graph.add("x"); for(int i : series(n)) for(int j : series(n)) if(i != j && Global.random().nextDouble() < prob) graph.get(i).connect(graph.get(j)); return graph; }
RandomGraphs { public static DTGraph<String, String> randomDirected(int n, double prob) { MapDTGraph<String, String> graph = new MapDTGraph<String, String>(); for(int i : series(n)) graph.add("x"); for(int i : series(n)) for(int j : series(n)) if(i != j && Global.random().nextDouble() < prob) graph.get(i).connect(graph.get(j)); return graph; } }
RandomGraphs { public static DTGraph<String, String> randomDirected(int n, double prob) { MapDTGraph<String, String> graph = new MapDTGraph<String, String>(); for(int i : series(n)) graph.add("x"); for(int i : series(n)) for(int j : series(n)) if(i != j && Global.random().nextDouble() < prob) graph.get(i).connect(graph.get(j)); return graph; }  }
RandomGraphs { public static DTGraph<String, String> randomDirected(int n, double prob) { MapDTGraph<String, String> graph = new MapDTGraph<String, String>(); for(int i : series(n)) graph.add("x"); for(int i : series(n)) for(int j : series(n)) if(i != j && Global.random().nextDouble() < prob) graph.get(i).connect(graph.get(j)); return graph; }  static UTGraph<String, String> preferentialAttachment(int nodes, int toAttach); static DTGraph<String, String> preferentialAttachmentDirected(int nodes, int toAttach); static UTGraph<String, String> random(int n, double prob); static UTGraph<String, String> random(int n, int m); static UGraph<String> randomFast(int n, int m); static DGraph<String> randomDirectedFast(int n, int m); static DTGraph<String, String> randomDirected(int n, double prob); static UTGraph<String, String> fractal(
			int depth, int offspring, int interLinks, double hubProb); static Pair<Integer, Integer> toPairUndirected(long index, boolean self); }
RandomGraphs { public static DTGraph<String, String> randomDirected(int n, double prob) { MapDTGraph<String, String> graph = new MapDTGraph<String, String>(); for(int i : series(n)) graph.add("x"); for(int i : series(n)) for(int j : series(n)) if(i != j && Global.random().nextDouble() < prob) graph.get(i).connect(graph.get(j)); return graph; }  static UTGraph<String, String> preferentialAttachment(int nodes, int toAttach); static DTGraph<String, String> preferentialAttachmentDirected(int nodes, int toAttach); static UTGraph<String, String> random(int n, double prob); static UTGraph<String, String> random(int n, int m); static UGraph<String> randomFast(int n, int m); static DGraph<String> randomDirectedFast(int n, int m); static DTGraph<String, String> randomDirected(int n, double prob); static UTGraph<String, String> fractal(
			int depth, int offspring, int interLinks, double hubProb); static Pair<Integer, Integer> toPairUndirected(long index, boolean self); static final int BA_INITIAL; }