Table of Contents

Class Edge<TWeight>

Namespace
AlgorithmsSW.EdgeWeightedGraph
Assembly
AlgorithmsSW.dll

Represents an edge in an edge-weighted graph.

public record Edge<TWeight> : IEquatable<Edge<TWeight>>

Type Parameters

TWeight

The type of weight. See Weights.

Inheritance
Edge<TWeight>
Implements
IEquatable<Edge<TWeight>>
Inherited Members
Extension Methods

Constructors

Edge(int, int, TWeight)

Represents an edge in an edge-weighted graph.

public Edge(int Vertex0, int Vertex1, TWeight Weight)

Parameters

Vertex0 int

One vertex of the edge.

Vertex1 int

The other vertex of the edge.

Weight TWeight

The weight of the edge.

Properties

Vertex0

One vertex of the edge.

public int Vertex0 { get; init; }

Property Value

int

Vertex1

The other vertex of the edge.

public int Vertex1 { get; init; }

Property Value

int

Weight

The weight of the edge.

public TWeight Weight { get; init; }

Property Value

TWeight

Methods

OtherVertex(int)

Given one vertex of the edge, returns the other vertex.

public int OtherVertex(int vertex)

Parameters

vertex int

Returns

int

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.