C++ Implementation of the Hopfield Network for the Traveling Salesperson Problem
We present a C++ program for the Hopfield network operation for the traveling salesperson problem. The
header file is in the Listing 15.1, and the source file is in the Listing 15.2. A tsneuron class is declared for a
neuron and a network class for the network. The network class is declared a friend in the tsneuron class.
The program follows the procedure described for setting inputs, connection weights, and updating.
Program Details
The following is a listing of the characteristics of the C++ program along with definitions and/or functions.
• The number of cities, the number of iterations, and the distances between the cities are solicited
from the user.
Do'stlaringiz bilan baham: |