123 Eng

### Engineering the engineers™

Home
Source Codes
Engineering Colleges

Training  Reports
Seminar Reports
Placement Papers

Forums

Computer Science / IT
Electronics
Electrical
Mechanical
Chemical
Civil

CAT / MBA

GMAT / Foreign MBA
Latest Jobs

Displaying  Source Code(s)

 Floyd Warshall Algorithm -------------------------------------------------------------------------------- Description : Find shortest path using floyd warshall algorithm Code : #include #include #include #include class path { int n; int p[10][10]; int a[10][10]; int c[10][10]; public: void get(); void pm(); void ap(); void disp(); }; void path::get() { int i,j,k; clrscr(); cout<<"Enter the no. of nodes in the graph :"; cin>>n; cout<<" Enter the adjacency matrix :
; for(i=1;i<=n;i++) { for(j=1;j<=n;j++) { // cout<<"a["<>a[i][j]; p[i][j]=0; } } cout<<" Enter The cost matrix is :
; for(i=1;i<=n;i++) { for(j=1;j<=n;j++) { // cout<<"a["<>c[i][j]; } } for(i=1;i<=n;i++) { for(j=1;j<=n;j++) { p[i][j]=a[i][j]; } } } void path::disp() { // cout<<" The output matrix for the given graph is :
; for(int i=1;i<=n;i++) { for(int j=1;j<=n;j++) { cout<; p.disp(); getch(); p.ap(); cout<<"all pair shortest path matrix is :
; p.disp(); getch(); }

Contribute content or training reports / feedback / Comments
job placement papers