@Test public void testRandomSelfLoops() { Global.randomSeed(); UTGraph<String, String> graph = RandomGraphs.random(30, 16); assertFalse(Graphs.hasSelfLoops(graph)); System.out.println(graph); System.out.println(Graphs.shuffle(graph)); }
public static UTGraph<String, String> random(int n, double prob) { MapUTGraph<String, String> graph = new MapUTGraph<String, String>(); List<UTNode<String, String>> nodes = new ArrayList<UTNode<String, String>>(n); for(int i : series(n)) nodes.add(graph.add("x")); for(int i : series(n)) for(int j : series(i+1, n)) if(Global.random().nextDouble() < prob) nodes.get(i).connect(nodes.get(j)); return graph; }
RandomGraphs { public static UTGraph<String, String> random(int n, double prob) { MapUTGraph<String, String> graph = new MapUTGraph<String, String>(); List<UTNode<String, String>> nodes = new ArrayList<UTNode<String, String>>(n); for(int i : series(n)) nodes.add(graph.add("x")); for(int i : series(n)) for(int j : series(i+1, n)) if(Global.random().nextDouble() < prob) nodes.get(i).connect(nodes.get(j)); return graph; } }
RandomGraphs { public static UTGraph<String, String> random(int n, double prob) { MapUTGraph<String, String> graph = new MapUTGraph<String, String>(); List<UTNode<String, String>> nodes = new ArrayList<UTNode<String, String>>(n); for(int i : series(n)) nodes.add(graph.add("x")); for(int i : series(n)) for(int j : series(i+1, n)) if(Global.random().nextDouble() < prob) nodes.get(i).connect(nodes.get(j)); return graph; }  }
RandomGraphs { public static UTGraph<String, String> random(int n, double prob) { MapUTGraph<String, String> graph = new MapUTGraph<String, String>(); List<UTNode<String, String>> nodes = new ArrayList<UTNode<String, String>>(n); for(int i : series(n)) nodes.add(graph.add("x")); for(int i : series(n)) for(int j : series(i+1, n)) if(Global.random().nextDouble() < prob) nodes.get(i).connect(nodes.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 UTGraph<String, String> random(int n, double prob) { MapUTGraph<String, String> graph = new MapUTGraph<String, String>(); List<UTNode<String, String>> nodes = new ArrayList<UTNode<String, String>>(n); for(int i : series(n)) nodes.add(graph.add("x")); for(int i : series(n)) for(int j : series(i+1, n)) if(Global.random().nextDouble() < prob) nodes.get(i).connect(nodes.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; }