A little graph coding

You may work alone or with a partner of your choosing.

Goals

Rubric

1 - author name(s) in comment at top of graphs.py 2 - correct BFS 2 - correct DFS 2 - correct topological sort 2 - code quality (readability, not excessively inefficient, etc.)

Starting materials

Here is a little python program I wrote, called graphs.py. It consists of a single class called Graph, plus a few testing functions and a main program that calls the testing functions.

Here are two graphs expressed in the DOT graph description language: undirected.dot and directed.dot. The file format should be self-explanatory, so you can make your own similar files if you want to try your code on more test cases (which you ought to do, for sure).

Your job

We'll talk about the complexity issues in this graph implementation in class, but don't worry too much about that. Just get your methods working.

Have fun!