public readonly struct Edge : IEquatable<Edge>
An edge in a graph.

Constructors

Edge

#
public Edge(int a, int b, bool bidirectional, int attributes)
Create a new edge.
a (int)Index of node at start of edge.
b (int)Index of node at end of edge.
bidirectional (bool)True if the edge is two-way.
attributes (int)Index of attributes.

Edge

#
public Edge(int a, int b)
Create a two-way edge without attributes.
a (int)Index of node at start of edge.
b (int)Index of node at end of edge.

Properties

A

#
public int A { get; }
Gets the index of the node at the start of the edge.

Attributes

#
public int Attributes { get; }
Gets the index of the attributes of this edge, or -1 if the edge has no attributes.

B

#
public int B { get; }
Gets the index of the node at the end of the edge.

Bidirectional

#
public bool Bidirectional { get; }
Gets whether this edge is two-way.

Methods

Equals

#
public bool Equals(Edge other)
other (Edge)

Equals

#
public override bool Equals(object obj)
obj (object)
ValueType.Equals

GetHashCode

#
public override int GetHashCode()

MakeBidirectional

#
public Edge MakeBidirectional()
Make this edge two-way.

MakeUnidirectional

#
public Edge MakeUnidirectional()
Make this edge one-way.

Reverse

#
public Edge Reverse()
Reverse this edge.

WithAttributes

#
public Edge WithAttributes(int attributes)
Associate this edge with a different set of attributes.
attributes (int)