GraphIoUtilities.cs 849 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. // Класс для ввода/вывода графа
  5. static class GraphIoUtilities
  6. {
  7. static private readonly int MAX_AMOUNT = 20;
  8. static public Dictionary<char, int> GenerateCharToVertexId()
  9. {
  10. Dictionary<char, int> result = new Dictionary<char, int>();
  11. char letter = 'А';
  12. for (int i = 1; i <= MAX_AMOUNT; i++)
  13. {
  14. result[letter] = i;
  15. letter++;
  16. }
  17. return result;
  18. }
  19. static public Dictionary<int, char> GenerateVertexIdToChar()
  20. {
  21. Dictionary<int, char> result = new Dictionary<int, char>();
  22. char letter = 'А';
  23. for (int i = 1; i <= MAX_AMOUNT; i++)
  24. {
  25. result[i] = letter;
  26. letter++;
  27. }
  28. return result;
  29. }
  30. }