Introduction to Graphs In our daily life, we often deal with objects and the relationships between them. For example: Cities and Roads: Each city is a point, and the road connecting two cities is a link. Social Networks: Each person is a point, and friendship or a “follow” is a link. Computer Networks / Internet: Each computer is a point, and the cable or wireless connection is a link. Electric Circuits: Each junction is a point, and wires are the links. All of these situations can be modeled using a Graph . What is a Graph? A graph is a way to represent objects and the connections between them. The objects are called vertices (or nodes) . The connections are called edges (or links) . 👉 Example: If we have 4 cities {A, B, C, D} and roads between them: A ↔ B, B ↔ C, A ↔ D This can be drawn as a graph diagram where cities are circles and roads are lines connecting them. Why Graphs? Graphs help us to: Visualize relationships between...
Comments
Post a Comment