-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathIWeightedGraph.cs
36 lines (30 loc) · 1.13 KB
/
IWeightedGraph.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
namespace DataStructures.Graphs
{
/// <summary>
/// This interface should be implemented alongside the IGraph interface.
/// </summary>
public interface IWeightedGraph<T> where T : IComparable<T>
{
/// <summary>
/// Connects two vertices together with a weight, in the direction: first->second.
/// </summary>
bool AddEdge(T source, T destination, long weight);
/// <summary>
/// Updates the edge weight from source to destination.
/// </summary>
bool UpdateEdgeWeight(T source, T destination, long weight);
/// <summary>
/// Get edge object from source to destination.
/// </summary>
WeightedEdge<T> GetEdge(T source, T destination);
/// <summary>
/// Returns the edge weight from source to destination.
/// </summary>
long GetEdgeWeight(T source, T destination);
/// <summary>
/// Returns the neighbours of a vertex as a dictionary of nodes-to-weights.
/// </summary>
System.Collections.Generic.Dictionary<T, long> NeighboursMap(T vertex);
}
}