How should I proceed on doing this?
This IS a homework, and I’m having a huge problem with it.
Now, the issue is that I must not use libs.
I have a graph like:
{'A': {'C': 2, 'B': 10}, 'C': {'B': 7, 'D': 2}, 'B': {}, 'D': {'A': 5, 'B': 4}}
using dictionaries, taken from a file.
I am using the algorithm at http://www.python.org/doc/essays/graphs/ to find all the paths, so there is no problem there.
But now that I have all the paths from one point to another, I need to sum the weights and get the complete cost on it.
If you could help me, and direct me on some good ways to approach it, I would appreciate it.
1 Answer