[자료구조] Shortest Path
- 최초 등록일
- 2003.06.27
- 최종 저작일
- 2003.06
- 1페이지/ 압축파일
- 가격 2,000원
소개글
C로 쓴 알고리즘에 나와있는 알고리즘 보고 짠 것입니다.
리포트 제출용이라 실행화면 캡쳐 한것도 있고,
주석도 잘 달아놓았습니다.
컴파일 실행환경
없음
본문내용
/*
distance[i]는 정점 v에서 i로의 최단 경로 표현
정점 i로부터 최단 경로가 발견 되었으면 found[i]는 1이고 그렇지 않으면 0
cost는 인접 행렬
*/
void shortest_path(int v, int cost[][MAX_VERTICES], int distance[], int n, short int found[])
{
int i, u, w, j;
// distance 셋팅
for(i = 0; i < n; i++) {
found[i] = FALSE;
distance[i] = cost[v][i];
}
// 임의의 정점 셋팅
found[v] = TRUE;
distance[v] = 0;
압축파일 내 파일목록
ShortestPath.cpp
prjShortestPath.dsp
prjShortestPath.dsw
prjShortestPath.ncb
prjShortestPath.opt
prjShortestPath.plg
result_shortestpath.jpg
참고 자료
C로 쓴 알고리즘