/// <summary>
        /// Connects
        /// </summary>
        /// <param name="node"></param>
        /// <param name="direction"></param>
        /// <returns></returns>
        public IGraphVertex <T> ConnectNode(IGraphNode <T> node, IoDirection direction)
        {
            var vertex = this.Vertices.FirstOrDefault((x) => x.HasRelation(this, node));

            if (vertex == null)
            {
                vertex = new GraphVertex <T>(this, node, direction);
                this.RegisterVertex(vertex);
                node.RegisterVertex(vertex);
            }

            return(vertex);
        }