Graphs and subgraphs
Graphs and Subgraphs A graph is a collection of vertices (nodes) connected by edges (lines). These edges can have associated weights, indicating the str...
Graphs and Subgraphs A graph is a collection of vertices (nodes) connected by edges (lines). These edges can have associated weights, indicating the str...
Graphs and Subgraphs
A graph is a collection of vertices (nodes) connected by edges (lines). These edges can have associated weights, indicating the strength or cost of the connection between two vertices.
A subgraph is a subset of the graph that retains the structure and the relationships between the vertices. In simpler words, it is a smaller graph that can be embedded within the larger graph without overlapping any of its vertices.
Key Properties of Graphs:
Connectivity: A graph is connected if any two vertices are connected by at least one path in the graph.
Symmetry: A graph is symmetric if the edges connecting vertices A and B are the same as the edges connecting B and A.
Planar: A graph is planar if it can be drawn on a flat surface without edges crossing each other.
Subgraph Rules:
A subgraph must contain all the vertices and edges of the original graph.
The subgraph must be connected and have the same connectivity as the original graph.
The subgraph must not contain any vertices that are not present in the original graph.
Examples:
A --- B --- C
This is a graph with three vertices and four edges. The subgraph consisting of vertices A, B, and C is a subset of the original graph, as it contains all the vertices and edges of the original graph.
A --- B --- C
D --- E --- F
This graph is connected and planar, but it is not symmetric. The subgraph consisting of vertices A, B, and C is a subset of the original graph, but it is not a subgraph of the original graph