IDNLearn.com provides a collaborative environment for finding and sharing answers. Our community is here to provide detailed and trustworthy answers to any questions you may have.
C++ Dijkstra's Algorithm
Feel free to use STL for this project.
Write a Dijkstra's Algorithm with 5 functions below:
void addVertex(std::string label)
Creates and adds a vertex to the graph with label. No two vertices should have the same label.
void removeVertex(std::string label)
Removes the vertex with label from the graph. Also removes the edges between that vertex and
the other vertices of the graph.
void addEdge(std::string label1, std::string label2, unsigned long
weight)
Adds an edge of value weight to the graph between the vertex with label1 and the vertex with
label2. A vertex with label1 and a vertex with label2 must both exist, there must not already be
an edge between those vertices, and a vertex cannot have an edge to itself.
void removeEdge(std::string label1, std::string label2)
Removes the edge from the graph between the vertex with label1 and the vertex with label2. A
vertex with label1 and a vertex with label2 must both exist and there must be an edge between
those vertices
Sagot :
Thank you for using this platform to share and learn. Keep asking and answering. We appreciate every contribution you make. Discover the answers you need at IDNLearn.com. Thanks for visiting, and come back soon for more valuable insights.