Ejemplo n.º 1
0
        public int DelEdge(string name1, string name2)
        {
            int delLength = 0;

            if (list.Contains(name1) && list.Contains(name2))
            {
                Vertex first  = list.GetVertex(name1);
                Vertex second = list.GetVertex(name2);

                if (list[first, second] != null)
                {
                    delLength = list[first, second].Length;

                    list.DelLink(first, second);

                    return(delLength);
                }
                else
                {
                    throw new EdgeDoesNotExistException();
                }
            }
            else
            {
                throw new VertexDoesNotExistException();
            }
        }