Definition

Basic Definition

A graph consists of , a non-empty set of vertices (or nodes) and , a set of edges. Each edge either one or two vertices associated with it, called its endpoints. An edge is said to connect its endpoints.

Basic Types

A undirected graph in which each edge connects two different vertices (i.e. no loops) and where no two edges connect the same pair of vertices is called a simple graph.

Graphs that may have multiple edges connecting the same vertices are called multigraphs.

Graphs that may include loops, and possibly multiple edges connecting the same pair of vertices or a vertex to itself, are sometimes called pseudographs.

Graph Terminology

Neighbors and Neighborhood (Undirected Graph)

Two vertices and in an undirected graph are called adjacent (or neighbors) in if and are endpoints of an edge of . Such an edge is called incident with the vertices and and is said to connect and .

The set of all neighbors of a vertex of , denoted by , is called the neighborhood of . If is a subset of , we denoted by the set of all vertices in that are adjacent to at least one vertex in . So, .

Degree (Undirected Graph)

The degree of a vertex in an undirected graph is the number of edges incident with it, except that a loop at a vertex contributes twice to the degree of that vertex. The degree of the vertex is denoted by

A vertex of degree zero is called isolated. It follows that an isolated vertex is not adjacent to any vertex. A vertex is pendant if and only if it has degree one

The

Let be an undirected graph with edges. Then

(Note that this applies even if multiple edges and loops are present)

As a result of this theorem, an undirected graph has an even number of vertices of odd degree.

Adjacent (Directed Graph)

When is an edge of the graph with directed edges, is said to be adjacent to and is said to be adjacent from . The vertex is called the initial vertex of , and is called the terminal or end vertex of . The initial and terminal vertex of a loop are the same.

Degree (Directed Graph)

In a graph with directed edges the in-degree of a vertex , denoted by , is the number of edges with as their terminal vertex. The out-degree of , denoted by , is the number of edges with as their initial vertex. Note that a loop at a vertex contributes 1 to both the in-degree and the out-degree of this vertex

Let be a graph with directed edges. Then

Some Special Simple Graphs

Complete Graphs

A complete graph on vertices, denoted by , is a simple graph that contains exactly one edge between each pair of distinct vertices.

Cycles

A cycle , , consists of vertices and edges and .

Wheels

We obtain a wheel when we add an additional vertex to a cycle , for , and connect this new vertex to each of the vertices in , by new edges.

-Cubes

An -dimensional hypercube, or -cube, denoted by , is a graph that has vertices representing the bit strings of length . The vertices are adjacent if and only if the bit strings that they represent differ in exactly on bit position.

New Graphs from Old

Subgraph

A subgraph of a graph is a graph , where and . A subgraph of is a proper subgraph of if .

Let be a simple graph. The subgraph induced by a subset of the vertex set is the graph , where the edge set contains an edge in if and only if both endpoints of this edge are in .

Graph Unions

The union of two simple graphs and is the simple graph with vertex set and edge set . The union of and id denoted by .

Representation

Representing Graphs

Adjacency Lists

VertexAdjacent Vertices

Adjacency Matrices

Suppose that is a simple graph where . Suppose that the vertices of are listed arbitrarily as . The adjacency matrix of , with respect to this listing of the vertices, is the zero-one matrix , such that

Incidence Matrices

Let be an undirected graph. Suppose that are vertices and are the edges of . Then the incidence matrix with respect to this ordering of and is the matrix , where

Incidence matrices can also be used to represent multiple edges and loops. Multiple edges are represented in the incidence matrix using columns with identical entries, because these edges are incident with the same pair of vertices. Loops are represented using a column with exactly one entry equal to , corresponding to the vertex that is incident with this loop.