Connecting sub trees and datas

Dear friends,

I m struggling to connecting the 0's to 0's and the related numbers respectively to each from the data. I have attached the image and GH with post.

The blue line in the image shows the connectivity or the lines to be formed. I would like to create a Diagrid from the given points . But whenever i try to connect the points it never goes vertically it always connect 0 to 1 to 2 to 3.

Thanks in advance