[Math] Graph Theory – How to calculate the number of vertices and edges, if given this example

graph theory

An algorithm book Algorithm Design Manual has given an description:

Consider a graph that represents the street map of Manhattan in New York City. Every junction of two streets will be a vertex of the graph. Neighboring junctions are connected by edges. How big is this graph? Manhattan is basically a grid of 15 avenues each crossing roughly 200 streets. This gives us about 3,000 vertices and 6,000 edges, since each vertex neighbors four other vertices and each edge is shared between two vertices.

If it says "The graph is a grid of 15 avenues each crossing roughly 200 streets", how can I calculate the number of vertices and edges? Although the description above has given the answers, but I just can't understand.

Can anyone explain the calculation more easily?

Thanks

Best Answer

Each street crossing is a vertex of the graph. An avenue crosses about $200$ streets, and each of these crossings is a vertex, so each avenue contains about $200$ vertices. There are $15$ avenues, each of which contains about $200$ vertices, for a total of $15\cdot 200=3000$ vertices.

To make the description easier, imagine that the avenues all run north-south and the other streets east-west. Then each intersection of an avenue and a street has another intersection due north along the avenue. It also has one due south along the avenue, one due east along the cross street, and one due west along the cross street. That’s a total of four neighboring vertices. There must be an edge from the given vertex to each of those four, so we count $4\cdot 3000=12,000$ edges. But that’s counting each edge twice, once at each end, so there are really only half that many edges, or $6000$.

Now you might object that the vertex (i.e., intersection) in the northwest corner, say, has only two neighboring vertices, one to the east and one to the south, and similarly for the other three corners. You might also worry about the non-corner vertices along the edges, since they seem to have only three neighboring vertices each. But remember, the original figure of $200$ cross streets was only an approximation in the first place, so we might as well ignore these relatively minor edge effects: they probably don’t affect the result much more than the approximation in the $200$ figure already does.

Related Question