findRoots method

List<N> findRoots()

Implementation

List<N> findRoots() {
  final childNodes = edges.values.expand((edgeMap) => edgeMap.keys).toSet();
  return nodes.values.where((node) => !childNodes.contains(node.id)).toList();
}