# The web as a directed graph

## A graph

In mathematics, and more specifically in graph theory, a graph is a structure amounting to a set of objects in which some pairs of the objects are in some sense "related". The objects correspond to mathematical abstractions called vertices (also called nodes or points) and each of the related pairs of vertices is called an edge (also called an arc or line). Typically, a graph is depicted in diagrammatic form as a set of dots for the vertices, joined by lines or curves for the edges.

## A directed graph

In mathematics, and more specifically in graph theory, a directed graph (or digraph) is a graph that is a set of vertices connected by edges, where the edges have a direction associated with them.

## The web as directed graph

Each of the nodes represents a web site. Each edge represents a link either coming TO a website or leaving FROM a website. In the case of our example above, node A links to node B. Node D also links to node B.
And another example of a directed graph The web can be represented as a directed graph, also known as a web graph, which is a type of graph that consists of a set of nodes (also called vertices) and a set of edges (also called arcs) that connect the nodes. In a web graph, the nodes represent the web pages, and the edges represent the links between the pages.

In this representation, the web pages are the nodes of the graph, and the links between the pages are the edges. The direction of the edge indicates the direction of the link, from the source page (the page that contains the link) to the destination page (the page that the link points to).

For example, consider a simple web graph with three pages: A, B, and C. If page A contains a link to page B, and page B contains a link to page C, the graph would be represented as follows:

A → B → C

In this example, the edge from A to B represents a link from page A to page B, and the edge from B to C represents a link from page B to page C.

The web can be represented as a directed graph because it is a collection of interconnected pages that are linked together, and the links between the pages have a specific direction (from the source page to the destination page). This representation allows us to model the structure and connectivity of the web, and to analyze and understand how it works.

In summary, the web can be represented as a directed graph, in which the nodes represent the web pages and the edges represent the links between the pages. This representation allows us to model the structure and connectivity of the web and to analyze and understand how it works.

## Standards

These standards are used from the IB Computer Science Subject Guide

• Describe how the web can be represented as a directed graph