🧠

Graph

Examples of graphs

  • Nodes --> vertices
    • Objects
  • Lines --> edges
    • Connect the nodes
    • Describe relationships among vertices
    • Sometimes called arcs
  • Undirected
    • Edges are two-way
    • No direction
  • Directed
    • Edges go one way
    • Direction of edge is important
  • Weighted
    • Values are attached to the edges
  • Adjacent vertices
    • Two vertices connected by an edge

Computer Science Data Structure