romaniaroads.pl 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. %==============================================================================
  2. % Weighted graph of romanian road system.
  3. %==============================================================================
  4. road(arad, zerind, 75).
  5. road(arad, sibiu, 140).
  6. road(arad, timisoara, 118).
  7. road(zerind, oradea, 71).
  8. road(oradea, sibiu, 151).
  9. road(timisoara, lugoj, 111).
  10. road(lugoj, mehadia, 70).
  11. road(mehadia, drobeta, 75).
  12. road(drobeta, craiova, 120).
  13. road(sibiu, faragas, 99).
  14. road(sibiu, rimnicuvilcea, 80).
  15. road(rimnicuvilcea, craiova, 146).
  16. road(rimnicuvilcea, pitesti, 97).
  17. road(craiova, pitesti, 138).
  18. road(pitesti, bucharest, 101).
  19. road(faragas, bucharest, 211).
  20. road(giurgiu, bucharest, 90).
  21. road(bucharest, urziceni, 85).
  22. road(urziceni, hirsova, 98).
  23. road(hirsova, eforie, 86).
  24. road(urziceni, vaslui, 142).
  25. road(vaslui, iasi, 92).
  26. road(iasi, neamt, 87).
  27. %==============================================================================
  28. twoWayRoad(City1, City2, Distance):-
  29. road(City1, City2, Distance).
  30. twoWayRoad(City1, City2, Distance):-
  31. road(City2, City1, Distance).
  32. move(City1, City2):- twoWayRoad(City1, City2, _).
  33. move(City1, City2, Distance):-
  34. twoWayRoad(City1, City2, Distance).
  35. %==============================================================================
  36. % Decimal latitude and longitude of US cities.
  37. % Useful in computing D-2 (Pythagorian) distance in the heuristic.
  38. % 0.01 degrees is about 1 km precision.
  39. % city(name, latitude north, longitude west)
  40. % The longitude of japan (35.68N, 139.77E) is fudged so everything is west:
  41. % 360 + E, where E is negative.
  42. %==============================================================================
  43. city(arad, 46.17, 21.33). %Arad 46°10'N 21°20'E
  44. city(zerind, 46.62, 21.52). %Zerind 46°37'N 21°31'E
  45. city(sibiu, 45.8, 24.15). %Sibiu 45°48'N 24°9'E
  46. city(timisoara, 45.75, 21.23). %Timisoara
  47. city(oradea, 47.03, 21.97). %Oradea 47°02'N 21°58'E
  48. city(lugoj, 45.7, 21.95). %Lugoj 45°42'N 21°57'E
  49. city(mehadia, 44.90, 22.37). %Mehadia 44°54'2"N 22°22'E
  50. city(drobeta, 44.65, 22.68). %Drobeta-Turnu Severin 44°39'N 22°41'E
  51. city(craiova, 44.33, 23.78). %Craiova 44°21'N 23°48'E
  52. city(faragas, 45.84, 24.97). %Fagaras 45°48'N 24°58'E
  53. city(rimnicuvilcea, 45.10, 24.38). %Ramnicu Valcea 45°09'N 24°21'E
  54. city(pitesti, 44.87, 24.88). %Pitesti 44°52'N 24°54'E
  55. city(bucharest, 44.43, 26.10). %Bucharest 44°27'N 26°10'E
  56. city(giurgiu, 43.90, 25.97). %Giurgiu 43°52'N 25°57'E
  57. city(urziceni, 44.72, 26.63). %Urziceni 44°43'N 26°38'E
  58. city(hirsova, 44.68, 27.93). %Hirsova 44°41'N 27°56'E
  59. city(eforie, 44.07, 28.63). %Eforie 44°4'N 28° 38'E
  60. city(vaslui, 46.63, 27.70). %Vaslui 46°38'N 27°42'E
  61. city(iasi, 47.16, 27.59). %Iasi 47°10'N 27°40'E
  62. city(neamt, 46.93, 26.37). %Piatra Neamt 46°55'N 26°20'E