1.7 Graphs
Basic Definitions
Definition
A graph
Types of Graphs
Undirected Graph:
Directed Graph Digraph:
Simple Graph: No loops or multiple edges.
Multigraph: Allows multiple edges.
Weighted Graph: Each edge
Vertex Degree
Degree undirected:
In-degree/Out-degree directed:
Paths and Cycles
Path: Sequence of vertices
Simple Path: No repeated vertices.
Cycle: Path with
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
Complete Bipartite
Cycle Graph
Path Graph
Tree: Connected acyclic undirected graph.
Forest: Disjoint union of trees.
Planar Graph: Can be drawn without edge crossings.
Trees
Properties
A connected graph with
n vertices andn-1 edges.Unique simple path between any two vertices.
Equivalently, acyclic and
|E|=|V|-1 .