1 auto g1 = Graph!(int, void, Yes.isDirected)([1, 2, 3]); 2 3 g1 ~= g1.edge(1, 1); 4 g1 ~= g1.edge(1, 2); 5 g1 ~= g1.edge(2, 2); 6 g1 ~= g1.edge(2, 3); 7 8 assert(g1.inDegree(1) == 1); 9 assert(g1.outDegree(1) == 2); 10 assert(g1.inDegree(2) == 2); 11 assert(g1.outDegree(2) == 2); 12 assert(g1.inDegree(3) == 1); 13 assert(g1.outDegree(3) == 0);
Get the in/out degree of node n.