code: function tagNodesWithIds (data) {
    let id = 0
    const idsToNodes = new Map()
    const nodesToIds = new Map()
    tagNodes(data)
  
    return {
      idsToNodes,
      nodesToIds
    }
  
    function tag (node) {
      idsToNodes.set(id, node)
      nodesToIds.set(node, id)
      id++
    }
    function tagNodes (node) {
      tag(node)
      if (node.children) node.children.forEach(tagNodes)
    }
  }
docs: This just uses incrementing IDs but it will only be used for a single dataset, and it's deterministic enough for that