Beispiel #1
0
        /// <summary>
        /// Removes the given vertex from this graph.
        /// </summary>
        /// <param name="vertex">Vertex to remove.</param>
        /// <returns>True if the vertex was removed, false otherwise.</returns>
        public virtual bool RemoveVertex([NotNull] TVertex vertex)
        {
            if (vertex == null)
            {
                throw new ArgumentNullException(nameof(vertex));
            }

            if (!Wrapped.ContainsVertex(vertex))
            {
                return(false);
            }

            RemoveChildVertex(vertex);
            Wrapped.RemoveVertex(vertex);
            Parent?.RemoveVertex(vertex);

            return(true);
        }
Beispiel #2
0
 /// <summary>
 /// Determines whether the <see cref="ClusteredAdjacencyGraph"/>
 /// contains the vertex <paramref name="v"/>.
 /// </summary>
 /// <param name="v">
 /// The vertex to locate in <see cref="ClusteredAdjacencyGraph"/>.
 /// </param>
 /// <returns>
 /// true if the <see cref="ClusteredAdjacencyGraph"/> contains
 /// the vertex <paramref name="v"/>; otherwise, false.
 ///	</returns>
 public bool ContainsVertex(IVertex v)
 {
     return(Wrapped.ContainsVertex(v));
 }
Beispiel #3
0
 /// <inheritdoc />
 public bool ContainsVertex(TVertex vertex)
 {
     return(Wrapped.ContainsVertex(vertex));
 }