There are checks for validity of all edges. There's a binary heap of starting points (placed vertices), which is sorted on number of placed vertices and then on least dislikes. Then it will pick the most constrained vertex and add the valid positions for that.