For a current project I am creating I decided the best way to implement the code would be through an adjacency list. I am just simply confused on what the structs would look like and how to create the reference. For example,
I have one struct for all the vertices and another struct for the adjacent vertices. I need to be able to travel from vertex a to the adjacent vertex b, for example, but b should be a reference to the vertex node b so that I can "jump" from the adjacent vertice chain to the vertex chain.
[Vertex] [Adjacent Vertices]
My structs are setup as follows:
So what I am wondering is do my structs look setup correctly and how would I do the jumping from an adajcency vertex to a vertex?
adj_node* path; //for the adjacency vertex chain (A->C->B->E)
node* down; //to travel down the vertex chain (A-B-C)