checkUndirected<V, E> static method

void checkUndirected<V, E>(
  1. Graph<V, E> graph, [
  2. String? name
])

Asserts that graph is undirected.

Implementation

static void checkUndirected<V, E>(Graph<V, E> graph, [String? name]) {
  if (graph.isDirected) {
    throw GraphError(graph, name, 'Graph must be undirected');
  }
}