checkVertexCount<V, E> static method

void checkVertexCount<V, E>(
  1. Graph<V, E> graph,
  2. int count, [
  3. String? name
])

Asserts that graph has at least at least count vertices.

Implementation

static void checkVertexCount<V, E>(Graph<V, E> graph, int count,
    [String? name]) {
  if (graph.vertices.length < count) {
    throw GraphError(graph, name, 'Graph must have at least $count vertices');
  }
}