Logo 
Search:

C++ Programming Forum

Ask Question   UnAnswered
Home » Forum » C++ Programming       RSS Feeds

graph visit

  Asked By: Duaa    Date: Jan 12    Category: C++ Programming    Views: 454
  

Hi,,
I hope you will help me
I need some help in updating depth first traverse to store all paths from the start node example:
If the graph is as
->5 ->7
->3 ->6 ->7
1->2
->4 ->7
if it does not clear
1->2
2->3
2->4
3->5
3->6
4->7
5->7
6->7
I need to store The requested paths
1 2 3 5 7
1 2 3 6 7
1 2 4 7

Start node 1 and the end node 7

This is my structure for the graph
struct fill_data{
vertex node_data;
int ORDER;
vector <int> adj;
fill_data * next;
};
Order is the id for father and vector adj is its children
and the vertex is a structure for containing node information
I use the depth first traverse but obtain one path not and i need all paths to be stored to make some calculations

Any idea’s or help

With regards

Share: 



Tagged: