join elements on set edges