1.7 Graphs
Basic Definitions
Definition
A graph consists of a set of vertices and a set of edges . Each edge connects either two vertices (undirected) or is an ordered pair (directed).
Types of Graphs
Undirected Graph: .
Directed Graph Digraph: .
Simple Graph: No loops or multiple edges.
Multigraph: Allows multiple edges.
Weighted Graph: Each edge has a weight .
Vertex Degree
Degree undirected:
.
In-degree/Out-degree directed:
Paths and Cycles
Path: Sequence of vertices with .
Simple Path: No repeated vertices.
Cycle: Path with and edges distinct.
Length: Number of edges in a path or cycle.
Connectivity
Undirected
Connected Graph: A path exists between every pair of vertices. Connected Component: Maximal connected subgraph.
Directed
Strongly Connected: Path in both directions between every pair.
Weakly Connected: Underlying undirected graph is connected.
Special Graphs
Complete Graph : Every pair of distinct vertices is adjacent.
Complete Bipartite : Bipartition with all cross edges.
Cycle Graph : Single cycle of length .
Path Graph : Simple path with vertices.
Tree: Connected acyclic undirected graph.
Forest: Disjoint union of trees.
Planar Graph: Can be drawn without edge crossings.
Trees
Properties
A connected graph with vertices and edges.
Unique simple path between any two vertices.
Equivalently, acyclic and .
v Feb