Graphs are important data structures used to implement algorithms. There are many types of graphs. The following are my thoughts on the definitions of these types:
Graph (with no modifier): A set consisting of vertices and edges.
Connected Graph: A graph where every vertex can reach any other vertex through a path.
Complete Graph: A graph where every vertex has an edge connecting to every other vertex.
Directed Graph: A graph where every edge has a direction.
DAG (Directed Acyclic Graph): A directed graph where the edges do not form any cycles.
Tree: A tree is a data structure which is a subset of graphs. It consists of vertices and edges where every vertex can reach all others, and the edges do not form a cycle.
Spanning Tree: A spanning tree cannot stand alone; it is derived from a parent graph. It is a tree constructed by keeping all vertices and deleting some edges from the parent graph.
Insight: Sometimes these graph types can be difficult to memorize, so it is necessary to review them once in a while.
Top comments (0)