Skip to content

Graphs

Graphs

  • constitute of two things: vertices and edges
  • basically used to represent a network
  • vertices are known as nodes. edges connects multiple nodes.

Types of Edges (based on direction)

  • Undirected: basically means bidirectional
  • Directed: have a single direction and particular orientation. example: A->B: A is connected to B and not the other way around

Types of Edges (based on weights)

  • Weighted: carries some weight. here, weight refers to the cost it will take to travel through the edge
  • Unweighted: carries no weight. used show if a connection exists