← back
Graph Data Structure
Graphs are an essential data structure in computer science for modeling networks.
- vertex: A node in a graph.
- edge: A connection between two vertices.
- adjacent: When an edge exists between vertices.
- path: A sequence of one or more edges between vertices.
- disconnected: Graph where at least two vertices have no path connecting them.
- weighted: Graph where edges have an associated cost.
- directed: Graph where travel between vertices can be restricted to a single direction.
- cycle: A path which begins and ends at the same vertex.
- adjacency matrix: Graph representation where vertices are both the rows and the columns. Each cell represents a possible edge.
- adjacency list: Graph representation where each vertex has a list of all the vertices it shares an edge with.