A graph is composed of vertices and edges. Vertices are connected by edges. A graph can be directed or undirected. In a directed graph, edges have direction but in an undirected graph edges do not have direction. The degree of a vertex is the number of edges connected to it. A path in a graph is a sequence of adjacent vertices and a cycle is a path from a vertex back to itself. Connectedness refers to whether there is a path between all pairs of vertices in an undirected graph. Graphs can be represented using adjacency matrices or adjacency lists.