Overview
A graph consists of a set of vertices and a set of edges.
Key terms
- Graph = a set of vertices and a set of edges .
- Directed graph = also called digraph; a graph whose edges each have an associated direction (i.e., the edge pair is ordered).
- Weighted graph = edges have an associated weight value.
- Edge = also called arc; a pair of vertices (i.e., with ).
- Adjacent = two vertices are adjacent if there is an edge connecting them (i.e., there is such a pair ).
- Degree = for a vertex, is the number of edges attached; alternatively, the number of neighbors for that vertex.
- Neighborhood = the set of all neighbors for a vertex .
- Walk = a sequence of vertices where each vertex is adjacent to the next.
- Path = a sequence of vertices with pairs for all ; alternatively, a walk where no vertex is repeated.
- Path length = the number of edges in the path.
- Hamiltonian path = a path containing all vertices.
- Loop = a path that contains an edge from a vertex to itself.
- Cycle = a path from a vertex to itself in a directed graph that contains at least one edge (i.e., a path with that has at least length 1).
Types of graphs
- We say is connected to if there is a -path in G. A connected graph has the property that for all , there exists a -path.