A graph is a pair of sets:
We often use G = (V,E) to denote a graph whose name is G, whose vertex set is V, and whose edge set is E.
Notes:
Consider the graph G = (\{a,b,c,d\}, \{\{a,c\}, \{a,d\}, \{d,c\}, \{a,b\}\}). Note that this is a pair of sets, enclosed in parentheses. The first element of the pair is the set \{a,b,c,d\}, and these are the vertices. The second element is \{\{a,c\}, \{a,d\}, \{d,c\}, \{a,b\}\} and these are the edges. There are four edges: One with endpoints a and c; one with endpoints a and d; a third with endpoints d and c; and a fourth with endpoints a and b. Note that because the edges are given as sets, not as ordered pairs, each edge is the same no matter what order we list the endpoints in. A visualization of the graph G is:
When visualized in this way -- with each vertex shown as a point and each edge shown as a line segment between its endpoints -- graphs are representations of networks.
Consider the following visualization of a graph:
Note that there are five vertices and 10 edges, one edge between every pair of different vertices. In notation, this graph is G = (V,E) where V = \{1,2,3,4,5\} (the vertices) and E = \{\{1,2\}, \{1,3\}, \{1,4\}, \{1,5\}. \{2,3\}, \{2,4\}, \{2,5\}, \{3,4\}, \{3,5\}, \{4,5\}\}. (This graph is called the Complete graph on five vertices.)