Graphs, A Quick Intro
- A graph is a mathematial structure used to represent relationships.
- A graph G=(V,E)
- V is a set of vertexes, or nodes
- E is a set of edges, or connections between vertexes.
- We frequently represent graphs as
- Circles for the vertexes
- Lines for the edges.
- In figure 1.6, page 6 the Gale-Shapley algorithm is represened as a graph
- The nodes are the individual men and women.
- The edges represent a pairing.
- A solution represents a grap where each node has exactaly one edge
- And each edge connects a man vertex with a woman vertex.
- Remember
- M: {A, B, C}
- W: {1, 2, 3}
- A: 1, 2, 3
- B: 2, 1, 3
- C 1, 2, 3
- 1: A, B, C
- 2: A, C, B
- 3: A, C, B
- S: (A, 1) (C, 2) (B, 3)
-
- We will cover graphs formally in chapter 3.