6.1 Fundamentals of Graph Theory

6 min readjuly 30, 2024

Graph theory is the backbone of many complex systems we encounter daily. From social networks to transportation routes, graphs help us model and analyze connections between entities. Understanding fundamental concepts like vertices, edges, and graph types is crucial for tackling more advanced topics in algebraic graph theory.

This section covers essential graph theory concepts, including graph types, , and traversal algorithms. These foundational ideas provide the groundwork for exploring algebraic properties of graphs, such as spectral graph theory and graph isomorphisms, which we'll dive into later in the chapter.

Basic Graph Theory Concepts

Graph Fundamentals

  • A graph is a mathematical structure consisting of a set of vertices (also called nodes) and a set of edges connecting pairs of vertices
  • Vertices represent objects or entities, while edges represent relationships or connections between the vertices
  • Graphs can be represented using various data structures, such as adjacency matrices or adjacency lists
  • The order of a graph is the number of vertices, and the size of a graph is the number of edges

Vertex Degrees

  • The of a is the number of edges incident to it
    • In an undirected graph, the degree is simply the number of edges connected to the vertex
    • In a directed graph, the in-degree is the number of incoming edges, and the out-degree is the number of outgoing edges
  • The states that the sum of the degrees of all vertices in a graph is equal to twice the number of edges
  • In a regular graph, all vertices have the same degree (cubic graph, where each vertex has degree 3)

Graph Types

Simple and Multigraphs

  • Simple graphs have no self-loops (edges connecting a vertex to itself) and no multiple edges between the same pair of vertices
  • Multigraphs allow multiple edges between the same pair of vertices but do not allow self-loops
    • Example: a transportation network where multiple roads or flights connect two cities
  • Pseudographs are a generalization of multigraphs that allow both multiple edges and self-loops

Directed and Weighted Graphs

  • Directed graphs (digraphs) consist of a set of vertices and a set of directed edges, where each has a specific direction from one vertex to another
    • Example: a social network where edges represent "following" relationships
  • Weighted graphs assign a numerical value (weight) to each edge, representing the cost, , or some other attribute associated with the connection
    • Example: a road network where weights represent the distance or travel time between cities

Special Graph Types

  • Complete graphs have an edge between every pair of vertices, denoted as KnK_n for a graph with nn vertices
  • Empty graphs have no edges at all, consisting only of isolated vertices
  • Bipartite graphs have their vertex set divided into two disjoint subsets, with edges only connecting vertices from different subsets
    • Example: a graph representing students and courses, where edges connect students to the courses they are enrolled in
  • Trees are connected graphs with no cycles, often used in hierarchical structures (binary trees, decision trees)

Graph Connectivity

Paths and Cycles

  • A is a sequence of vertices connected by edges, where no vertex is repeated
    • The length of a path is the number of edges in the sequence
    • A simple path is a path with no repeated vertices
  • A is a path that starts and ends at the same vertex, with no other repeated vertices
    • A simple cycle is a cycle with no repeated vertices (except for the start/end vertex)
  • Eulerian paths and cycles:
    • An is a path that uses every edge of the graph exactly once
    • An is a cycle that uses every edge of the graph exactly once
    • A graph has an Eulerian cycle if and only if it is connected and every vertex has an even degree

Connected Components

  • A graph is connected if there exists a path between every pair of vertices
    • Otherwise, it is disconnected and consists of multiple connected components
  • A is a maximal connected subgraph, meaning it is not a proper subgraph of any other connected subgraph
  • The number of connected components in a graph can be determined using graph traversal algorithms (DFS or BFS)

Distance and Diameter

  • The distance between two vertices is the length of the shortest path between them
    • If there is no path between the vertices, the distance is considered infinite
  • The eccentricity of a vertex is the maximum distance from that vertex to any other vertex in the graph
  • The of a graph is the maximum distance between any pair of vertices in the graph
    • Equivalently, it is the maximum eccentricity among all vertices
  • The of a graph is the minimum eccentricity among all vertices

Cut Vertices and Bridges

  • A (or articulation point) is a vertex whose removal increases the number of connected components in the graph
    • Cut vertices can be identified using DFS and keeping track of discovery and low times
  • A (or cut edge) is an edge whose removal increases the number of connected components in the graph
    • Bridges can be identified using DFS and keeping track of discovery times and parent vertices
  • The connectivity of a graph is the minimum number of vertices that need to be removed to disconnect the graph
    • A graph is kk-connected if it remains connected after removing any k1k-1 vertices

Graph Traversal Algorithms

