if a node have several parent, randomly assign one as its parent