Gets nodes that have no output connections (leaf nodes)
List<Node<T>> getLeafNodes() { return nodes .where((node) => getOutputConnections(node.id).isEmpty) .toList(); }