2.7. Lecture 6: Python 4

Before this class you should:

  • Read Think Python:

    • Chapter 15: Classes and objects;

    • Chapter 16: Classes and functions;

    • Chapter 17: Classes and methods; and

    • Chapter 18: Inheritance

Before next class you should:

  • Read Think Complexity, Chapter 2

  • Read the Wikipedia page about graphs at https://en.wikipedia.org/wiki/Graph_(discrete_mathematics) and answer the following questions:

    1. What is a simple graph? For our discussion today, we will assume that all graphs are simple graphs. This is a common assumption for many graph algorithms – so common it is often unstated.

    2. What is a regular graph? What is a complete graph? Prove that a complete graph is regular.

    3. What is a path? What is a cycle?

    4. What is a forest? What is a tree? Note: a graph is connected if there is a path from every node to every other node.