• 캠퍼스북
  • LF몰 이벤트
  • 파일시티 이벤트
  • 서울좀비 이벤트
  • 탑툰 이벤트
  • 닥터피엘 이벤트
  • 아이템베이 이벤트
  • 아이템매니아 이벤트

[인공지능]Simulated Annealing - TSP561

*윤*
최초 등록일
2005.10.28
최종 저작일
2005.10
파일확장자 압축파일
가격 1,000원 할인쿠폰받기
다운로드
장바구니

소개글

Traveling Salesman Problem 을 SA(Simulated Annealing)으로 해를 구하는 프로그램입니다. TSP 입력파일은 561개의 도시이며, 웹에서 구할수 있는 것입니다.(tsp561.txt)
학교 팀 프로젝트의 과제로서 완성하였습니다.
SA 프로그래밍을 어떻게 해야 할지 갈피를 못 잡으시는 분들께, 조그마한 참고 자료가 되길 바랍니다.

컴파일 실행환경

Visual C++ 6.0

본문내용

// Function List
void TSPFileLoad( int **TargetArray ); // TSP file load
double randomGene(); // RandomNumber [0, 1] Generator
int* seqGene(int *sequence); // Random Sequence Generator
long seqEval(int* sequence); // Sequence total cost Evaluator
void wrt2File(int* sequence); // Write to file a sequence
void printSeq(int* sequence); // Printout a sequence
bool cmpSeq(int* seq1, int* seq2); // Compare two sequences
int* updateSeq(int* sequence); // update the sequence by moving subSequence [1, 5]

// In Main Function
for (double Temperature = TEMPER_MAX; Temperature > TEMPER_MIN; Temperature *= TEMPER_RATE)
{
// probability = exp(Delta E / T)

nextSeqPtr = updateSeq(curSeq);
if (seqEval(curSeqPtr) > seqEval(nextSeqPtr)) // If the nextSeq is better than curSeq,
{ // then, replace curSeq with nextSeq.
for (i = 0; i < NODEMAX; i++)
{
curSeq[i] = nextSeq[i];
}
cout << seqEval(curSeq);
}
// If the same evaluation of another sequence is generated again and again,
// then, we accept that the sequence is solution.

else {
probability = (exp( (seqEval(curSeqPtr) - seqEval(nextSeqPtr) ) / Temperature ));
if ( randomGene() < (probability) )
{ // if RandomNumber < exp(Delta E / T)
for (i = 0; i < NODEMAX; i++)
{
curSeq[i] = nextSeq[i];
}
cout << seqEval(curSeq);
}
}
cout << endl << "T: " << Temperature << " P: " << probability << " S: ";
}

압축파일 내 파일목록

Simulated Anealing.dsw
Simulated Anealing.ncb
Simulated Anealing.opt
Simulated Anealing.plg
Simulated Anealing.exe
AI_Project_Docu.doc
result.txt
SA.CPP
sample.txt
Simulated Anealing.dsp

참고 자료

없음
*윤*
판매자 유형Bronze개인

주의사항

저작권 자료의 정보 및 내용의 진실성에 대하여 해피캠퍼스는 보증하지 않으며, 해당 정보 및 게시물 저작권과 기타 법적 책임은 자료 등록자에게 있습니다.
자료 및 게시물 내용의 불법적 이용, 무단 전재∙배포는 금지되어 있습니다.
저작권침해, 명예훼손 등 분쟁 요소 발견 시 고객센터의 저작권침해 신고센터를 이용해 주시기 바랍니다.
환불정책

해피캠퍼스는 구매자와 판매자 모두가 만족하는 서비스가 되도록 노력하고 있으며, 아래의 4가지 자료환불 조건을 꼭 확인해주시기 바랍니다.

파일오류 중복자료 저작권 없음 설명과 실제 내용 불일치
파일의 다운로드가 제대로 되지 않거나 파일형식에 맞는 프로그램으로 정상 작동하지 않는 경우 다른 자료와 70% 이상 내용이 일치하는 경우 (중복임을 확인할 수 있는 근거 필요함) 인터넷의 다른 사이트, 연구기관, 학교, 서적 등의 자료를 도용한 경우 자료의 설명과 실제 자료의 내용이 일치하지 않는 경우
최근 본 자료더보기
탑툰 이벤트
[인공지능]Simulated Annealing - TSP561
  • 레이어 팝업
  • 레이어 팝업
  • 레이어 팝업