[C소스]다익스트라 알고리즘
- 최초 등록일
- 2006.05.12
- 최종 저작일
- 2006.05
- 3페이지/
MS 워드
- 가격 1,000원
![할인쿠폰받기](/images/v4/document/ico_det_coupon.gif)
소개글
최단경로를 찾는 알고리즘
컴파일 실행환경
Microsoft Visual C++ 6.0
본문내용
다익스트라 알고리즘
#define max_vertice 5
#define INT_MAX 1000
#include <stdio.h>
int cost[max_vertice][max_vertice] = {
{0,7,4,6,1},
{1000,0,1000,1000,1000},
{1000,2,0,5,1000},
{1000,3,1000,0,1000},
{1000,1000,1000,1,0}
};
bool Select[max_vertice]={0,};
int Distance[max_vertice]={0,};
int choose(int distance[], int n, bool found[]);
int main(void){
int start;
printf("Where does vertice start from?? : ");
scanf("%d",&start);
shortestpath(start,Distance,max_vertice,Select);
return 0;
}
참고 자료
없음