Depth-First Search (DFS)

  • (DFS) explores as far as possible along each branch before backtracking
  • DFS uses a stack (often implemented recursively) to keep track of the vertices to visit next
  • The time complexity of DFS is O(V+E)O(V + E), where VV is the number of vertices and EE is the number of edges
  • Applications of DFS:
    • Detecting cycles in a graph
    • Finding connected components
    • of a directed acyclic graph (DAG)
    • Solving maze or puzzle problems

Breadth-First Search (BFS)

  • (BFS) explores all the neighboring vertices at the current depth before moving on to the vertices at the next depth level
  • BFS uses a queue to keep track of the vertices to visit next
  • The time complexity of BFS is O(V+E)O(V + E), where VV is the number of vertices and EE is the number of edges
  • Applications of BFS:
    • Finding the shortest path between two vertices in an unweighted graph
    • Determining the connected components of a graph
    • Solving problems related to the shortest distance or levels (e.g., social network analysis)

Advanced Traversal Techniques

  • Topological sorting: ordering the vertices of a directed acyclic graph (DAG) such that for every directed edge (u,v)(u, v), vertex uu comes before vertex vv in the ordering
    • Can be achieved using a modified DFS algorithm
  • (SCCs): maximal subgraphs of a directed graph where there is a path from each vertex to every other vertex in the subgraph
    • Tarjan's algorithm and Kosaraju's algorithm are used to find SCCs
  • checking: determining if a graph can be divided into two disjoint sets such that every edge connects a vertex in one set to a vertex in the other set
    • Can be done using a modified BFS or DFS algorithm, assigning colors to vertices

Key Terms to Review (25)

