Now I think all of this is much clearer if I just draw some pictures.

Indeed one use to call graphs, dots and lines.

The dots would refer to the vertices, so here's four dots, or four vertices.

And the edges would be lines,

so the way you denote one of these edges is you just draw a line between the two

end points of that edge, the two vertices that it corresponds to.

So this is undirected graph with four vertices and five edges.

We can equally we'll have a directed version of this graph.

So let's still have four vertices and five edges, but

to indicate that this is directed graph and then each edge was first vertex and

the second vertex, were going to add arrows to the line.

So the arrow points to the second vertex, or to the head of the edge.

So, the first vertex is often called the tail of the edge.

So, graphs are completely fundamental,

they show up not just in computer science but in all kinds of different disciplines,

social sciences and biology being two prominent ones.

So, let me just mention a couple of reasons you might use them just off

the top of my head but literally there's hundreds or thousands of others, so

a very literal example would be road networks.

So imagine you type in asking for your driving directions from point A to point B

in some web application or software, or whatever, it computes a route for you.

What it's doing, is it's manipulating some representation of a road network,

which inevitably is going to be stored as a graph, where the vertices corresponds to

intersections and the edges correspond to individual roads.

The Web is often fruitfully thought of as a directed graph, so

here the vertices are the individual web pages, and edges correspond to hyperlinks.

So the first vertex in an edge detail is going to be the page that contains

the hyperlink.

The second vertex, or the head of the edge,

is going to be what the hyperlink points to.

So that's the Web as a directed graph.

Social networks are quite naturally represented as graphs.

So here the vertices correspond to the individuals in the social network.

And the edges correspond to relationships.

They have friendship links.

I encourage you to think about among the popular social networks these days,

which ones are undirected graphs and which ones are directed graphs,

we have some interesting examples of each of those..