What is graph?

A graph is a way to show how things are connected. It’s made up of points called “nodes” (or “vertices”) and lines called “edges” that link the nodes together. Think of a social network: each person is a node, and a friendship between two people is an edge.

Let's break it down

  • Node (Vertex): The individual item or object you’re interested in (e.g., a city, a computer, a user).
  • Edge (Link): The connection between two nodes (e.g., a road, a cable, a friendship).
  • Directed vs. Undirected: In a directed graph, edges have a direction (like a one‑way street). In an undirected graph, edges work both ways.
  • Weighted vs. Unweighted: A weighted graph gives each edge a number (like distance or cost). An unweighted graph treats all edges the same.

Why does it matter?

Graphs let us model real‑world relationships in a visual and mathematical way. By turning complex connections into nodes and edges, we can use algorithms to find shortest routes, detect communities, recommend friends, and solve many other problems that involve linked data.

Where is it used?

  • Social media platforms (friend suggestions, feed ranking)
  • Navigation apps (shortest path, traffic routing)
  • Internet infrastructure (routing data packets)
  • Recommendation systems (movies, products)
  • Biology (protein interaction networks)
  • Project management (task dependencies)

Good things about it

  • Flexibility: Can represent almost any kind of relationship.
  • Powerful algorithms: Many well‑studied methods exist for searching, sorting, and optimizing graphs.
  • Scalable: Works for tiny networks (a few nodes) up to massive ones (billions of nodes).
  • Intuitive visualisation: Easy to draw and understand at a glance.

Not-so-good things

  • Complexity can grow fast: Large graphs may need a lot of memory and processing power.
  • Hard to maintain: Keeping data up‑to‑date when connections change frequently can be tricky.
  • Algorithm choice matters: Using the wrong algorithm can lead to slow performance or incorrect results.
  • Visualization limits: Very large graphs become messy and hard to read without special tools.