Why Use Adjacency Matrices or Adjacency Lists?
问题 I've just started learning about graphs, and something that's confusing me is why we need to use external data structures (like matrices or lists) to store which vertexes of the graph are connected to other vertices. Why can't each vertex just hold references to the vertices its connected to, like the way nodes do in a decision tree? That, to me, seems more intuitive. Thanks! 回答1: Well, this comes from a design philosophy. Whenever you have a many to many relationships, you introduce a broker