UndirectedPointGraph.fromAdjacencyList(List<List<PointNode>> adjacencyList)

Conveinience constructor, that calls .addAdjacency for each element of adjacencyList.

Source

UndirectedPointGraph.fromAdjacencyList(List<List<PointNode>> adjacencyList) {
  if (adjacencyList is! List) {
    throw new ArgumentError('Argument `adjacencyList` must be of type List!');
  }

  for (List<PointNode> adjacencyPair in adjacencyList) {
    if (adjacencyPair is! List) {
      throw new ArgumentError('Every element of argument `adjacencyList` must be a list!');
    }

    if (adjacencyPair.length != 2) {
      throw new ArgumentError('Every list element of `adjacencyList` must be length 2!');
    }

    this.addAdjacency(adjacencyPair[0], adjacencyPair[1]);
  }
}