O cenário
A software team needs to design an object-oriented implementation of Dijkstra's shortest path algorithm, clarifying responsibilities of graph storage, node/edge representation, and result computation.
O que há neste desenho
Entenda as decisões por trás dele.
01
Model Graph as an interface with an abstract base class and AdjacencyListGraph concrete implementation
02
Encapsulate shortest path results in a dedicated ShortestPathResult class holding distances and predecessors
03
Represent nodes and edges as explicit classes, with edge associations to source and target nodes
Use this diagram when designing graph algorithm libraries, pathfinding engines, or teaching object-oriented structure of graph traversal algorithms.