A graph is a data structure consisting of nodes (vertices) and edges that relate the nodes to each other. A graph is represented as G=VE, where V(g) is a finite, non-empty set of vertices and E(g) is a set of edges. Graphs can be directed or undirected - undirected graphs have edges with no direction, while directed graphs have edges with a direction. Trees are a special case of graphs.
A graph is a data structure consisting of nodes (vertices) and edges that relate the nodes to each other. A graph is represented as G=VE, where V(g) is a finite, non-empty set of vertices and E(g) is a set of edges. Graphs can be directed or undirected - undirected graphs have edges with no direction, while directed graphs have edges with a direction. Trees are a special case of graphs.
A graph is a data structure consisting of nodes (vertices) and edges that relate the nodes to each other. A graph is represented as G=VE, where V(g) is a finite, non-empty set of vertices and E(g) is a set of edges. Graphs can be directed or undirected - undirected graphs have edges with no direction, while directed graphs have edges with a direction. Trees are a special case of graphs.