-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDijkstraOut.cs
32 lines (29 loc) · 1.1 KB
/
DijkstraOut.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
using System.Collections.Generic;
namespace Suurballe_s_Algorithm
{
class DijkstraOut //Used to return all usefull information from Dijkstra Algorithm Implementation.
{
public List<string> Path { get; set; }
public Dictionary<string, string> Parents { get; set; }
public Dictionary<string, int> Distances { get; set; }
public Dictionary<string,string> EdgePath { get; set; }
public DijkstraOut(List<string> _Path, Dictionary<string, string> _Parents, Dictionary<string, int> _Distances)
{
Path = _Path;
Parents = _Parents;
Distances = _Distances;
Dictionary<string, string> DictionaryPathTemp = new Dictionary<string, string>();
var Previous = Path[0];
foreach (var Node in Path)
{
if (Node != Path[0])
DictionaryPathTemp.Add(Previous,Node);
Previous = Node;
}
EdgePath = DictionaryPathTemp;
}
public DijkstraOut()
{
}
}
}