-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
64 lines (49 loc) · 1.92 KB
/
Program.cs
File metadata and controls
64 lines (49 loc) · 1.92 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using lab1.Classes;
using lab1.parts;
//using lab1.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace lab1
{
class Program
{
static void Main(string[] args)
{
List<Path_unit> paths1 = new List<Path_unit>() { new Path_unit(102, 7), new Path_unit(104, 1), new Path_unit(105, 3) };
Node a1 = new Node(101, paths1);
List<Path_unit> paths2 = new List<Path_unit>() { new Path_unit(103, 2) };
Node b1 = new Node(102, paths2);
List<Path_unit> paths3 = new List<Path_unit>() { new Path_unit(101, 20), new Path_unit(104, 1) };
Node c1 = new Node(103, paths3);
List<Path_unit> paths4 = new List<Path_unit>() { new Path_unit(102,5), new Path_unit(103, 1), new Path_unit(105, 10) };
Node d1 = new Node(104, paths4);
List<Path_unit> paths5 = new List<Path_unit>() { new Path_unit(101, 3), new Path_unit(103,1) };
Node e1 = new Node(105, paths5);
Node h1 = new Node(106);
Graph graph = new Graph();
graph.Add(d1);
graph.Add(a1);
graph.Add(e1);
graph.Add(b1);
graph.Add(c1);
graph.Add(h1);
/*
Node x = graph.Get_Node_for_vertex(103);
(bool, int, bool) pp = graph.Get_weight_of_path((106, 102)); */
int[] vertexes = graph.Get_array_of_vertex();
/*
foreach(int a in vertexes)
{
Console.WriteLine(a);
}
*/
int[,] result = graph.Get_matrix_adjacency();
int[,] path_tab = Path_table.Path_matrix(graph);
Console.WriteLine("ok");
Console.ReadKey();
}
}
}