Bipartite graph: A bipartite graph is a type of graph whose vertex set can be divided into two distinct sets such that no two graph vertices within the same set are adjacent. This means that all edges in the graph connect a vertex from one set to a vertex from the other set. Bipartite graphs are essential for modeling relationships and can represent various problems in graph theory, including matching and network flow.
Breadth-first search: Breadth-first search (BFS) is an algorithm used for traversing or searching through graphs and tree data structures, exploring all of the neighbor nodes at the present depth prior to moving on to nodes at the next depth level. It systematically explores vertices in layers, which allows it to find the shortest path in unweighted graphs and ensures that all vertices are visited in a systematic order. This characteristic makes BFS crucial for various applications, such as finding connected components or exploring all possible states in a problem space.
Bridge: In graph theory, a bridge (or cut-edge) is an edge in a graph whose removal increases the number of connected components. This means that a bridge is crucial for maintaining the connectivity of the graph, as it serves as a vital link between different parts. Understanding bridges is essential for analyzing the structure and resilience of networks, including their vulnerability to edge removal.
Complete graph: A complete graph is a type of graph in which every pair of distinct vertices is connected by a unique edge. This means that if there are 'n' vertices in the graph, the number of edges is given by the formula $$ rac{n(n-1)}{2}$$. Complete graphs are significant because they represent the maximum number of edges possible for a given number of vertices, showcasing concepts like connectivity and the structure of graphs.
Connected component: A connected component in graph theory is a subset of a graph where there exists a path between any two vertices in that subset, and no vertex in the subset is connected to any vertex outside of it. This concept is important because it helps classify the structure of graphs, determining how different parts of a graph are related to one another and aiding in analyzing their overall connectivity and structure.
Connectedness: Connectedness in graph theory refers to a property of a graph where there is a path between every pair of vertices, meaning that the graph is a single cohesive unit. This concept relates closely to various aspects of graph structure, such as components and connectivity types, which help to determine how well the elements of a graph interact with one another. Understanding connectedness is essential for analyzing the relationships and pathways that exist within networks.
Connectivity: Connectivity refers to the measure of how well the vertices of a graph are connected to each other through edges. It plays a crucial role in understanding the structure and behavior of graphs, influencing properties like paths, cycles, and the ability to traverse from one vertex to another. High connectivity indicates that a graph remains connected even after the removal of some vertices or edges, which is vital for assessing network resilience and efficiency.
Cut Vertex: A cut vertex, also known as an articulation point, is a vertex in a graph whose removal increases the number of connected components. This means that if you were to remove this vertex, the graph would become disconnected, indicating that the cut vertex plays a crucial role in maintaining the overall connectivity of the graph. Understanding cut vertices helps analyze the vulnerability and resilience of networks, including social and communication structures.
Cycle: A cycle refers to a closed path in which a sequence of vertices in a graph or elements in a permutation is revisited, forming a loop. In the context of graph theory, cycles are fundamental structures that help to understand connectivity and paths within graphs. In permutation groups, cycles reveal how elements can be transformed through specific arrangements, emphasizing the idea of movement and repetition within the set.
Degree: In mathematical contexts, degree refers to a measure of the size or complexity of an object, such as a polynomial or a graph. In polynomials, the degree indicates the highest power of the variable present, which affects the polynomial's behavior and roots. In graph theory, degree describes the number of edges connected to a vertex, influencing the graph's structure and connectivity.
Depth-first search: Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. The algorithm starts at a selected node (often called the 'root') and explores as far as possible along each branch before backtracking. This approach allows DFS to visit all nodes in a structured way, making it useful for various applications such as pathfinding and cycle detection.
Diameter: In graph theory, the diameter of a graph is defined as the greatest distance between any pair of vertices within that graph. This distance is measured in terms of the number of edges in the shortest path connecting those vertices. The concept of diameter helps to understand the overall size and connectivity of a graph, reflecting how 'far apart' the most distant vertices are from each other.
Distance: In mathematics, distance is a measure of the space between two points, often represented in various contexts such as graphs or coding. It plays a critical role in understanding the relationships and structures within graphs and helps in designing effective error-correcting codes that ensure data integrity. Distance can be defined using different metrics depending on the context, including shortest paths in graphs and Hamming distance in coding theory.
Edge: An edge is a fundamental component of graph theory that represents a connection between two vertices (or nodes) in a graph. It can be thought of as a line or link that connects these points, and can carry additional information such as weight or direction. The concept of edges is crucial in understanding various properties and structures within graphs, as they help define relationships and interactions among the vertices.
Empty graph: An empty graph is a type of graph that contains no edges but may have vertices. This means that all the vertices in the graph are isolated and do not connect to one another. In the context of graph theory, an empty graph serves as a fundamental example and is often used to illustrate key concepts related to connectivity, degree of vertices, and graph properties.
Eulerian Cycle: An Eulerian cycle is a trail in a graph that visits every edge exactly once and returns to the starting vertex. This concept is tied to important graph theory principles, as it requires that every vertex in the graph has an even degree and that all vertices with non-zero degree belong to a single connected component. Understanding Eulerian cycles helps in analyzing networks, optimizing routes, and solving problems related to traversability within graphs.
Eulerian Path: An Eulerian path is a trail in a graph that visits every edge exactly once and can start and end at different vertices. This concept connects deeply with various properties of graphs, particularly concerning their connectivity and the degrees of vertices. Understanding Eulerian paths helps in exploring how different structures can be traversed efficiently, leading to insights into network design and optimization problems.
Handshaking lemma: The handshaking lemma is a fundamental principle in graph theory stating that in any undirected graph, the sum of the degrees of all vertices is equal to twice the number of edges. This principle highlights the relationship between vertices and edges, emphasizing that each edge connects two vertices and thus contributes to the degree of both. It provides a crucial tool for analyzing the structure of graphs and understanding properties like connectivity and network flows.
Leonhard Euler: Leonhard Euler was an influential Swiss mathematician and physicist, known for his extensive contributions to various fields of mathematics, including graph theory and combinatorics. His work laid the groundwork for many modern concepts and tools used in these areas, establishing fundamental principles that are still relevant today. Euler's pioneering ideas have made significant impacts on the way we understand mathematical structures and relationships.
Path: A path in graph theory is a sequence of vertices where each adjacent pair is connected by an edge, and no vertex is repeated. Paths can be used to represent various concepts such as connectivity and distance within a graph, making them fundamental to understanding the structure and behavior of graphs. They can also help in analyzing the shortest routes and traversing networks efficiently.
Radius: In graph theory, the radius of a graph is defined as the minimum eccentricity of any vertex in the graph. The eccentricity of a vertex is the greatest distance from that vertex to any other vertex in the graph. Understanding the radius helps in analyzing how connected or spread out the graph is, revealing important structural properties.
Strongly connected components: Strongly connected components are maximal subgraphs in a directed graph where every vertex is reachable from every other vertex within that component. This concept is crucial in understanding the structure of directed graphs, as it allows us to analyze the connectivity and relationships between nodes, which is vital for various applications in computer science and mathematics.
Topological Sorting: Topological sorting is a linear ordering of the vertices in a directed acyclic graph (DAG) such that for every directed edge from vertex A to vertex B, vertex A comes before vertex B in the ordering. This concept is vital in scheduling tasks where certain tasks must precede others, and it highlights the relationship between nodes based on their directed connections.
Tree: A tree is a connected graph with no cycles, consisting of vertices and edges that connects any two vertices by exactly one path. This structure ensures that there is a unique route between any pair of nodes, highlighting the hierarchical nature of relationships in many contexts. Trees are foundational in graph theory, often used to represent various types of data structures and relationships.
Vertex: A vertex is a fundamental unit in graph theory that represents a distinct point or node in a graph. It serves as a key element in the structure of a graph, connecting with other vertices through edges, which helps to form various types of graphs. Understanding vertices is essential as they can represent various entities, such as cities in a transportation network or people in a social network, and their connections significantly influence the properties and behavior of the entire graph.
© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.