Table of Contents

Class EdgeWeightedDigraphWithArray<TWeight>

Namespace
AlgorithmsSW.EdgeWeightedDigraph
Assembly
AlgorithmsSW.dll
public class EdgeWeightedDigraphWithArray<TWeight> : IEdgeWeightedDigraph<TWeight>, IReadOnlyEdgeWeightedDigraph<TWeight>, IReadOnlyDigraph, IEnumerable<(int vertex0, int vertex1)>, IEnumerable

Type Parameters

TWeight
Inheritance
EdgeWeightedDigraphWithArray<TWeight>
Implements
Inherited Members
Extension Methods

Constructors

EdgeWeightedDigraphWithArray(int)

public EdgeWeightedDigraphWithArray(int vertexCount)

Parameters

vertexCount int

Properties

EdgeCount

Gets the number of edges in the graph.

public int EdgeCount { get; }

Property Value

int

SupportsParallelEdges

public bool SupportsParallelEdges { get; }

Property Value

bool

SupportsSelfLoops

public bool SupportsSelfLoops { get; }

Property Value

bool

VertexCount

Gets the number of vertices in the graph.

public int VertexCount { get; }

Property Value

int

WeightedEdges

Gets the edges that is part of this IReadOnlyEdgeWeightedDigraph<TWeight>.

public IEnumerable<DirectedEdge<TWeight>> WeightedEdges { get; }

Property Value

IEnumerable<DirectedEdge<TWeight>>

Methods

AddEdge(DirectedEdge<TWeight>)

Adds an edge to the graph.

public void AddEdge(DirectedEdge<TWeight> edge)

Parameters

edge DirectedEdge<TWeight>

The edge to add.

GetAdjacents(int)

Gets the adjacent vertices of a given vertex.

public IEnumerable<int> GetAdjacents(int vertex)

Parameters

vertex int

The vertex to find adjacents for.

Returns

IEnumerable<int>

An enumerable of adjacent vertices.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<(int vertex0, int vertex1)> GetEnumerator()

Returns

IEnumerator<(int vertex0, int vertex1)>

An enumerator that can be used to iterate through the collection.

GetIncidentEdges(int)

Gets the edges that is incident to the given vertex.

public IEnumerable<DirectedEdge<TWeight>> GetIncidentEdges(int vertex)

Parameters

vertex int

The vertex to get the incident edges of.

Returns

IEnumerable<DirectedEdge<TWeight>>

An enumerable of incident edges.

RemoveEdge(DirectedEdge<TWeight>)

Removes an edge from the graph.

public bool RemoveEdge(DirectedEdge<TWeight> edge)

Parameters

edge DirectedEdge<TWeight>

The edge to remove.

Returns

bool

true if the edge was removed, false otherwise.