My graph is implemented in the following way:
struct node{
string ID;
vector<string> neighbors;
}
struct graph{
vector<string> nodes;
}
nodes is a vector of nodes. Each node contains its ID and a vector of all of its neighbor's (Nodes it is pointing to) IDs
Is there a way I can apply Dijkstra's algorithm or Bellman-Ford to find the shortest path between two nodes? Find a duplicate cycle? How would I do that?
EDIT: sturcts were accidental named the same.
nodesomewhere or something similar? Why don't you use avector<node*>instead ofvector<string>for neighbors? - user3072164vector<node*>as @Nabla suggested. - Anirudh Ramanathan