Graphs

Graphs are mathematical concepts that have found many uses in computer science. Graphs come in many different flavors, many of which have found uses in computer programs. Some flavors are:

  • Simple graph
  • Undirected or directed graphs
  • Cyclic or acyclic graphs
  • labeled graphs
  • Weighted graphs
  • Infinite graphs
  • and many more too numerous to mention.

Most graphs are defined as a slight alteration of the following rules.

  • A graph is made up of two sets called Vertices and Edges.
  • The Verticies are drawn from some underlying type, and the set may be finite or infinite.
  • Each element of the Edge set is a pair consisting of two elements from the Vertices set.
  • Graphs are often depicted visually, by drawing the elements of the Vertices set as boxes or circles, and drawing the elements of the edge set as lines or arcs between the boxes or circles. There is an arc between v1 and v2 if (v1,v2) is an element of the Edge set.
Posted on by