Protocol-oriented programming puts interfaces and composition ahead of inheritance. Protocols serve as the main building blocks, while generics keep concrete vertex types flexible. section 4.1
A protocol-first graph framework combines:
- An Edge protocol describing vertex indices, reversal, and printable representations. section 4.1
A reusable city graph
An UnweightedGraph<String> stores cities as vertices and adds undirected connections such as Seattle–Chicago and Phoenix–Dallas. Printing the graph exposes each city's adjacency list.
