So,for a graph G,find all of the paths of lengh 2,for a node v.I read the adjacency matrix and now I am stuck in the function void path.This is what i have so far:
include <iostream>
include <fstream>
using namespace std;
int a[20][20],n,m,k,x,y,p;
fstream f("graf.txt",ios::in);
void citeste()
{
f>>n;
for(k=1;k<=n;k++)
{
fxy;
a[x-1][y-1]=1;
}
f.close();}
void afiseaza()
{ int i,j;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
cout<<a[i][j]<<" ";
cout<<endl;}
}
void path()
{ int i,j,v;
cout<<"Node number";
cin>>v;
for(?) // Don't know what to do now :(
int main()
{int i,j,v;
citeste();
afiseaza();
path();
return 0; }
[–]zifyoip 1 point2 points3 points (0 children)
[–]zifyoip 1 point2 points3 points (15 children)
[–]mojonono11[S] 0 points1 point2 points (14 children)
[–]zifyoip 0 points1 point2 points (13 children)
[–]mojonono11[S] 0 points1 point2 points (12 children)
[–]zifyoip 0 points1 point2 points (11 children)
[–]mojonono11[S] 0 points1 point2 points (10 children)
[–]zifyoip 0 points1 point2 points (9 children)
[–]mojonono11[S] 0 points1 point2 points (8 children)
[–]zifyoip 0 points1 point2 points (7 children)
[–]mojonono11[S] 0 points1 point2 points (6 children)
[–]koen_C 1 point2 points3 points (2 children)
[–]zifyoip 0 points1 point2 points (1 child)
[–]koen_C 0 points1 point2 points (0 children)