123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Method_dekstra
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- //int[,] graphMatrix =
- //{
- // { 0, 7, 9, 0, 0, 14 },
- // { 7, 0, 10, 15, 0, 0 },
- // { 9, 10, 0, 11, 0, 2 },
- // { 0, 15, 11, 0, 6, 0 },
- // { 0, 0, 0, 6, 0, 9 },
- // { 14, 0, 2, 0, 9, 0}
- //};
- //int startNode = 1;
- //int countNode = 6;
- //int[,] Matrix =
- //{
- //{ 0, 0, 0, 0, 0, 14, 0, 0, 0, 0 },
- //{ 0, 0, 19, 0, 1, 0, 1, 0, 0, 0 },
- //{ 0, 19, 0, 7, 0, 4, 0, 9, 0, 0 },
- //{ 0, 0, 7, 0, 0, 17, 0, 13, 13, 2 },
- //{ 0, 1, 0, 0, 0, 0, 12, 0, 0, 0 },
- //{ 14, 0, 4, 17, 0, 0, 14, 0, 0, 0},
- //{ 0, 1, 0, 0, 12, 14, 0, 7, 8, 8 },
- //{ 0, 0, 9, 13, 0, 0, 7, 0, 17, 20 },
- //{ 0, 0, 0, 13, 0, 0, 8, 17, 0, 0 },
- //{ 0, 0, 0, 2, 0, 0, 8, 20, 0, 0 }
- //};
- //int start = 1;
- //int count = 10;
- int[,] Matrix =
- {
- { 0, 23, 12, 0, 0, 0, 0, 0},
- { 23, 0, 25, 0, 22, 0, 0, 35},
- { 12, 25, 0, 18, 0, 0, 0, 0},
- { 0, 0, 18, 0, 0, 28, 0, 0},
- { 0, 22, 0, 0, 0, 23, 14, 0},
- { 0, 0, 0, 20, 23, 0, 24, 0},
- { 0, 0, 0, 0, 14, 24, 0, 16},
- { 0, 35, 0, 0, 0, 0, 16, 0}
- };
- int start= 1;
- int count = 8;
- Deikstra obj = new Deikstra(Matrix, start, count);
- obj.Deikstra_min();
- Console.WriteLine(obj.Exemple());
- Console.ReadKey();
- }
- }
- }
|