inDegree method

int inDegree(
  1. Vertex<T> vertex
)

Returns the number of incoming directed edges for vertex.

Implementation

int inDegree(Vertex<T> vertex) {
  var inDegree = 0;
  for (final connectedVertices in _edges.values) {
    inDegree =
        inDegree + connectedVertices.where((value) => value == vertex).length;
  }
  return inDegree;
}