Edge

Domain: Data Structures

🎯 Motivation

An edge is the connection between two nodes in a graph. It can be directed or undirected, weighted or unweighted.

📋 Concrete Example

In a social graph, an edge between Alice and Bob means they are friends. In a road graph, an edge between two intersections means there is a road connecting them.

🔗 Analogy

A bridge connecting two islands. The bridge (edge) links the islands (nodes). Some bridges are one-way, some are two-way, some have tolls (weights).