The solutions for problem set 11 are actually for se other assignment. Would it be possible for someone to post the correct solutions? I have been unable to figure out how to implement bruteForceSearch with the set of parameters given in the skeleton code. How is the algorithm supposed to work?
is this for the 2011 class? The MitMap graph problem? The lectures explain how to do a depth-first (exhautive) search thru the graph - that is the algorithm you need to use. Did you thoroughly read The problem set instructions. The docstring for the function is pretty explicit. Have you extended the classes in graph.py?
I did read the instructions carefully. In the example, the parameters of the shortest path function include 'visited=[]' which keeps track of which nodes have been examined. I understand how this implementation works. However, in the skeleton code for the problem set, the parameters have something called 'current_path=[]'. I assume that this is supposed to store a path as it is being examined. Also, there is no visited=[] parameter. So, it appears to be calling for a different sort of algorithm. I just haven't been able to figure out exactly what it is they are looking for.
are you doing the 2011 OCW class? - you lost me. the function from the 2011 class and the EDx class looks like this def bruteForceSearch(digraph, start, end, maxTotalDist, maxDistOutdoors): they want you to do a depth-first exhaustive search thru the graph, finding the shortest path from 'start' to 'end' with a maximum distance outdoors constraint. the edges are weighted so you need to keep track of the weights as well as the nodes in a path - or just keep track of the nodes and figure a way to calculate the total weight of a path based on its nodes.
Join our real-time social learning platform and learn together with your friends!