TAG: connect the dots of same color without crossing the lines