C++ Neural Networks and Fuzzy Logic: Preface


C++ Neural Networks and Fuzzy Logic



Download 1,14 Mb.
Pdf ko'rish
bet353/443
Sana29.12.2021
Hajmi1,14 Mb.
#77367
1   ...   349   350   351   352   353   354   355   356   ...   443
Bog'liq
C neural networks and fuzzy logic

C++ Neural Networks and Fuzzy Logic

by Valluru B. Rao

MTBooks, IDG Books Worldwide, Inc.



ISBN: 1558515526   Pub Date: 06/01/95

Previous Table of Contents Next



Output from Your C++ Program for the Traveling Salesperson Problem

A three−city tour problem is trivial, since there is just one value for the total distance no matter how you

permute the cities for the order of the tour. In this case the natural order is itself an optimal solution. The

program is run for two cases, for illustration. The first run is for a problem with four cities. The second one is

for a five−city problem. By the way, the cities are numbered from 0 to n – 1. The same parameter values are

used in the two runs. The number of cities, and consequently, the matrix of distances were different. In the

first run, the number of iterations asked for is 30, and in the second run it is 40.

The solution you get for the four−city problem is not the one in natural order. The total distance of the tour is

32. The tour in the solution is 1 − 0 − 3 − 2 − 1. This tour is equivalent to the tour in natural order, as you can

see by starting at 0 and reading cyclically right to left in the previous sequence of cities.

The solution you get for the five−city problem is the tour 1 − 2 − 0 − 4 − 3 − 1. This reads, starting from 0 as

either 0 − 4 − 3 − 1 − 2 − 0, or as 0 − 2 − 1 − 3 − 4 − 0. It is different from the tour in natural order. It has a

total distance of 73, as compared to the distance of 84 with the natural order. It is not optimal though, as a tour

of shortest distance is 0 − 4 − 2 − 1 − 3 − 0 with total distance 50.

Can the program give you the shorter tour? Yes, the solution can be different if you run the program again

because each time you run the program, the input vector is different, as it is chosen at random. The parameter

values given in the program are by guess.

Note that the seed for the random number generator is given in the statement

srand ((unsigned)time(NULL));

The program gives you the order in the tour for each city. For example, if it says tourcity 1 tour order 2, that

means the second (tour) city is the city visited third (in tour order). Your tour orders are also with values from

0 to n – 1, like the cities.

The user input is in italic, and computer output is normal, as you have seen before.


Download 1,14 Mb.

Do'stlaringiz bilan baham:
1   ...   349   350   351   352   353   354   355   356   ...   443




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish