Check if tubes can connect to each other and merge/split accordingly