There are lot of rectangles ; each one will have lower left and upper right co-ordinates. And they are either overlapping (fully or partially ) or touching at-least one edge with other one.
Am looking for how to come up with a trace from start to end blocks by tracing each rectangles in sequence. Lets say there it an identifier (co-ordinates) both at start and end blocks, which can say that trace has started and ended.
In the image below, I need to trace such that i get rectangles numbering 1 , 2, 3, 4, 5 in sequence. Please let me know what is the best way to approach this ? and are there any already available modules which fits into this problem statement?
And also, next thing is , if there are multiple end points, how to come up with all the paths traced from single start to multiple end blocks ?