Interface IMutableGraph<TVertex, TEdge>
- Namespace
- Graph1x
- Assembly
- Graph1x.dll
A graph that supports in-place mutation. Add/Remove operations follow the .NET collection idiom: they return false for duplicates or missing items instead of throwing.
public interface IMutableGraph<TVertex, TEdge> : IReadOnlyGraph<TVertex, TEdge> where TVertex : notnull where TEdge : IEdge<TVertex>
Type Parameters
TVertexThe vertex type.
TEdgeThe edge type.
- Inherited Members
- Extension Methods
Methods
AddEdge(TEdge)
Adds edge to the graph, adding missing endpoint
vertices automatically.
bool AddEdge(TEdge edge)
Parameters
edgeTEdgeThe edge to add.
Returns
AddVertex(TVertex)
Adds vertex to the graph.
bool AddVertex(TVertex vertex)
Parameters
vertexTVertexThe vertex to add.
Returns
Clear()
Removes every vertex and edge from the graph.
void Clear()
RemoveEdge(TEdge)
Removes edge from the graph. Endpoint vertices stay.
bool RemoveEdge(TEdge edge)
Parameters
edgeTEdgeThe edge to remove.
Returns
Remarks
The stored edge must equal edge under the edge
type's default equality — VertexComparer
locates the endpoints but never compares payloads. To remove an edge
by its endpoints alone, use the endpoint-based overloads on the
concrete graph types.
RemoveVertex(TVertex)
Removes vertex and every edge incident to it.
bool RemoveVertex(TVertex vertex)
Parameters
vertexTVertexThe vertex to remove.