Exercise 3: A Self-Referencing Employees Table as a Graph — Possible Solution ==================================================================== THE VERTICES ------------------------------ Each row in the employees table - each individual employee - is a vertex. If there are 200 employees, the graph has 200 vertices. THE EDGES ------------------------------ Each employee's manager_id column, pointing from that employee's own row to their manager's row (another row in the same table), is exactly one edge. Per this chapter's own relation-to-graph connection, this manager_id column is precisely the kind of self-referencing relation Discrete Mathematics Fundamentals Chapter 5 already described - "reports to" is a relation between employees and other employees, and a relation between elements of the same set is exactly what a graph represents directly. WHAT KIND OF GRAPH THIS PRODUCES ------------------------------ Since each edge has a direction (an employee reports TO their manager, not the reverse), this is a directed graph. Since a normal organizational structure has no employee who is (even indirectly) their own manager, this graph is also acyclic - making it specifically a tree, per this chapter's own connection to Chapter 9's own material on trees as a special, constrained kind of graph (an org chart is listed directly in this chapter's own five-connections table as a real tree example). WHY THIS WORKS AS AN ANSWER ------------------------------ The vertices and edges are identified precisely from the table's own actual columns (rows as vertices, the manager_id foreign key as edges), and the specific TYPE of graph this produces (directed, acyclic, a tree) is derived from the real-world properties of an organizational hierarchy rather than left unspecified, connecting directly back to this chapter's own relation-to-graph and tree references.