Question
c++ Dijkstra's stupid question I am getting stuck with my code in 1 last function: unsigned long shortestPath(std::string startLabel, std::string endLabel, std::vector &path) This function
c++ Dijkstra's stupid question
I am getting stuck with my code in 1 last function:
unsigned long shortestPath(std::string startLabel, std::string endLabel, std::vector
This function calculates the shortest distance from startLabel to endLabel. startLabel and endLabel are something like "USA" or "CAN" or "RUS" . Calculates the shortest path between the vertex with startLabel and the vertex with endLabel using Dijkstra's Algorithm. A vector is passed into the method that stores the shortest path between the vertices. The return value is the sum of the edges between the start and end vertices on the shortest path.
Please dont ask me to provide more information. My project has 5 functions, I have finished 4 of them which are:
void graph::addVertex(std::string label)
void graph::removeVertex(std::string label)
void graph::addEdge(std::string label1, std::string label2, unsigned long weight)
void removeEdge(std::string label1, std::string label2)
and
unsigned long shortestPath(std::string startLabel, std::string endLabel, std::vector &path)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started