A fine the best route, an internet can be modeled as a graph. A graph in computer science is a set of nodes and edges (ines) that connect the nodes. To model an internet as a graph, we can think of each router as a node and each network between a pair of router as an edge. An internet is, in fact, modeled as a weighted graph, in which each edge is associated with a cost. If a weighted graph is used to represent a geographical area the nodes can be cities and the edges can be roads connecting the cities; the weights, in this case, are distances between cities. In routing, however, the cost of an edge has a different interpretation in different routing protocols, which we discuss in a later section. For the moment, we assume that there is a cost associated with each edge. If there is no edge between the nodes, the cost is infinity Figure 20.1 shows how an internet can be modeled as a graph