MCPcopy Create free account
hub / github.com/LFYSec/MScan / genRandomGraph

Method genRandomGraph

src/test/java/pascal/taie/util/graph/GraphTest.java:41–51  ·  view source on GitHub ↗
(int n)

Source from the content-addressed store, hash-verified

39public 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() {

Callers

nothing calls this directly

Calls 2

addNodeMethod · 0.95
addEdgeMethod · 0.95

Tested by

no test coverage detected