Graph Theory and Algorithms 02
Introduction to Graphs: Definition of graphs, types of graphs, graph representations, and basic terminology.
1. Definition of Graphs : A graph is a collection of points (vertices) and lines (edges) that connect them. Formally, a graph G = (V, E) consists of a set of vertices V and a set of edges E, where each edge e ∈ E connects two vertices.
2. Types of Graphs: There are several types of graphs, including:
- Undirected Graphs: Edges do not have a direction, and can be traversed in either direction. Example: The friendship network of a group of people.
Directed Graphs (Digraphs): Edges have a direction and can only be traversed in one direction. Example: The network of roads between cities.
Weighted Graphs: Edges have a weight or cost associated with them. Example: A transportation network with distances or costs assigned to each road or route.
Bipartite Graphs: Vertices can be divided into two disjoint sets such that each edge connects a vertex from one set to a vertex in the other set. Example: A dating website matching potential partners based on interests.
- Adjacency Matrix: A matrix representation where the rows and columns represent vertices, and the entries represent whether there is an edge or not. Example:
- Adjacency List: A list representation where each vertex has a list of adjacent vertices. Example:
- Edge List: A list representation where each entry is a pair of vertices that defines an edge. Example:
- Vertex: A vertex, also known as a node, is a point in the graph.
- Edge: An edge, also known as a link, is a line connecting two vertices.
- Degree: The degree of a vertex is the number of edges connected to it.
- Path: A path is a sequence of vertices connected by edges.
- Cycle: A cycle is a path that starts and ends at the same vertex.
- Connected: A graph is connected if there is a path between any pair of vertices.
- Component: A component is a connected subgraph of a graph.
- Spanning Tree: A spanning tree is a connected subgraph that includes all the vertices of the original graph but contains no cycles.
Comments
Post a Comment