Click here to Skip to main content
15,897,371 members
Articles / Artificial Intelligence

Genetic Algorithms and the Traveling Salesman Problem

Rate me:
Please Sign up or sign in to vote.
4.73/5 (46 votes)
26 Sep 200110 min read 691.2K   41.5K   143  
An example of using Genetic Algorithms for solving the Traveling Salesman Problem
#ifndef _STDAFX_H_
#define _STDAFX_H_

#include "kbase.h"
namespace kb = kbase_2001;

#include <crtdbg.h>

#include <tchar.h>
#include <atlbase.h>
extern CComModule _Module;
#include <atlcom.h>
#include <atlwin.h>
#include <atlhost.h>

#include <commctrl.h>

#include "ATLControls.h"
using namespace ATLControls;

#pragma warning(push, 3)
#include <vector>
#include <list>
#include <limits>
#include <algorithm>
#include <functional>
#include <iostream>
#include <fstream>
#include <time.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include <process.h>
#include <intshcut.h>
#pragma warning(pop)

#include "GA.h"
#include "GASelection.h"
#include "JROptex.h"
#include "MemTools.h"
#include "random.h"
#include "thin_ptr.h"
#include "travel.h"


#ifndef BEGIN_OBJECT_MAP
#define BEGIN_OBJECT_MAP(x)
#endif

#ifndef END_OBJECT_MAP
#define END_OBJECT_MAP()
#endif

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Russian Federation Russian Federation
I am freelance programmer. About 3 years of experience in C++ and I would rather use ATL, STL, WTL but not MFC Smile | :) . Main backgrounds are Win32 API, COM and Networking. Now I am interested about AI (Neural Network, Fuzzy Logic and GA). Currently based in Vladivostok, Russia.

Comments and Discussions