Connect loose ends within the diagram