hasSameParent(node1, node2) {
    const parents1 = this.parentReference[node1.id];
    const parents2 = this.parentReference[node2.id];
    if (parents1 === undefined || parents2 === undefined) {
      return false;
    }

    for (let i = 0; i < parents1.length; i++) {
      for (let j = 0; j < parents2.length; j++) {
        if (parents1[i] == parents2[j]) {
          return true;
        }
      }
    }
    return false;
  }
Check if two nodes have the same parent(s)
@param {Node} node1
@param {Node} node2
@returns {boolean} true if the two nodes have a same ancestor node, false otherwise