Skip to content

Understanding Graphs

A graph is a collection of nodes (also called vertices) and edges that connect pairs of nodes. Graphs can be: - Directed or Undirected: In a directed graph, edges have a direction, while in an undirected graph, edges do not. - Weighted or Unweighted: In a weighted graph, edges have weights or costs associated with them. In an unweighted graph, all edges are considered equal. - Sparse or Dense: A sparse graph has relatively few edges compared to the number of nodes, while a dense graph has many edges.

Graphs are used to represent various real-world systems such as social networks, transportation networks, and communication networks.

Kroki