Basic implementation for connecting two vertices