Generally speaking the decision of joining is based on LQI (link quality)
The network is a mesh, not star, in a sense of each node in a network is
allowed to communicate with all the other nodes, be it router or End Device
(each one of them).
May be I'm missing some point?