TSP 알고리즘
- 최초 등록일
- 2005.04.04
- 최종 저작일
- 2005.04
- C언어
- 가격 2,000원
소개글
누구나 고민을 하던 알고리즘을 C언어로 완벽 구현...
TSP알고리즘 소스코드
비트 조작과 파일입출력을 이용한,
완벽한 TSP문제의 해결...
단 한줄의 코드의 손색도 없는 완벽...
컴파일 실행환경
visual c++ 6.0
본문내용
int main()
{
int i, j, k, setA, size, minLength, V, min = 9999;
int **W, **P, **D; // weight, path, distance를 2차원 배열로 표시한다.
char fileName[20]; // 테스트 파일 이름.
cout << "Enter the name of input file: ";
cin >> fileName; // 테스트 파일 이름을 입력 받는다.
ifstream file(fileName, ios::in | ios::nocreate);
if(!file) {
cout << "Can't open the input file!!!" << endl;
exit(1);
}
file >> size; // 노드 갯수를 읽음.
참고 자료
없음