I have got a set of nodes and few edges that represent which nodes are connected. V_nodes 1 7 22 97 48 11 V_arcs (1 22) (97 22) (7 1) (11 48) (48 7) (11 0) V_weight 1
I have created its adjacency matrix that shows 1 for connected and 0 for disconnected vertices. Now I want to implement a Depth First Traversal for this graph using its Adjacency Matrix. I have seen the tutorials on DFS but I am confused How can I traverse it using my Adjacency matrix. I just need to print the nodes using Depth First Traversal. Any help will be appreciated.
// Prints the adjacency matrix
cout<<"Adjacency Matrix : \n";
for(int i=0;i<6;i++)
cout<<" "<<nodes[i].nodevalue;
cout<<endl<<endl;
for(int i=0;i<6;i++)
{
for (int j=0;j<6;j++)
{
cout<<" "<<edges[i][j];
}
cout<<endl<<nodes[i].nodevalue;
cout<<endl<<endl;
}