Table of Contents

Interface IGraph

Namespace
AlgorithmsSW.Graph
Assembly
AlgorithmsSW.dll

Represents a graph data structure.

public interface IGraph : IReadOnlyGraph, IEnumerable<(int vertex0, int vertex1)>, IEnumerable
Inherited Members
Extension Methods

Remarks

Self-loops are supported, but parallel edges are not.

Methods

AddEdge(int, int)

Adds an edge between two vertices in the graph.

void AddEdge(int vertex0, int vertex1)

Parameters

vertex0 int

The first vertex of the edge to add.

vertex1 int

The second vertex of the edge to add.

RemoveEdge(int, int)

Removes an edge between two vertices in the graph.

bool RemoveEdge(int vertex0, int vertex1)

Parameters

vertex0 int

The first vertex of the edge to remove.

vertex1 int

The second vertex of the edge to remove.

Returns

bool

true if the edge was removed, false otherwise.