u
.var g = new HashDigraph[Int]
g.add_arc(1, 3)
g.add_arc(2, 3)
assert g.in_degree(3) == 2
assert g.in_degree(1) == 0
# Returns the number of arcs whose target is `u`.
#
# ~~~
# var g = new HashDigraph[Int]
# g.add_arc(1, 3)
# g.add_arc(2, 3)
# assert g.in_degree(3) == 2
# assert g.in_degree(1) == 0
# ~~~
fun in_degree(u: V): Int do return predecessors(u).length
lib/graph/digraph.nit:401,2--410,58