라우팅 알고리즘
- 최초 등록일
- 2004.09.18
- 최종 저작일
- 2004.06
- 5페이지/ 한컴오피스
- 가격 1,000원
목차
<< routing algorithm >>
<< data >>
<< shortest_path >>
본문내용
<< data >>
7
0 4 5 1000 1000 1000 1000
4 0 6 3 3 1000 1000
5 6 0 4 1000 9 1000
1000 3 4 0 6 3 1000
.........
<< shortest_path >>
#include <stdio.h>
#include <stdlib.h>
#define Max 1000 // infinity
#define n 7 // sum of node
void bellman();
void floyd();
void output(FILE *ofp);
void path(int q, int r, FILE *ofp);
int W[n][n];
int D[n][n]; // length
int P[n][n]; // path
void main()
{
int x, node, i, j, temp;
FILE *ifp, *ofp;
if((ifp = fopen("data.txt","r"))==NULL)
printf("File open error.\n");
fscanf(ifp, "%d", &node); //node이 갯수를 data.txt로부터 읽는다
참고 자료
없음