Adjacency List - Application in Computer Science

Application in Computer Science

The graph pictured above has this adjacency list representation:
a adjacent to b,c
b adjacent to a,c
c adjacent to a,b

In computer science, an adjacency list is a data structure for representing graphs. In an adjacency list representation, we keep, for each vertex in the graph, a list of all other vertices which it has an edge to (that vertex's "adjacency list"). For instance, the representation suggested by van Rossum, in which a hash table is used to associate each vertex with an array of adjacent vertices, can be seen as an example of this type of representation. Another example is the representation in Cormen et al. in which an array indexed by vertex numbers points to a singly linked list of the neighbors of each vertex.

One difficulty with the adjacency list structure is that it has no obvious place to store data associated with the edges of a graph, such as the lengths or costs of the edges. To remedy this, some texts, such as that of Goodrich and Tamassia, advocate a more object oriented variant of the adjacency list structure, sometimes called an incidence list, which stores for each vertex a list of objects representing the edges incident to that vertex. To complete the structure, each edge must point back to the two vertices forming its endpoints. The extra edge objects in this version of the adjacency list cause it to use more memory than the version in which adjacent vertices are listed directly, but these extra edges are also a convenient location to store additional information about each edge (e.g. their length).

Read more about this topic:  Adjacency List

Famous quotes containing the words application, computer and/or science:

    The human mind is capable of excitement without the application of gross and violent stimulants; and he must have a very faint perception of its beauty and dignity who does not know this.
    William Wordsworth (1770–1850)

    Family life is not a computer program that runs on its own; it needs continual input from everyone.
    Neil Kurshan (20th century)

    He is not a true man of science who does not bring some sympathy to his studies, and expect to learn something by behavior as well as by application. It is childish to rest in the discovery of mere coincidences, or of partial and extraneous laws. The study of geometry is a petty and idle exercise of the mind, if it is applied to no larger system than the starry one.
    Henry David Thoreau (1817–1862)