Show / Hide Table of Contents

Interface IGraph<T>

Interface describing a generic graph.

Namespace: Edgar.Graphs
Assembly: Edgar.dll
Syntax
public interface IGraph<T>
Type Parameters
Name Description
T

Properties

Edges

Gets all edges of the graph.

Declaration
IEnumerable<IEdge<T>> Edges { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<IEdge<T>>

IsDirected

Checks if the graph is directed.

Declaration
bool IsDirected { get; }
Property Value
Type Description
System.Boolean

Vertices

Gets all vertices of the graph.

Declaration
IEnumerable<T> Vertices { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<T>

VerticesCount

Gets the total number of vertices.

Declaration
int VerticesCount { get; }
Property Value
Type Description
System.Int32

Methods

AddEdge(T, T)

Adds an edge.

Declaration
void AddEdge(T from, T to)
Parameters
Type Name Description
T from
T to

AddVertex(T)

Adds a vertex.

Declaration
void AddVertex(T vertex)
Parameters
Type Name Description
T vertex

GetNeighbours(T)

Gets all neighbours of a given vertex.

Declaration
IEnumerable<T> GetNeighbours(T vertex)
Parameters
Type Name Description
T vertex
Returns
Type Description
System.Collections.Generic.IEnumerable<T>

HasEdge(T, T)

Checks whether there exists a given edge.

Declaration
bool HasEdge(T from, T to)
Parameters
Type Name Description
T from
T to
Returns
Type Description
System.Boolean
Back to top Generated by DocFX