Seyyar Satıcı

axehs
30-12-2017, 16:34   |  #1  
axehs avatarı
OP Taze Üye
Teşekkür Sayısı: 0
1 mesaj
Kayıt Tarihi:Kayıt: Ara 2017

Arkadaşlar bir program yazmam isteniyor programda Ankara'dan başlayan bir Travelling Salesman (Seyyar Satıcı) İstanbul İzmir ve Bolu'ya en kısa yoldan olacak şekilde gidiyor. Bu konuda hocamız karayolları genel müdürlüğü nün linkini de vermiş ve *FILE komutunu kullanarak dosyanın içine yazmamızı istiyor fakat ben programlamada yeni olduğum için böyle karışık bir kodu yazamıyorum. Yardımlarınız için teşekkürler. Eğer hepsine teker teker bakamam diyorsanız sayıları "x, y, z "şeklinde de söylerseniz ben onu düzenlemeye çalışırım.

The travelling salesman problem:
A classic problem in mathematics is the travelling salesman problem (TSP, see e.g.
https://en.wikipedia.org/wiki/Travelling_salesman_problem). The TSP asks “the following
question: "Given a list of cities and the distances between each pair of cities, what is the shortest
possible route that visits each city exactly once and returns to the origin city?" It is an NP-hard
problem in combinatorial optimization, important in operations research and theoretical
computer science”(quotation source: Wikipedia).
The link
http://www.kgm.gov.tr/SiteCollec ... liklar/ilmesafe.xls
opens a Microsoft Excel file that displays distances (in km) in between Turkish provinces ordered
with respect to the licence plate numbers. You are to write a program that finds the
(approximately) best route for a cyclic route in between a number of cities. Your program should:
a. read the “ilmesafe.xls” file,
b. store its contents in a two-dimensional array of unsigned integers,
c. read the “cities.txt” file
d. calculate the shortest route for the selected cities (use the nearest neighbor heuristic),
e. store the shortest route in a file called ”route.txt”.
The “cities.txt” file should store the licence plate numbers separated by commas and terminated
by a period. For example, to designate a tour in between Ankara, Bolu, Istanbul, Izmir and back to
Ankara, the cities.txt file should store “06,14,34,35.”, see the attached. The “route.txt” file shall
follow the same style as well. Your program should give an error and terminate if there are
repetitions or invalid licence plate numbers in the “cities.txt” file.

Sistem Bilgilerim