Page 38 - Algorithms Notes for Professionals
P. 38
Let us first learn some basic definitions on Graph Theory.
Graph:
Let's say, we have 6 cities. We mark them as 1, 2, 3, 4, 5, 6. Now we connect the cities that have roads between each
other.
This is a simple graph where some cities are shown with the roads that are connecting them. In Graph Theory, we
call each of these cities Node or Vertex and the roads are called Edge. Graph is simply a connection of these nodes
and edges.
A node can represent a lot of things. In some graphs, nodes represent cities, some represent airports, some
represent a square in a chessboard. Edge represents the relation between each nodes. That relation can be the
time to go from one airport to another, the moves of a knight from one square to all the other squares etc.
colegiohispanomexicano.net – Algorithms Notes 34