Table of Contents

Class UndirectedAdjacencyMatrixGraph<TVertex, TEdge>

Namespace
Graph1x
Assembly
Graph1x.dll

A simple undirected graph stored as a dense symmetric adjacency matrix: O(1) edge lookup and removal at O(V²) memory, the right trade-off for dense graphs. Endpoint order never matters.

public sealed class UndirectedAdjacencyMatrixGraph<TVertex, TEdge> : AdjacencyMatrixGraphBase<TVertex, TEdge>, IMutableGraph<TVertex, TEdge>, IReadOnlyGraph<TVertex, TEdge> where TVertex : notnull where TEdge : IEdge<TVertex>

Type Parameters

TVertex

The vertex type.

TEdge

The edge type.

Inheritance
AdjacencyMatrixGraphBase<TVertex, TEdge>
UndirectedAdjacencyMatrixGraph<TVertex, TEdge>
Implements
IMutableGraph<TVertex, TEdge>
IReadOnlyGraph<TVertex, TEdge>
Inherited Members
Extension Methods

Constructors

UndirectedAdjacencyMatrixGraph()

Initializes an empty graph using the default vertex comparer.

public UndirectedAdjacencyMatrixGraph()

UndirectedAdjacencyMatrixGraph(IEqualityComparer<TVertex>)

Initializes an empty graph using vertexComparer to identify vertices.

public UndirectedAdjacencyMatrixGraph(IEqualityComparer<TVertex> vertexComparer)

Parameters

vertexComparer IEqualityComparer<TVertex>

The comparer used to identify vertices.

Exceptions

ArgumentNullException

vertexComparer is null.

Properties

IsDirected

Gets a value indicating whether edges are directed.

public override bool IsDirected { get; }

Property Value

bool