.h files.
But I want to use a helper function.
Don't I need to modify the .h file to add a function prototype declaration for my helpers?
Can I still use helper functions even if I don't modify the .h file?
#include a file, the compiler literally just copy/pastes the contents of that file into the current file.
We have already done this on hw1, hw2, and others.
One common reason for output differences comes from how you loop over neighbors.
Our solution loops over them by calling getNeighbors on the graph and passing in the vertex of interest.
Some students loop over them by accessing the edges field of the vertex of interest and looking at all the vertices that are endpoints of those edges.
Neither way is "right" or "wrong", but they sometimes produce different orders.
int, by chance?
They must be a double for the algorithm to work properly on terrains.
getEdgeSet (O(E log E)), or getVertexSet (O(V log V))Operations like the above can really add up. Carefully audit your code and reduce the number of unnecessary bulk operations you are performing.
trailblazer.h file, add the following line:
#define BIDIRECTIONAL_SEARCH_ALGORITHM_ENABLED trueThen in your
trailblazer.cpp file, write a function with exactly the following heading that contains your algorithm:
Vector<Vertex*> bidirectionalSearch(BasicGraph& graph, Vertex* start, Vertex* end) {
...
}
You'll need to do a full rebuild of your project.