CLASS 35
GRAPHS
REVIEW, RESEARCH AND DISCUSS
What’s Graphs?
-
Graph is a non-linear data structure that can be looked at as a collection of vertices potentially connected by line segments named edges.
-
vertex
-A vertex or a node
is a data object that can have zero or more adjacent vertices.
-
edge
-
edge is a connection between two nodes.
-
neighbors
-
neighbors of a node are its adjacent nodes
-
degree
-
degree of a vertex is the number of edges connected to that vertex
Types of Graph:
undirected graph
-
is a graph where each edge is undirected or bi-directional. This means that the undirected graph does not move in any direction.
-
directe graph
ordigraph
-
is a graph where every edge is directed.
-
complete graph
-
is a graph is when all nodes are connected to all other nodes.
-
connected graph
-
is a graph that has all the nodes or verices have at least one edge
-
disconnected graph
-
is a graph where some nodes or vertices may not have edges.
-
cyclic
-
is a graph that has cycle which is a path of a positive length that starts and ends at the same vertex.
-
acyclic
-
is a directed graph without cycles which is when a node can be traversed through and potentially end up back at itself.