-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
36 lines (34 loc) · 923 Bytes
/
Program.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
36
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Algorithms
{
class Program
{
static void Main(string[] args)
{
UndirectedGraph g = new UndirectedGraph(6);
g.AddEdge(0, 2);
g.AddEdge(0, 1);
g.AddEdge(0, 5);
g.AddEdge(1, 0);
g.AddEdge(1, 2);
g.AddEdge(2, 0);
g.AddEdge(2, 1);
g.AddEdge(2, 3);
g.AddEdge(2, 4);
g.AddEdge(3, 5);
g.AddEdge(3, 4);
g.AddEdge(3, 2);
g.AddEdge(4, 3);
g.AddEdge(4, 2);
g.AddEdge(5, 3);
g.AddEdge(5, 0);
UndirectedGraphBreadthFirst br = new UndirectedGraphBreadthFirst(g);
int[] shortestPath = br.getShortestPath(g,5);
//br.bfs(g, 5);
}
}
}