forked from aalhour/C-Sharp-Algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIWeightedGraph.cs
31 lines (26 loc) · 982 Bytes
/
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
using System;
namespace DataStructures
{
/// <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, int weight);
/// <summary>
/// Updates the edge weight from source to destination.
/// </summary>
bool UpdateEdgeWeight(T source, T destination, int weight);
/// <summary>
/// Returns the edge weight from source to destination.
/// </summary>
int 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, int> NeighboursMap(T vertex);
}
}