maybe name this `computeAssignments` or `selectNodes`