inSameSubNetwork(node1, node2) {
    return this.trees[node1.id] === this.trees[node2.id];
  }
Check if two nodes are in the same tree.
@param {Node} node1
@param {Node} node2
@returns {boolean} true if this is so, false otherwise